LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lsblk

List information about block devices

TLDR

Show the block devices as a tree
$ lsblk
copy
Show filesystem type, label, UUID and mountpoint
$ lsblk --fs
copy
Print full device paths as a flat list
$ lsblk --paths --list
copy
Choose exactly the columns you want
$ lsblk --output NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
copy
Add columns to the default set
$ lsblk --output +SERIAL,MODEL
copy
Show every available column
$ lsblk --output-all
copy
Emit JSON
$ lsblk --json
copy
Emit key=value pairs that a shell can read
$ lsblk --pairs --output NAME,FSTYPE,UUID
copy
Print sizes in exact bytes
$ lsblk --bytes
copy
Show one device without its partitions
$ lsblk --nodeps /dev/sda
copy
Hide the loop devices that snap packages create
$ lsblk --exclude 7
copy
Show owner, group and mode of each device node
$ lsblk --perms
copy
Show queue topology, including sector sizes
$ lsblk --topology
copy
Show which devices support discard (TRIM)
$ lsblk --discard
copy
Show a partition's parents instead of its children
$ lsblk --inverse /dev/sda1
copy

SYNOPSIS

lsblk [-a] [-b] [-f] [-t] [-o columns] [device...]

DESCRIPTION

lsblk lists information about all available or specified block devices. It reads the sysfs filesystem and udev database to gather information and displays it in a tree-like format showing the relationship between devices and partitions.

PARAMETERS

-a, --all

Also list empty devices
-b, --bytes
Print SIZE column in bytes
-f, --fs
Output info about filesystems (FSTYPE, LABEL, UUID, MOUNTPOINT)
-t, --topology
Output block device topology information
-i, --ascii
Use ASCII characters for tree formatting
-l, --list
Produce output in list format
-o, --output columns
Specify which columns to output
-e, --exclude list
Exclude devices by major device numbers
-n, --noheadings
Don't print column headings
-p, --paths
Print full device paths
-d, --nodeps
Don't print holder devices or slaves (show only top-level devices)
-J, --json
Output in JSON format
-S, --scsi
Output SCSI device information
-r, --raw
Use raw output format

AVAILABLE COLUMNS

NAME, KNAME, MAJ:MIN, FSTYPE, MOUNTPOINT, LABEL, UUID, SIZE, MODEL, SERIAL, TYPE, TRAN, RO, RM, HOTPLUG, ROTA

INSTALL

sudo apt install util-linux
copy
sudo dnf install util-linux
copy
sudo pacman -S util-linux
copy
sudo apk add lsblk
copy
sudo zypper install util-linux
copy
brew install util-linux
copy
nix profile install nixpkgs#util-linux
copy

CAVEATS

Some information may require root privileges. Mounted filesystems show mount points; unmounted show blank.

HISTORY

Part of util-linux package. Provides a more readable alternative to /proc/partitions and fdisk -l.

SEE ALSO

blkid(8), fdisk(8), findmnt(8), df(1), mount(8), parted(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid