GARY IS COMING FOR YOU

You shouldn't have done that.

⚙ MALEVELON CREEK
CLICK TO SCAN
SPACE-BAR SERVICE DESK

Bartender

Here to help you explore

Questions and relevant page context are sent to TypeSafe. Questions Bartender cannot answer are saved to improve the site, without your account or IP. Other conversation stays in this tab.

lsblk Tool Reference


lsblk (list block devices) displays information about block devices in a tree format. Shows disks, partitions, and their mount points in an easy-to-read hierarchy.


Basic Usage

  • lsblk - List all block devices
  • lsblk -a - Show all devices
  • lsblk -f - Show filesystem information
  • lsblk -m - Show mount points
  • lsblk -o column1,column2 - Custom output

Options

  • -a - Show all devices
  • -f - Show filesystem information
  • -m - Show mount points
  • -l - Use list format instead of tree
  • -n - No headings
  • -o columns - Specify output columns
  • -b - Print sizes in bytes
  • -d - Don't print holder devices
  • -e list - Exclude devices by major number
  • -i - ASCII characters only
  • -p - Print full device paths
  • -r - Raw output
  • -s - Inverse dependencies
  • -S - Sort by size
  • -t - Show topology information
  • -x column - Sort by column

Output Columns

  • NAME - Device name
  • KNAME - Kernel device name
  • MAJ:MIN - Major and minor numbers
  • FSTYPE - Filesystem type
  • MOUNTPOINT - Mount point
  • LABEL - Filesystem label
  • UUID - Filesystem UUID
  • PARTUUID - Partition UUID
  • PARTLABEL - Partition label
  • SIZE - Size
  • TYPE - Device type
  • RO - Read-only flag
  • RM - Removable device flag
  • MODEL - Device model
  • SERIAL - Serial number
  • STATE - State
  • OWNER - Device owner
  • GROUP - Device group
  • MODE - Device node permissions
  • ALIGNMENT - Alignment offset
  • MIN-IO - Minimum I/O size
  • OPT-IO - Optimal I/O size
  • PHY-SEC - Physical sector size
  • LOG-SEC - Logical sector size
  • ROTA - Rotational device flag
  • SCHED - I/O scheduler
  • RQ-SIZE - Request queue size
  • DISC-ALN - Discard alignment offset
  • DISC-GRAN - Discard granularity
  • DISC-MAX - Discard max bytes
  • DISC-ZERO - Discard zeroes data

Common Examples

Basic List

lsblk

Show all block devices in tree format.

With Filesystems

lsblk -f

Include filesystem information.

With Mount Points

lsblk -m

Show mount points.

List Format

lsblk -l

Use list instead of tree.

Custom Columns

lsblk -o NAME,SIZE,TYPE,MOUNTPOINT

Show specific columns.

Full Paths

lsblk -p

Show full device paths.

Sort by Size

lsblk -S

Sort devices by size.

All Information

lsblk -f -m -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT

Comprehensive view.


Tips

  • Use -f to see filesystem types
  • Use -m to see mount points
  • Use -o to customize output
  • Use -l for script-friendly output
  • Use -p for full device paths
  • Tree format shows hierarchy clearly
  • Essential for disk management
  • Great for understanding partition layout