Skip to content

lsblk command on Linux (list block devices)

The lsblk command on Linux shows information from all connected block devices in the system. It is useful to view all connected disks whether they are mounted or not.

The most common options are:

  • -a, —all Show empty devices included;
  • -d, —nodeps Shows information from just the device, without showing, for example, the partitions; - -f, —fs Shows detailed information about file systems;

Example of use:

$ lsblk <br></br>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT <br></br>Sda 8:0 0 64G <br></br>0 disk ? ?sda1 8:1 0 1G 0 part <br></br>/mnt sda2 8:2 0 63G 0 part 496 <br></br>- cl-root 253:0 0 41 G <br></br>0 lvm/<br></br>#cl-swap 253:1 0 2G 0 lvm [SWAP] Home

sr0 11:0 1 1024M 0 rom The -d option shows the information, without the partitions:

$ lsblk -d NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT da 8:0 0 64G 0 disk sr0 11:0 1 1024M 0 rom

The -f option may be useful to view the UUID of the devices:

$ lsblk -f <br></br>NAME FSTYPE LABEL UUID MOUNTPOINT <br></br>da <br></br>? ?sda1 xfs 1c3b15b1-cd13 (...) /mnt <br></br>??sda2 LVM2_member gzxwoc-7ziass (...) <br></br>? ?cl-root xfs 602fcf7d-d716 (...) /<br></br>496 - cl-swap swap a873901e-5b33 (...) [<br></br>SWAP] ??cl-home xfs fcbdceb1-9053 (...) /home

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

Did you like it?

Share