Skip to content

Lsblk command

-o option : add extra column output

basic

lsblk -o +FSTYPE,LABEL

show if HD or SDD

lsblk -o +ROTA,DISC-GRANl
ROTA tells you if a block device belongs to a rotational storage device.
- Hard disks are rotational, so the column outputs “1” besides them (logical value “true”)
- SDD , loop devices and other will have zero
DISC-GRAN shows you the discard granularity. SSDs support discard to free up unused data blocks. Hard disks do not support this feature, since they don’t need it, so this column will display a zero value for them (“0B,” meaning discard granularity of zero bytes).

show removable devices/USB memory sticks

lsblk -o +RM
will display an extra column that tells you if the device is removable. A “1” value means “true,” which indicates a USB stick or other types of removable media.

show HDD/SSD Model

useful when you want to look up the exact code of your storage device model to upgrade your firmware or download drivers.
lsblk -d -o +MODEL

show filesystem UUID

UUID (Universally Unique Identifier)
Older Linux distributions mounted filesystems by their device names in “/etc/fstab.”
Is unreliable since “/dev/sda2” might become “/dev/sdb2” when you add another storage device to the system.
Nowadays UUIDs are used , which remain constant no matter what you add/remove to/from your computer.
lsblk -o +UUID

a good disk overview

clear && lsblk -o +FSTYPE,LABEL,UUID,ROTA,RM,MODEL | grep -v 'loop'