How to Check Linux Hard Disk Size, Type, and Hardware Details

Keeping track of the Linux system’s hardware is one of the routine tasks carried out by system administrators. One of the vital hardware components in a Linux machine is the hard disk.

In Linux, block volumes or hard drives follow a naming convention given by device files. For example, /dev/sda represents the first SCSI or SATA disk on the system, /dev/sdb represents the second SCSI disk (sometimes a removable hard drive), and so on.

Having knowledge of the block volumes attached to your system is key and it allows for proper monitoring and resource tracking.

In this tutorial, we explore various ways that you can use to find out the type of hard disks available on your Linux machine.

1. lsblk Command – Find File System Type in Linux

The lsblk command is a utility that prints out information about the specified block volumes mounted on your system. It references the udev database and the sysfs filesystem to gather information about your hard drives.

It reads the LABELs, UUIDs, and filesystem types from block devices and prints them out to the terminal.

Without any command arguments, the lsblk command prints the following information. From the output, you can see that we have two volumes in the system; the sda and sdb volumes.

The sda is the primary drive which has two partitions – sda1 which is the boot partition and sda2 which encompasses both the root and swap partitions. The sdb volume is a removable drive with a single partition – sdb1.

$ lsblk 
Find Block Devices in Linux
Find Block Devices in Linux

To retrieve additional information about the mounted block volumes, pass the -f option for ‘filesystems‘ as shown. This prints out more detailed information such as the filesystem type, label, and the UUID

$ lsblk -f
Find Mounted Devices in Linux
Find Mounted Devices in Linux

2. fdisk Command – Find File System Info in Linux

fdisk utility is a command line tool that is used for creating and manipulating disk partitions.

The -l option, allows you to list detailed information about disk drives such as disk type and size, disk model, sector size, and other additional information.

$ sudo fdisk -l
Check Linux Disk Info
Check Linux Disk Info

3. hwinfo Command – Find Linux Disk Hardware Info

Another command you can use to check out the hard disk type is the hwinfo utility, which is a free and open-source utility for finding out the hardware information of a Linux system.

With the --disk argument, the hwinfo command prints out all the hardware information pertaining to the block volumes or drives attached to the system.

$ hwinfo --disk
Check Linux Disk Hardware Details
Check Linux Disk Hardware Details

4. lshw Command – Find Linux Hard Disk Type

The lshw is a command-line tool that extracts fine details about the hardware configuration of a machine. It reports detailed information such as mainboard configuration, firmware version, memory configuration, CPU version and speed and so much more.

Combining lshw with -class disk options prints out detailed information about your hard drives, which includes the description, product, vendor, bus info, version, size and so much more.

$ sudo lshw -class disk
Find Linux Hard Disk Type
Find Linux Hard Disk Type

5. Disk Utility – Check Linux Disk Info from GUI

Lastly, you can view hard disk information using the ‘Disks‘ application that is available for Linux distributions running the GNOME desktop environment.

This provides the following GUI dashboard with a list of all mounted disk volumes and CDROM.

Linux Disk Utility
Linux Disk Utility

In this guide, we have covered various ways of finding the type of hard disk mounted on your Linux system. Did we miss something? Let us know in the comment section.

If you read this far, tweet to the author to show them you care. Tweet a thanks
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies.

Each tutorial at GeeksVeda is created by a team of experienced writers so that it meets our high-quality standards.

Join the GeeksVeda Weekly Newsletter (More Than 5,467 Programmers Have Subscribed)
Was this article helpful? Please add a comment to show your appreciation and support.

Got Something to Say? Join the Discussion...