HOW TO LIST ALL CONNECTED HARD DRIVES ON UBUNTU

How to List All Connected Hard Drives on Ubuntu

How to List All Connected Hard Drives on Ubuntu

Blog Article





When working with multiple hard drives on an Ubuntu system, it's essential to be able to identify and manage them efficiently. Whether you're a seasoned administrator or a casual user, knowing how to list all connected hard drives is a crucial skill. In this article, we'll explore the various methods to list all connected hard drives on Ubuntu, making it easier to manage your storage devices.

Using the lsblk Command

The lsblk command is a simple and effective way to list all connected hard drives on Ubuntu. This command displays information about all available block devices, including hard drives, solid-state drives, and USB drives. To use lsblk, follow these steps:

  1. Open a terminal on your Ubuntu system.

  2. Type lsblk and press Enter.

  3. The lsblk command will display a list of all connected block devices, including their device names, sizes, and mount points.


Using the fdisk Command

Another way to list all connected hard drives on Ubuntu is by using the fdisk command. This command provides a more detailed output than lsblk, including information about the disk's partitions and file systems. To use fdisk, follow these steps:

  1. Open a terminal on your Ubuntu system.

  2. Type sudo fdisk -l and press Enter.

  3. Enter your administrator password when prompted.

  4. The fdisk command will display a detailed list of all connected hard drives, including their device names, sizes, and partition information.


Using the df Command

The df command is primarily used to display information about disk usage, but it can also be used to list all connected hard drives on Ubuntu. To use df, follow these steps:

  1. Open a terminal on your Ubuntu system.

  2. Type df -h and press Enter.

  3. The df command will display a list of all mounted file systems, including their device names, sizes, and usage statistics.


Using the blkid Command

The blkid command is used to display information about block devices, including their device names, sizes, and file systems. To use blkid, follow these steps:

  1. Open a terminal on your Ubuntu system.

  2. Type sudo blkid and press Enter.

  3. Enter your administrator password when prompted.

  4. The blkid command will display a list of all connected hard drives, including their device names, sizes, and file system information.


Using the sudo parted -l Command

The parted command is a powerful tool for managing disk partitions on Ubuntu. To list all connected hard drives using parted, follow these steps:

  1. Open a terminal on your Ubuntu system.

  2. Type sudo parted -l and press Enter.

  3. Enter your administrator password when prompted.

  4. The parted command will display a detailed list of all connected hard drives, including their device names, sizes, and partition information.


In conclusion, there are several ways to list all connected hard drives on Ubuntu, each with its own advantages and disadvantages. Whether you prefer the simplicity of lsblk or the detailed output of fdisk, knowing how to list all connected hard drives is an essential skill for any Ubuntu user. By following the methods outlined in this article, you'll be able to efficiently manage your storage devices and keep your system running smoothly.

Reference: How to list all connected hard drives on terminal in Ubuntu

Report this page