How to List the Disks on Debian 12

Disks in Debian 12 are similar to the partitions on the Windows platform. The storage devices are divided into different small portions known as the disk on Debian and partitions on Windows. 

These disks are used to store and manage the data on the computer. It is helpful to keep the data in different disks to extract them easily when needed. Listing down the disks on Debian means finding out the information about the disks including the memory consumed and it is also helpful in identifying the disks on the computer. 

There are various command line interface and graphical user interface methods that are used for listing down the disks on Debian. The most common and important listing methods for the disks are explained in this post with the below-mentioned outline:

  1. What are the Various Types of Disks on Debian
  2. Why is it Important to List the Disks on Debian
  3. What are the Methods for Listing Down the Disks on Debian
  4. Method 1: List Down the Disks on Debian 12 Using the fdisk Command
  5. Method 2: List Down the Disks on Debian 12 Using the lsblk Command
  6. Method 3: List Down the Disks on Debian 12 Using the proc File
  7. Method 4: List Down the Disks on Debian 12 Using the dev Directory
  8. Method 5: List Down the Disks on Debian 12 Using the GParted Application
  9. Method 6: List Down the Disks on Debian 12 Using the GNOME Disks Application
  10. Method 7: List Down the Disks on Debian 12 Using the cfdisk Command
  11. Method 8: List Down the Disks on Debian 12 Using the hwinfoCommand
  12. Method 9: List Down the Disks on Debian 12 Using the sfdisk Command
  13. Method 10: List Down the Disks on Debian 12 Using the lshw Command

Let’s find a detailed explanation of the methods by exploring the types of disks on Debian 12. 

What are the Various Types of Disks on Debian 12?

There are two types of disks on every operating system including Debian 12. Both types of disks are explained in the table below. 

Type of DiskExplanation
Physical DisksThese are the storage devices that are connected to the computer to store the data including the hard disks or USB drives. 
Logical DisksThese disks are the virtual space created by partitioning the physical disks. These disks can be managed by the Logical Volume Management tool in the Debian 12

Now the reason is that both, physical and logical disks, are listed down and have been discussed in the next section. 

Why is it Important to List the Disks on Debian 12?

There are various important reasons for listing down the disks on Debian 12, some of them are explained below:

  • It helps to make the decision for managing the storage disks 
  • It helps in formatting, partitioning, and mounting of the disks
  • It also helps to identify defective disks in troubleshooting
  • It is also important to list down the disks in order to create the backup or to perform the backup operations
  • Listing down the disks is also important for power optimization
  • Users can also monitor the unusual activity performed by listing down the disks

For the above-mentioned reasons, the disks can be listed following the instructions explained in the next section. 

What are the Methods for Listing Down the Disks on Debian 12?

There are various methods of listing down the disks on Debian including the command line interfaces and graphical user interface methods. 

Method 1: List Down the Disks on Debian 12 Using the fdisk Command

The first method for listing down the available disks on Debian 12 is by using the fdisk command. The fdisk command is used to manage the partition tables and supports the GPT, SGI, and BSD formats of partition tables. 

It can also be used to list down the available disks on Debian 12,so use the “l” option of the fdisk to display all the disks on the Debian 12:

$ sudo fdisk -l

It can be seen from the above output that all the logical and physical disks have been displayed. The information including the size, model, I/O size, and disklabel type have been displayed on the screen. 

To explore more details of the fdisk command, it is recommended to visit the mentioned blog.

Method 2: List Down the Disks on Debian 12 Using the lsblk Command

Another method to display the list of the disks on Debian 12 is by running the lsblk command. The lsblk command is used to display the information of all available disks, especially the block devices. 

To use the lsblk command for listing down the disks on Debian 12, run the command:

$ sudo lsblk

The output shows the information on the disks of Debian 12 in a tree-like format that can be understood easily. 

Method 3: List Down the Disks on Debian 12 Using the df Command

The df command is used for the amount of space available on the partitions. The space is shown in the blocks of 1k by default with the df command. 

