Small tutorial: List the disks on Ubuntu

Click ▲Follow "CU Technology Community" and mark the official account with a star

More exciting first time direct

In this article, I will show you how to list the disks (ie SSDs, HDDs, USB drives) connected to your computer from Ubuntu.

**Use the lsblk command: **

You can use the lsblk command to list all connected disks on your computer from Ubuntu as follows:

$ sudo lsblk

A TYPE disk is a disk physically connected on the computer.

The TYPE part is the partition of the disk.

The lsblk command without any filters shows many loop devices used by the Ubuntu snap application. I know this is annoying, but fortunately, you can easily remove them from the list.

You can use the -e7 option with lsblk to hide the loop device.

$ sudo lsblk -e7

Now that the loop device is gone, the list now looks clearer.

You can also use grep to perform the same operation.

$ sudo lsblk | grep -v '^loop'

You can also hide CD/DVD rom devices from the list. Just add -e11 option and -e7 option together.

$ sudo lsblk -e7 -e11

You can also use lsblk to list the connected disks on your computer and their vendor and model information, as shown below:

$ sudo lsblk --scsi

As you can see, all connected disks on my computer are listed. Also listed their supplier and model information.

**Use the fdisk command: **

You can also use the fdisk command to list all connected disks on your computer from Ubuntu, as shown below:

$ sudo fdisk -l

fdisk displays all disks, the total size of the disk, partitions, the size of each partition, etc. But the list is too long, there is no easy way to hide the loop device.

However, if you know the device name of the disk (ie sda, sdb), you can easily find more information about this device using fdisk.

$ sudo fdisk -l / dev / sdb

You can also use fdisk to find information about multiple disks at the same time. Just put the disk paths as fdisk parameters one by one.

$ sudo fdisk -l / dev / sda / dev / sdb

**Use the parted command: **

You can use parted to do the same thing. By default, parted may not be installed on Ubuntu. But you can easily install it with the following command:

$ sudo apt install parted -y

For all storage disks connected to the computer, you can get fdisk similar to the output, as shown below:

$ sudo parted -l

As you can see, the output format is the same as in fdisk, but parted does not list annoying loop devices. This is a good thing.

Use GNOME Disk Application:

If you don't like using the command line, you can use many graphical programs to list the disks on Ubuntu.

GNOME Disk is the default partitioning application on the GNOME desktop environment. You can use it to list the disks connected to your computer.

First, open "GNOME Disk" from the "Applications" menu.

The GNOME disk should open. On the left, you will see all connected storage devices/disks on your computer. To find more information about the disk, click to select the disk. The disk size, partitions, and other information about the disk should be listed on the right.

Use the GParted app:

If you don't like the command line, you can also use the GParted Partition Editor application to list all connected disks on your computer.

GParted is not installed by default on Ubuntu. But you can easily install GParted with the following command:

$ sudo apt install gparted -y

GParted should be installed.

You can now launch GParted from the "Applications" menu.

In order to use GParted, you will need super user permissions. Enter your login password and click Authenticate.

GParted should start. You can select a disk from the drop-down menu in the upper right corner of GParted.

As you can see, all the disks connected to my computer are listed in the drop-down menu. Just select a disk from the list.

The partition of the selected disk should be displayed.

This is how you list all the connected disks of Ubuntu on your computer.

I have shown some common methods in this article. If you know of any other way to list disks on Ubuntu, you can write it in the comments.

Only good-looking people can order

Recommended Posts

Small tutorial: List the disks on Ubuntu
Install the latest Python 3.6 version on Ubuntu
Detailed tutorial on installing python3.7 for ubuntu18
The apt-get command of Ubuntu basic tutorial
The implementation of the Ubuntu18.04 installation Pycharm tutorial
Install the flat theme latabulous on Ubuntu 16.04
Install NeoVim on Ubuntu: the easiest way
Detailed tutorial for installing CUDA9.0 on Ubuntu 16.04
Detailed tutorial for installing phpMyAdmin on Ubuntu 18.04
How to modify the hostname on Ubuntu 20.04
Ubuntu operation tutorial
Solve the problem of installing VMwareTools on Ubuntu 18.04
Install the CPU version of Caffe on Ubuntu
lamp on ubuntu
The ultimate guide to install gooderp on ubuntu
Turn off and turn on the firewall in ubuntu
How to run the parsing server on Ubuntu 14.04
The latest method of installing Mongodb on Ubuntu 16.04
Solve the problem of installing Theano on Ubuntu19
How to check the installed JDK on Ubuntu
How to install the latest MySQL on Ubuntu 18.04
How to add the gzip module to Nginx on Ubuntu 14.04
Install the Ethereum client Mist on windows and ubuntu
The pits encountered when installing yii2 advanced on Ubuntu
install vscode on ubuntu18
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install docker on Ubuntu
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
Install mysql on Ubuntu 14.04
Ubuntu16.04 install Mongodb tutorial
Install Django on ubuntu
Install Pytorch+CUDA on Ubuntu 16.04
Install Python3 on Ubuntu 14.04
Install rJava on Ubuntu18
Install JDK10+ on Ubuntu
Install Python3 on Ubuntu 16.04
ROS learning---Install ROS on Ubuntu
Install KDE on Ubuntu16.04.2
Install Docker on Ubuntu18
Install Python3.7 on Ubuntu
Install flashplayer on Ubuntu
ubuntu14.04 install jdk1.8 tutorial
[Share] Solve the problem of failed installation of Vitis 2019.2 on Ubuntu 16.04
How to set or modify the time zone on Ubuntu 20.04