Linux Hard Drive – How to Find Out What Hard Disks Are Attached

hard drivelinuxpartition

Here's an easy question for you guys: How do I find out what hard drives are attached to a linux box? I'm hoping for a single command that can give me a nice list of all ata/scsi/etc drives.

I've catted /proc/partitions in the past to do this, but I wonder if that still works if there's a drive with no partitions on it.

Best Answer

sudo lshw -class disk

gives you everything but the mount point

  *-cdrom                 
       description: CD-R/CD-RW writer
       product: 52MAXX 3252AJ
       vendor: Memorex
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/cdrw
       logical name: /dev/scd0
       logical name: /dev/sr0
       version: QWS3
       capabilities: removable audio cd-r cd-rw
       configuration: ansiversion=5 status=nodisc
  *-disk:0
       description: SCSI Disk
       product: ZIP 100
       vendor: IOMEGA
       physical id: 0.1.0
       bus info: scsi@0:0.1.0
       logical name: /dev/sda
       version: 12.A
       capabilities: removable
       configuration: ansiversion=5
     *-medium
          physical id: 0
          logical name: /dev/sda
  *-disk:1
       description: ATA Disk
       product: WDC WD800AB-00CB
       vendor: Western Digital
       physical id: 1
       bus info: scsi@1:0.0.0
       logical name: /dev/sdb
       version: 04.0
       serial: WD-WCAA52477019
       size: 74GiB (80GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=90909090

sudo lshw -class disk -html