List all Hard Drives

Messages about a failing hard drive meant that I wanted to list all the installed drives so that I could determine which needed to be replaced.

Browsing the Internet there are many recommendations to use the command lshw

However, I found that by default its not included within the Debian installation.

but can be installed using

apt install lshw

Without additional parameters the following list covering many different aspects of the computer. However, it’s possible to hone the list to interested parts, in our example the hard drives.

lshw -class disk

Which gave something like:

*-disk                    
       description: ATA Disk
       product: QEMU HARDDISK
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: 2.5+
       serial: QM00001
       size: 94GiB (1000GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=8f3832f373
  *-cdrom
       description: DVD READER
       product: QEMU DVD-ROM
       physical id: 0
       bus info: scsi@1:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/sr0
       version: 2.5+
       serial: 1913E1F58737
       size: 1863GiB (2TB)
       capabilities: removable audio dvd
       configuration: ansiversion=5 status=nodisc

Another option was the command lsblk

lsblk

Shown below is an example of running the command.

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 1.8T  0 disk
├─sda1   8:1    0 923.6G  0 part /home/projects
├─sda2   8:2    0 890.5G  0 part /home/sites
└─sda5   8:5    0   7.9G  0 part [SWAP]
sr0     11:0    1   4.4G  0 rom