Wise people learn when they can; fools learn when they must - Arthur Wellesley

Wednesday, 22 February 2017

RHEL-6 (2) KNOW YOUR SYSTEM-P2


RHEL-6 (2)
              KNOW YOUR SYSTEM-P2

How to know about the CPU architecture of my system?
How to know about the Physical Processors in my system?
How to know about the Processor Cores of my system?
How to know about the Virtual Processors of my system?
How to know about the CPU Vendor/Model/Frequency?
How many HDD’s and of what capacity are present in my system?
How to know about the Vendor/model info of attached scsi devices?
How to know about the bad blocks on HDD?
What are the active partitions on my system?
How much free space left on partition?
How to know about the File System Type?
How to know about the utilization of inodes?
How to show the size of a directory?
How to show the files and directories sorted by size?



CPU & PROCESSORS:-

[root@rhel6-server ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 2394.715
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx hypervisor lahf_lm ida arat epb xsaveopt pln pts dts
bogomips        : 4789.43
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

[root@rhel6-server ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 42
Stepping:              7
CPU MHz:               2394.715
BogoMIPS:              4789.43
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0

[root@rhel6-server ~]# lscpu |grep -i architecture
Architecture:          x86_64

[root@rhel6-server ~]# cat /proc/cpuinfo | grep processor
processor       : 0
[root@rhel6-server ~]# cat /proc/cpuinfo | grep processor | wc -l
1
=========================
[root@rhel6-server ~]# cat /proc/cpuinfo | grep processor
processor       : 0
processor       : 1
processor       : 2
processor       : 3
[root@rhel6-server ~]# cat /proc/cpuinfo | grep processor | wc -l
4
[root@rhel6-server ~]# cat /proc/cpuinfo | grep 'core id'
core id         : 0
core id         : 1
core id         : 0
core id         : 1

[root@rhel6-server ~]# nproc
4
The nproc command just prints out the number of processing units available. Note that the number of processing units might not always be the same as number of cores.

CASE-1
Physical CPU’s:
[root@rhel6-server ~]# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
2

No. of Cores:
[root@rhel6-server ~]# cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores       : 2

2 mean that each physical CPU has 2 cores on it. If cpu cores was 1 then the CPU’s single core.

Virtual Processors:

[root@rhel6-server ~]# cat /proc/cpuinfo | grep "^processor"
processor       : 0
processor       : 1
processor       : 2
processor       : 3

2 physical CPUs x 2 cores each = 4 virtual processor’s.

CASE-2

Physical CPU’s:
[root@rhel6-server ~]# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
1

No. of Cores:
[root@rhel6-server ~]# cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores       : 3

Virtual Processors:
[root@rhel6-server ~]# cat /proc/cpuinfo | grep "^processor"
processor       : 0
processor       : 1
processor       : 2

1 physical CPUs x 3 cores each = 3 virtual processor’s.

If the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading. Hyper-threading will only work with the SMP kernel.

[root@rhel6-server ~]# cat /proc/cpuinfo | egrep -i "vendor_id|model name|mhz"
vendor_id       : GenuineIntel
model name      : Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
cpu MHz         : 2394.715
vendor_id       : GenuineIntel
model name      : Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
cpu MHz         : 2394.715
vendor_id       : GenuineIntel
model name      : Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
cpu MHz         : 2394.715

HDD & PARTITIONS:-

[root@rhel6-test1 ~]# fdisk -l |grep -i disk
Disk /dev/sda: 21.5 GB, 21474836480 bytes
Disk identifier: 0x0006e28e
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
Disk identifier: 0xde44b0f7
Disk /dev/sdc: 21.5 GB, 21474836480 bytes
Disk identifier: 0x00000000

[root@rhel6-test1 ~]# cat /proc/partitions
major minor  #blocks  name

   8        0   20971520 sda
   8        1     307200 sda1
   8        2    4128768 sda2
   8        3   16534528 sda3
   8       16   20971520 sdb
   8       17    2103490 sdb1
   8       32   20971520 sdc

[root@rhel6-test1 ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              16G  2.3G   13G  16% /
tmpfs                 370M   76K  370M   1% /dev/shm
/dev/sda1             291M   37M  240M  14% /boot
/dev/sdb1             2.0G   82M  1.8G   5% /home
/dev/sr0              3.5G  3.5G     0 100% /media

[root@rhel6-server ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
  Type:   CD-ROM                           ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware,  Model: VMware Virtual S Rev: 1.0
  Type:   Direct-Access                    ANSI  SCSI revision: 02
Host: scsi2 Channel: 00 Id: 01 Lun: 00
  Vendor: VMware,  Model: VMware Virtual S Rev: 1.0
  Type:   Direct-Access                    ANSI  SCSI revision: 02
Host: scsi2 Channel: 00 Id: 02 Lun: 00
  Vendor: VMware,  Model: VMware Virtual S Rev: 1.0
  Type:   Direct-Access                    ANSI  SCSI revision: 02
Host: scsi3 Channel: 00 Id: 00 Lun: 00
  Vendor: JetFlash Model: Transcend 32GB   Rev: 8.07
  Type:   Direct-Access                    ANSI  SCSI revision: 02

[root@rhel6-server ~]# smartctl -i /dev/sda
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

Vendor:               VMware,
Product:              VMware Virtual S
Revision:             1.0
User Capacity:        21,474,836,480 bytes [21.4 GB]
Logical block size:   512 bytes
Device type:          disk
Local Time is:        Fri Feb 17 11:16:58 2017 IST
Device does not support SMART

[root@rhel6-server ~]# smartctl -i /dev/sdd
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

/dev/sdd: Unknown USB bridge [0x8564:0x1000 (0x100)]
Smartctl: please specify device type with the -d option.

Use smartctl -h to get a usage summary

The smartctl command act as a control and monitor Utility for SMART disks under Linux and Unix like operating systems

[root@rhel6-server bin]# badblocks -v /dev/sdb
Checking blocks 0 to 20971519
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found.

FILE SYSTEM INFO:

FS TYPE:
[root@rhel6-server ~]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda6     ext4    15047132   6713596   7569172  48% /
tmpfs        tmpfs      508256        72    508184   1% /dev/shm
/dev/sda1     ext4      495844     37487    432757   8% /boot
/dev/sda3     ext4     1032088     34084    945576   4% /home
/dev/sda2     ext4     3023760     70052   2800108   3% /opt

INODES:

[root@rhel6-server ~]# df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda6             956592  100540  856052   11% /
tmpfs                 127064       3  127061    1% /dev/shm
/dev/sda1             128016      39  127977    1% /boot
/dev/sda3              65536      19   65517    1% /home
/dev/sda2             192000      12  191988    1% /opt

DIR SIZE:

[root@rhel6-server ~]# du -sh /var/log
3.0M    /var/log

[root@rhel6-server ~]# du -sh /usr/bin
159M    /usr/bin

SORT BY FILE SIZE:

[root@rhel6-server ~]# cd /usr/bin
[root@rhel6-server bin]# du -sk *|sort –n


No comments:

Post a Comment