How To Find Hard Disk Information on Linux

In this article, we want to teach you How To Find Hard Disk Information on Linux.

Hard Disk Also known as Hard Drive or HDD is a technology that is used to store the OS, apps, and all of the data files on your computer.

This guide intends to show you how to use the Linux Commands to display your hard disk information:

  • lsblk command
  • hdparm command
  • lshw command
  • smartctl command

Steps To Find Hard Disk Information on Linux

At this point, you can follow the steps below on how to use these commands to find your hard disk info.

1 – Use lsblk command on Linux

You can use the following lsblk commands to get a list of available block devices.

Block devices are the devices such as hard drives, CD-ROM drives, RAM disks, etc.

# lsblk
# lsblk /dev/DISK
# lsblk /dev/sda

Also, you can use the following command to list all disks and their names:

ls -lF /dev/disk/by-id/

Linux shows block devices such as hard disk attributes. To do this, you can use the following command:

blkid

2 – Find Drive Information on Linux with hdparm command

The “hdparm” command tool is used to provide the interface for kernel-supported devices. You can easily use this tool to find the drive information.

First, you need to install this tool on your Linux server. To do this, you can use the following commands:

On Debian / Ubuntu, use the following command:

apt install hdparm -y

On Centos / RHEL, you can use the following command:

yum install hdparm -y

Then, use the following to display complete information about a drive:

hdparm -I /dev/sda

3 – Use lshw command on Linux

The “lshw” command is a small tool to display complete information on hardware configuration. This command will show you the CPU version, memory configuration, cache information, bus speed, and other PowerPC machines running on the backend.

First, you need to install it on your Linux server. To do this, use the following commands:

On Debian / Ubuntu, use the following command:

apt install lshw -y

On Centos / RHEL, you can use the following command:

yum install lshw -y

To display all disks and storage controllers in the system, you can use the following command:

lshw -class disk -class storage

Also, you can find Linux disks names with the following command:

lshw -short -C disk

Another way is to use the fdisk command:

fdisk -l

4 – Use smartctl command on Linux

You can use the smartctl command to check for error information about the hardware RAID.

You need to install this tool on your Linux system. To install it you can use the following commands:

On Debian / Ubuntu:

apt install smartmontools -y

On Centos / RHEL:

yum install smartmontools -y

Then, start the smartctl service on your Linux servers with the commands below:

For Debian / Ubuntu:

/etc/init.d/smartmontools start

For Centos / RHEL:

service smartd start ; chkconfig smartd on

To get information about /dev/sda run the command below:

smartctl -d ata -a -i /dev/sda

Conclusion

At this point, you have learned to find information about your hard disk on Linux with the different Linux commands. These commands are so helpful and easy to use, they will help you to find anything you want to know about your hard drive.

Hope you enjoy it. You may be interested in these articles on the orcacore blog page:

Fix Error Failed to load SELinux policy freezing

How To Shutdown Linux Via Command Line

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!