The job of the system administrator can be pretty challenging. On top of that, it will be a big concern when they identify the disc is not working correctly. In most cases, there will be a need to list all the drives available on the computer with their sizes. It will ensure that they don’t run out of space.
Remember, you could have the server down when there is no storage available. It will prevent you from accessing it at all. You must know how to use the Linux list drives function in such situations. So the guide here will be helpful for you.
What to Know About Hard Drives
The hard drives on the systems are identifiable by various device drivers in the kernel. They have a unique device ID at the boot time. It allows it to be mountable to Android later. The hard drives are differentiable based on the interface used for interactions with them. Some common types of drives will include SCSI, SAS, etc. It is essential to check the storage available on the drive so that there are no complications and you can use the function correctly.
There are many commands you can use in the Linux environment to list the drives mounted on the system. The linux list drives details here will surely help you if you are new to it.
Linux List Drives Using lsblk
It is the easiest way to list drives on Linux. You can make use of this command with no options. The type column indicates that the drive and the lvm are the optional partitions available. In contrast, you can use the “-f” option for file systems. This way, the desk listing is successful with the file systems and partitions on them.
You will get multiple columns when you execute the “lsblk” command.
- Name- It represents the device’s name. It is a Linux device that has got a specific prefix. And this will vary depending on the device’s nature.
- Filesystem type- If the partition contains a file system, the listing must be done in the column.
- Label- In some cases, to avoid using UUID, you can choose the label of your device.
- UUID- It is a universally unique identifier. It must be unique worldwide and will help identify the device easily
- Mountpoint- When you have a mounted file system, you can see the actual mount point.
Once you take care of this, you will successfully list your drives on Linux using “lsblk.” But remember, you might want to list your desk with the actual hardware information. Also, remember if you wish to remove the disc from the Linux machine, then having an idea about the actual physical part will be pretty helpful.
Also Read: How to Switch Git to a Specified Branch?
List Drive Information Using lshw
To list the drive information on Linux, you must use the “lshw” with the “class” option. Make sure here you specify “drive.” When you combine the “grep” with the “lshw” command, you will retrieve the specification about a device from the system.
$ sudo lshw -class drive
$ sudo lshw -class drive | grep <drive_name> -A 5 -B
You will get all the drives available on your computer when you run the “lshw” with no grep filter. To target a specific drive on the computer, you can “pipe” the command with “grep” to list your desired drive. Using this command, you will have much more information about the drive, like the product description and vendor, along with the actual bus information. Thus, now you can easily unplug or replace it with another one.
You can complete the job quickly when you know the process for Linux list drives. Getting the required information will be faster. So make sure that you pay attention to every detail.
List Devices Using fdrive Or hwinfo
Various other commands can help with the listing apart from linux list drives. The two other common commands here are fdrive and hwinfo. First, you need to use the “fdrive” command with the “-l” option. With this, you will see all the partitions available on the machine and the drive.
$ sudo fdrive -1
However, “fdrive” is not the only way for Linux list drives. You can also use the “hwinfo” command with the “-drive” option.
Using the “hwinfo” command without any option will make reading quite challenging. Luckily there is an option for you to restrict the output to the drive list. For this, you need to use the “-short” option.
$ sudo hwinfo. –drive –short
Look at the “/dev/drive” folder for the advanced system administrators.
Also Read: How to Unstage File on Git Without losing changes?
Linux List Drives Using Graphical Interface
If you wish to follow Linux list drives using the graphical interface, you need to go to the Activities and look for the program called the Drives.
When you are in the Activities menu, you can type Drives. When you click on it, you will get a linux list drives available on your Linux machine. Here you will be able to see both hard drives and the block devices, which are the lbm devices. They are the ones that you might have previously created during the distribution installation.
When you click on a specific drive, you will see its serial number, the disc size partition, and the contents stored in it. Now you will have the list of all the drives plugged into your computer.
Frequently Asked Questions
How to list the available drives?
The easiest way to list the drive on Linux will be to use the “lsblk” command with no options. Here the “type” represents the drive as well as the optional partitions. Also, here you will see the lvm available on it. You can even use the “-f” option for the filesystem.
How to check the drive status?
Df-T is the command that will help check the drive use along with each block file system type. You can get this information in a graphical form when you use the GNOME desktop drives.
What is used to list partitions?
The “-I” argument stands for listing all the partitions. It is used with the fdrive command to view all the available partitions on Linux. The sections will be available by their device names.
How many partitions can be there in a drive?
As of now, Linux allows for only four primary partitions. By subdividing the primary partitions, you can have a much larger number of logical partitions. But remember, only the primary section can be subdivided.
Understanding the linux list drives command is extremely important when you have to use the Linux list drives feature. It will help ease the process and get the required information fast. The guide here cleared all the details.
So you can follow the one as required and complete the process quickly. Make sure that you take your time to research well and understand the commands properly so that when using them, you do not face any difficulty.