For listing down the disks on Debian 12, use the “h” option of the df command as shown below:

$ sudo df -h

The total size, use space, and available space have been displayed on all the available disks on Debian 12. 

The detailed information on the df command including the installation and usage has been explained in the mentioned post.

Method 3: List Down the Disks on Debian 12 Using the proc File

The proc file in Debian 12 contains the information related to the system and this system information also includes the information on the available disks. 

To list down the disk using the proc file, run the below-mentioned command:

$ cat /proc/partitions

The partitions or the disks have been displayed. 

Method 4: List Down the Disks on Debian 12 Using the dev Directory

The dev directory contains the information on the connected and available devices information and this directory also has information related to the disks that can be displayed using the ls command. 

To list down the information of the disk using the dev directory, run the command:

$ ls /dev/sd*

The names of all the available disks have been displayed. According to the common convention of SCSI and SATA disks, all the disk names should start with the “sd”, therefore, the sd* has been used in the above-mentioned command. 

Method 5: List Down the Disks on Debian 12 Using the GParted Application

The GParted application is the Graphical User Interface that is used for the management of the disks on Debian 12 and it can also be used to list down the disks on Debian 12. 

To install the GParted on Debian 12, run the command:

$ sudo apt install gparted -y

When the installation of GParted is completed, open the installed application from the Application’s menu:

From the dashboard of the GParted application, all the basic information of the available disks has been displayed. 

The comprehensive explanation of the GParted application on Debian 12 has been explained in the mentioned blog. Though this blog is for Ubuntu the methods can be used for Debian 12. 

Method 6: List Down the Disks on Debian 12 Using the GNOME Disks Application

Another Graphical User Interface method to list down the Disks on Debian 12 is by using the “GNOME Disks” application. This application comes pre-installed on Debian 12, but if it is not, then it can be installed by executing the command:

$ sudo apt install gnome-disk-utility -y

When the application has successfully installed on Debian 12, then launch the GNOME Disks application:

The application is available with the name “Disks” and it will display the disks of the computer. To know more about any specific disk, click on it:

It will display the information about that specific disk.

Method 7: List Down the Disks on Debian 12 Using the cfdisk Command

Also, the cfdisk command can be used to list down the available disks on Debian. This contains all the information of the partition tables and can be executed with the command:

$ sudo cfdisk

It displayed the information in the form of the table as shown. 

Method 8: List Down the Disks on Debian 12 Using the hwinfoCommand

The hwinfo command is used to display the information of the hardware including the disks and the network interfaces. To display the list of the disks on Debian 12 with the hwinfo command, run the command:

$ sudo hwinfo --disk --short

The names of the disks have been displayed on the screen that are connected physically to the computer. 

Method 9: List Down the Disks on Debian 12 Using the sfdisk Command

To list down the physical and logical disks on Debian 12, one also known command is “sfdisk” command. It will display the summary of the size, type, and sector size of all the disks. 

To list down the disks on Debian 12 using the sfdisk command, run the command:

$ sudo sfdisk -l

The disks on the Debian 12 have been displayed on the screen with the sfdisk command. 

Method 10: List Down the Disks on Debian 12 Using the lshw Command

The lshw command is also used to display the information of the hardware devices and it is used to display the information of the physical disks especially. To use the lshw command, first install the command with the following command:

$ sudo apt install lshw -y

After the installation of lshw is completed, then run the command:

$ sudo lshw

It will display the information of all the hardware devices connected to the computer. To list down the disks only using the lshw command, run the command:

$ sudo lshw -class disk

As can be seen, it has displayed the physical disks on Debian 12. 

All these explained methods can be used for listing down the physical and logical disks on Debian 12. 

Conclusion

To list the disks on Debian 12, ten different methods can be used including the fdisk, cfdisk, sfdisk, lsblk, hwinfo, and lshw commands in the terminal. The graphical user interface applications including the GParted and Disks can also be used for listing down the disks on Debian 12. All the methods mentioned above with some other methods to list the disks on Debian 12 have been explained in this post.