How to interpret lsblk output?

0315

Interpreting the output of the lsblk command involves understanding the various columns and the hierarchical structure it presents. Here’s a breakdown of how to read the output effectively:

Example Output:

NAME   SIZE TYPE MOUNTPOINT
sda    100G disk 
├─sda1  50G part /
└─sda2  50G part /home

Column Breakdown:

  1. NAME:

    • This column shows the names of the devices.
    • sda is the main disk, while sda1 and sda2 are partitions on that disk.
  2. SIZE:

    • Indicates the total size of each device or partition.
    • In this example, sda is 100 GB, and both sda1 and sda2 are 50 GB each.
  3. TYPE:

    • Specifies the type of the device.
    • disk indicates a physical disk, while part indicates a partition on that disk.
  4. MOUNTPOINT:

    • Shows where the device or partition is mounted in the filesystem.
    • sda1 is mounted at /, which is the root directory, and sda2 is mounted at /home, where user directories are stored.

Hierarchical Structure:

  • The tree-like format (using ├─ and └─) visually represents the relationship between the disk and its partitions.
  • The indentation indicates that sda1 and sda2 are both partitions of the sda disk.

Additional Options:

You can enhance the output with options:

  • -f: To show filesystem information (e.g., type, label).
  • -o: To customize the columns displayed (e.g., lsblk -o NAME,SIZE,TYPE,MOUNTPOINT).

Practical Tips:

  • Use lsblk regularly to monitor disk usage and organization.
  • Combine it with other commands like df (disk free) to get a complete picture of disk space usage.

If you have any specific scenarios or further questions about interpreting lsblk, feel free to ask!

0 Comments

no data
Be the first to share your comment!