fbpx lsblk on Linux: List Disks and Partitions (Command) | Certificação Linux

lsblk Command: How to List Linux Disks and Partitions

📅 12/06/2021 ⏱ 2 min ✍️ Uira Ribeiro
Linuxcommands
lsblk Command: How to List Linux Disks and Partitions
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

The lsblk command on Linux displays information about all block devices connected to the system. It is useful for viewing all connected disks whether they are mounted or not.

The most common options are:

  • -a, --all       Also shows empty devices;
  • -d, --nodeps    Shows information about the device only, without showing, for example, the partitions;
  • -f, --fs             Shows detailed information about the filesystems;

Example of usage:

$ lsblk NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTsda           8:0    0   64G  0 disk ├─sda1        8:1    0    1G  0 part /mnt└─sda2        8:2    0   63G  0 part   ├─cl-root 253:0    0   41G  0 lvm  /  ├─cl-swap 253:1    0    2G  0 lvm  [SWAP]  └─cl-home 253:2    0   20G  0 lvm  /homesr0          11:0    1 1024M  0 rom  

The -d option displays the information without the partitions:

$ lsblk -dNAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTsda    8:0    0   64G  0 disk sr0   11:0    1 1024M  0 rom  

The -f option can be useful for viewing the UUID of devices:

$ lsblk -fNAME        FSTYPE LABEL UUID            MOUNTPOINTsda                                                                  ├─sda1      xfs          1c3b15b1-cd13(...)   /mnt└─sda2      LVM2_member  GZXwoc-7Ziass(...)  ├─cl-root xfs          602fcf7d-d716(...)   /  ├─cl-swap swap         a873901e-5b33(...)   [SWAP]  └─cl-home xfs          fcbdceb1-9053(...)   /homesr0

Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, simply log in or create your user here.

Did you like it? Share

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp