Checking Linux Server Hardware Information


Jephe Wu - http://linuxtechres.blogspot.com


Objective: get most of hardware information without physical checking/opening server
Environment: CentOS 6.1 64bit


Steps:
# check server hardware info
dmidecode
biosdecode
lshw



root@serv01:~/ # which lshw
/usr/sbin/lshw
root@serv01:~/ # rpm -qf /usr/sbin/lshw
lshw-B.02.12.01-1.el5


# check release info and architecture
lsb_release -a
uname -a


# list initrd.img file content 
lsinitrd /boot/initrd.img

[root@db01 boot]# which lsinitrd
/sbin/lsinitrd
[root@db01 boot]# rpm -qf /sbin/lsinitrd
dracut-004-53.el6.noarch


# check cpu
lscpu
cat /proc/cpuinfo

[root@db01 ~]# which lscpu
/usr/bin/lscpu
[root@db01 ~]# rpm -qf /usr/bin/lscpu
util-linux-ng-2.17.2-12.4.el6.x86_64

# check storage
cat /proc/partitions
df -h
multipath -ll
lspci -v
lssd
lssg
lsblk

[root@db01 ~]# which lssd
/usr/bin/lssd
[root@db01 ~]# rpm -qf /usr/bin/lssd
fibreutils-3.2-3.x86_64
[root@db01 ~]# which lssg
/usr/bin/lssg
[root@db01 ~]# rpm -qf /usr/bin/lssg
fibreutils-3.2-3.x86_64


# check additional pci card, which physical slot and VGA card memory etc
lspci -vvv
.....
Physical Slot: 1
.....


# check relationship between files and process
lsof | grep filename


# drivers and modules info
lsmod




# check memory
cat /proc/meminfo
free [-m|-g]


# check boot info
dmesg
less /var/log/messages


# check usb and pcmcia info
lsusb [-v]
lspcmcia

# others
lshal