Linux lsblk

Oct 17, 2026

lsblk is a command in Linux used to list information about block devices (such as hard drives, partitions, and optical drives). It displays device details and their dependencies in a tree structure by default, making it convenient for viewing the system’s storage layout.

Default Output Columns

The default output of lsblk typically includes the following key columns:

  • NAME: Device name (e.g., sda, sda1).
  • MAJ:MIN: Major and minor device numbers.
  • RM: Whether the device is removable (1 for yes, 0 for no).
  • SIZE: Device capacity.
  • RO: Whether the device is read-only (1 for yes, 0 for no).
  • TYPE: Device type (e.g., disk for disk, part for partition).
  • MOUNTPOINT: The mount point of the device.

Common Options

  • -f or --fs: Displays file system information, including file system type, UUID, and mount point.
  • -l or --list: Outputs in list format rather than tree structure, facilitating script processing.
  • -o or --output: Customizes the columns to display, for example lsblk -o NAME,SIZE,UUID.
  • -p or --paths: Displays the complete device path (e.g., /dev/sda).
  • -J or --json: Outputs in JSON format for programmatic parsing.

Important Notes

If you need to parse the output in scripts, it is recommended to explicitly specify the required columns using the -o option, as the default output columns may change across different versions.

Best Sellers HDDs

Leave a Reply

Your email address will not be published. Required fields are marked *