Reputation: 71
I'm currently working on a Linux machine and I want to know if there is a command that tells you the number of hard drive slots the actual machine has regardless of whether there are hard drives installed or not. I know reading the machine's manual provides that information but is there any way to get this information by command line?
I've tried lshw and dmidecode commands but they do not provide information on slots. This specific machine has 6 slots for hard drives to be installed with only 3 currently occupied. It does not have hardware raid either so I cannot use megacli.
Any help would be appreciated.
Upvotes: 6
Views: 11460
Reputation: 101
dmidecode command should be able to give information about your motherboard and then you can google the specs for the motherboard
sudo dmidecode -t 2
To find system slots, use
sudo dmidecode -t 9
Upvotes: 0
Reputation: 11
What about this command:
smartctl --scan
Output:
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d scsi # /dev/sdc, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/sde -d scsi # /dev/sde, SCSI device
/dev/sdf -d scsi # /dev/sdf, SCSI device
/dev/bus/0 -d megaraid,8 # /dev/bus/0 [megaraid_disk_08], SCSI device
/dev/bus/0 -d megaraid,9 # /dev/bus/0 [megaraid_disk_09], SCSI device
/dev/bus/0 -d megaraid,10 # /dev/bus/0 [megaraid_disk_10], SCSI device
/dev/bus/0 -d megaraid,11 # /dev/bus/0 [megaraid_disk_11], SCSI device
/dev/bus/0 -d megaraid,12 # /dev/bus/0 [megaraid_disk_12], SCSI device
/dev/bus/0 -d megaraid,13 # /dev/bus/0 [megaraid_disk_13], SCSI device
Upvotes: 1
Reputation: 9
Can it be done by lspci or lsscsi command. It can tell you the PCI or SCSI slots available and used.
Upvotes: -1
Reputation: 161
lsblk
should list all block devices. If you want only physical disks you can use lsblk -d
.
Example:
lsblk -o name,serial
Output:
NAME SERIAL
sda S2U5J1VZ500792
├─sda1
└─sda9
sdb W3APDFP8
├─sdb1
└─sdb9
Upvotes: 0