Debian

How to List Disks in Debian 12

How to List Disks in Debian 12

In Debian 12, a disk is a physical storage device that is the same as the partitions on your Windows devices. The storage devices such as hard drives or USBs are divided into different partitions on Debian 12 known as disks to manage the stored data easily. The partitions of these devices are /dev/sda, /dev/sdb, and so on. From the disks, you can easily extract data.

Listing all the available disks on your system is important for power optimization and disk management. You can view the available storage and all the information related to your disks through the methods mentioned in this guide.

What are the Various Types of Disks on Debian 12

The following are the two types of disks available on Debian 12:

1: Physical Disks: The physical disks are the devices connected to a computer to store data, such as hard disk drives or USB.

2: Logical Disks: The logical disks are used to partition the hard disks, and they are managed by the logical volume tool in Debian 12.

 

How to List Disks in Debian 12?

The Debian system allows the users to list all the available disks from:

  • Terminal
  • GUI

 

How to List Disks in Debian 12 Through Terminal

You can list disks in Debian 12 through the terminal using:

  • df Command
  • fdisk Command
  • lsblk Command
  • cfdisk Command
  • parted Command
  • sfdisk Command
  • lshw Utility
  • hwinfo Utility
  • dev Directory
  • proc File

How to List Disk in Debian 12 Through Terminal Using df Command

The df command can be run by any user, and it gives you information about the total and available space in the disk. Execute the below command in Debian 12 to list the disks:

df

The list of long numbers can be difficult to understand. The most common method is to use this command with the -h argument to view the data in a human-readable format:

df -h

The df command shows the size of the used and available space in the disk with the location of the directory where it is physically mounted in Debian 12.

You can also use the -T argument with the df command in Debian to see the type of the file system as an additional information:

df -T

 

How to List Disk in Debian 12 Through Terminal Using fdisk command

The fdisk is another mostly used command in Linux systems that displays the list of all partitions. To display all disks in Debian 12, you can use the fdisk command with sudo privileges and -l flag:

sudo fdisk -l

The command shows the summary of the entire amount of space in bytes and also provides the start and end of the sectors.

 

How to List Disk in Debian 12 Through Terminal Using lsblk Command

The lsblk command is another effective way to list down all the available disks in your Debian 12. You use this command without any argument to display the simple list of all disks on your Debian system.

lsblk

You can also use this command with the -a flag for displaying the list of all empty block devices as well:

lsblk -a

The same type of output can be retrieved in Debian 12 by using the lsblk command with –all flag:

lsblk --all

If you want to display the list of partitions in Debian 12 rather than the tree, you can run the following command:

lsblk -l

The following command shows the file system of each partition. It will display the disks and file system formatted on them:

lsblk -f

 

How to List Disk in Debian 12 Through Terminal Using cfdisk Command

The cfdisk command is the most advanced and interactive command to list all disks in Debian 12. It also allows users to manage the disks and perform various actions such as delete, resize, type, and write:

sudo cfdisk

Click on the disk and choose from the available options to perform the specific action on the selected disk:

 

How to List Disk in Debian 12 Through Terminal Using parted Command

The parted command also displays the list of all partitions and allows you to manage them on Debian. This command also shows the brand and model of your hard disk along with the total disk size and type of connectivity:

sudo parted -l

 

 

How to List Disk in Debian 12 Through Terminal Using sfdisk Command

The sfdisk command is similar to the fdisk command but it allows you to check the physical and logical volumes of the partitions as well as the summary of the partitions such as the type, and their size. You must run this command with sudo privileges followed by -l argument:

sudo sfdisk -l

 

How to List Disk in Debian 12 Through Terminal Using lshw Utility

The lshw is a command line utility that displays all the available disks on your system. It is also used to show the information of all physical disks of your system. First, you have to install this utility on your Debian 12 using the following command:

sudo apt install lshw -y

After installing the lshw utility, run the following command to view the information related to the connected hardware devices:

sudo lshw

To list down all the disks, execute the following command in your terminal:

sudo lshw -class disk

 

How to List Disk in Debian 12 Through Terminal Using hwinfo Utility

hwinfo is another command line utility of Linux systems to view the disk information and you can install this utility by executing the below written command:

sudo apt install hwinfo -y

Once installed, execute the following command to display the information related to all disks:

sudo hwinfo --disk

To get the list of all available disks in concise form, run the following command:

sudo hwinfo --disk --short

 

How to List Disk in Debian 12 Through Terminal Using the dev directory

To get the advanced information related to your system, you can view the /dev/disk directory in the Debian 12:

ls -l /dev/disk/

You can navigate to the by-id folder through the following command to get the information of disks:

ls -l /dev/disk/by-id

 

How to List Disk in Debian 12 Through Terminal Using proc file

The proc file in Debian 12 has all the information related to your system and available disks. To get this information execute the following command:

cat /proc/partitions

 

How to List Disks in Debian 12 Through GUI

Besides, using the terminal to list disks in Debian 12, you can also use the GUI. In the GUI you can use the following two ways to view the disk information in Debian:

 

How to List Disks in Debian 12 in GUI Using the GNOME Disks Application

On most of the Linux distributions including Debian 12, the GNOME Disks application comes pre-installed, if it is not available on your system, you can download it by executing the following command:

sudo apt install gnome-disk-utility -y

Once you have installed it on your system, follow these steps:

Step 1: Go to Activities on your system and search for the program Disks:

 

Step 2: The list of disks available on the Linux system will appear under the Disks. You can click on a specific disk to see the size, serial number, partitions, and content stored on it:

 

How to List Disks in Debian 12 in GUI Using the Gparted Application

The Gparted application is used to manage the disks on Debian 12. You can also use this tool to view the information related to the disks. Follow the below steps to list disks using the Gparted application:

Step 1: To install this tool on your Debian 12, execute the following command:

sudo apt install gparted -y

Step 2: Once installed, open it from the application menu:

Step 3: The information of all the available disks will appear on your screen:

 

Conclusion

There are various methods to list disks on Debian 12. You can either run commands in the terminal or use the GUI-based tools to list disks and view the information such as available and use size, type of the disk, and filesystem. We have discussed the numerous commands such as df, fdisk, lsblk cfdisk, parted, sfdisk, lshw, and hwinfo. We have also discussed the proc file and dev directory method to get advanced information related to the available disks. The most available commands give you the power to manage the hard disks on Debian 12. If you want to view the information from the GUI you can use the GNOME disks application and Gparted. We have explained all these methods in detail in this guide.

Similar Posts