How to checked the server hardware info on Linux
How to Check memory size
Basicly there are 5 way to checked memory size on linux:
- dmesg
- /proc/meminfo
- free
- top
- lhsw (Ubuntu and fedora)
Using dmesg command
To check memory size in Linux using dmesg command , run the following command:
# dmesg |grep -i memory Memory: 2072472k/2097024k available (2138k kernel code, 23276k reserved, 868k data, 240k init, 1179520k highmem) Freeing initrd memory: 1515k freed Total HugeTLB memory allocated, 0 Non-volatile memory driver v1.2 Freeing unused kernel memory: 240k freed
Checked the /proc/meminfo files
We can also check memory size in linux using /proc information ,run following from the command line:
# cat /proc/meminfo |grep -i memtotal MemTotal: 2075116 kB
Using Free command
We can also check memory size on Linux using free command, run the following:
# free -m
total used free shared buffers cached
Mem: 2026 1589 437 0 349 466
-/+ buffers/cache: 773 1252
Swap: 3812 0 3812
Using top command
Linux also comes with top command, top can be run to check real memory size and memory utilization.Top display total memory size,used memory,free memory ,memory buffers size and swap memory utilization :
# top
top – 18:11:08 up 2 days, 5:53, 2 users, load average: 0.12, 0.87, 1.51
Tasks: 154 total, 1 running, 153 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.5%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2075116k total, 1640432k used, 434684k free, 358264k buffers
Swap: 3903784k total, 200k used, 3903584k free, 477984k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 2036 640 548 S 0 0.0 0:01.71 init
2 root RT 0 0 0 0 S 0 0.0 0:00.73 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
Using lhsw command
Ubuntu and fedora linux also comes with package called lshw (list hardware) which provides detailed information on memory size, how many memory dims available, memory slots free along with other Linux system Hardware information .Run lshw and scroll down to *-memory section :
#lshw |grep
*-memory
description: System Memory
physical id: 39
slot: System board or motherboard
size: 1GB
How to Check HDD size
You can use fdisk and df command to checked the harddisk size
Using df command
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 9835048 5650736 3676660 61% /
tmpfs 1037556 0 1037556 0% /dev/shm
/dev/sdb1 69436796 26951008 38901692 41% /home
/dev/sda3 56720252 35154916 18684080 66% /var
Display hard disk partition size in Mega bytes
# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 11G 5.8G 3.8G 61% /
tmpfs 1.1G 0 1.1G 0% /dev/shm
/dev/sdb1 72G 28G 40G 41% /home
/dev/sda3 59G 36G 20G 66% /var
Using fdisk command
fdisk command is partition table manipulator for Linux. But it can be use to display total hard disk site. You must type the following command as the root user:
# fdisk -l | grep Disk
Disk /dev/sda: 73.4 GB, 73407868928 bytes
Disk /dev/sdb: 73.4 GB, 73407868928 bytes
How to checked processor info
look into /proc/cpuinfo
# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 3
cpu MHz : 3000.456
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips : 6004.87
processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 3
cpu MHz : 3000.456
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips : 6000.63
processor : 2
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 3
cpu MHz : 3000.456
cache size : 2048 KB
physical id : 3
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips : 6000.74
processor : 3
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 3
cpu MHz : 3000.456
cache size : 2048 KB
physical id : 3
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips : 6000.73
You can checked the other hardware info on /proc/ directory
How to checked OS version
you can checked your current OS version by looking into /etc/*release
# cat /etc/*release
Fedora Core release 6 (Zod)
How to checked your memory type and
you can use dmidecode command
# dmidecode –type 17
# dmidecode 2.9
SMBIOS 2.5 present.
Handle 0x0033, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0031
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: None
Locator: DIMM_A1
Bank Locator: BANK0
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: Manufacturer0
Serial Number: SerNum0
Asset Tag: AssetTagNum0
Part Number: PartNum0
Handle 0x0035, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0031
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM_A2
Bank Locator: BANK1
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer1
Serial Number: SerNum1
Asset Tag: AssetTagNum1
Part Number: PartNum1
Handle 0x0037, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0031
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM_B1
Bank Locator: BANK2
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer2
Serial Number: SerNum2
Asset Tag: AssetTagNum2
Part Number: PartNum2
Handle 0x0039, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0031
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM_B2
Bank Locator: BANK3
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer3
Serial Number: SerNum3
Asset Tag: AssetTagNum3
Part Number: PartNum3
it means you are using memory ddr2 pc 667 , and the other 3 slots are empty (from the info there were 4 slots)
Here is more about dmidecode
Understanding BIOS keywords
dmidecode --type {KEYWORD / Number }
You need to pass dmidecode following keywords:
- bios
- system
- baseboard
- chassis
- processor
- memory
- cache
- connector
- slot
All DMI types you need to use with dmidecode –type {Number}:
# Type | Short Description |
0 | BIOS |
1 | System |
2 | Base Board |
3 | Chassis |
4 | Processor |
5 | Memory Controller |
6 | Memory Module |
7 | Cache |
8 | Port Connector |
9 | System Slots |
10 | On Board Devices |
11 | OEM Strings |
12 | System Configuration Options |
13 | BIOS Language |
14 | Group Associations |
15 | System Event Log |
16 | Physical Memory Array |
17 | Memory Device |
18 | 32-bit Memory Error |
19 | Memory Array Mapped Address |
20 | Memory Device Mapped Address |
21 | Built-in Pointing Device |
22 | Portable Battery |
23 | System Reset |
24 | Hardware Security |
25 | System Power Controls |
26 | Voltage Probe |
27 | Cooling Device |
28 | Temperature Probe |
29 | Electrical Current Probe |
30 | Out-of-band Remote Access |
31 | Boot Integrity Services |
32 | System Boot |
33 | 64-bit Memory Error |
34 | Management Device |
35 | Management Device Component |
36 | Management Device Threshold Data |
37 | Memory Channel |
38 | IPMI Device |
39 | Power Supply |
Display Power supply information, enter:
# dmidecode --type 39
Display CPU information, enter:
# dmidecode --type processor
Read man page for more information:
$ man dmidecode
April 21st, 2009 at 1:02 pm
Useful Article…Thank U