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?
List Disks on Linux using lsblk. The easiest way to list disks on Linux is to use the “lsblk” command with no options. The “type” column will mention the “disk” as well as optional partitions and LVM available on it. Optionally, you can use the “-f” option for “filesystems“.
First, open GNOME Disks from the Application Menu. GNOME Disks should be opened. On the left side, you will see all the attached storage devices/disks on your computer. To find more information about the disk, click to select the disk.
How to show Unmounted drives using the “fdisk” command: The format disk or fdisk is a Linux menu-driven command-line tool to create and utilize the disk partition table. Use the “-l” option to read data from the /proc/partitions file and display it. You can also specify the disk name with the fdisk command.
Typing fdisk -l at the command prompt will list all of the partitions on your Linux system. You can also use the fdisk command to create, delete, or resize partitions.
sudo lshw -class disk
will show you the available disks in the system
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With