Linux command to display the number of hard drive slots your machine has

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Linux command to display the number of hard drive slots your machine has



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.





Welcome to Stackoverflow. Please take some time to read the help pages, especially the sections named "What topics can I ask about here?". Your question does not seem to be about programming. Your question could be more appropriate on one of the many stackexchange sites, namely superuser.com
– Adrian W
Aug 8 at 17:50





Can’t you use fdisk?
– danglingpointer
Aug 8 at 18:32





It provides information on installed drives not the actual number of slots the machine has. There are commands where it will provide the slot number associated with the installed hard drive but I want to know if there is a command that can provide information on how many drive slots there are in the machine regardless of if there are hard drives installed or not. In my case, when there are not drives installed.
– fantasma
Aug 8 at 18:46






Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.
– jww
Aug 8 at 20:05




1 Answer
1



lsblk should list all block devices. If you want only physical disks you can use lsblk -d.


lsblk


lsblk -d



Example:


lsblk -o name,serial



Output:


NAME SERIAL
sda S2U5J1VZ500792
├─sda1
└─sda9
sdb W3APDFP8
├─sdb1
└─sdb9





Already tried that as well. It only shows installed drives. I'm looking for 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.
– fantasma
Aug 8 at 18:16






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard