List all harddrives in a linux system

Allan picture Allan · Aug 18, 2011 · Viewed 49k times · Source

I'm having problems to detect which one of my block devices is the hard drive. My system has a cd-rom drive, USB drives, and a single hard drive of unknown vendor/type.

How can I identify the hard drive with a linux command, script, or C application?

Answer

Daniel Fekete picture Daniel Fekete · Aug 18, 2011
sudo lshw -class disk

will show you the available disks in the system