Selected topic
Disk Management
Prefer practical output? Use related tools below while reading.
lsblk is a command-line utility in Linux that provides detailed information about disk devices, including partitions and file systems. It's an essential tool for system administrators, developers, and power users who need to manage disks, partitions, and file systems.
lsblk displays the list of block devices (disks) attached to the system./dev/sda with three partitions (sda1, sda2, and sda3)/dev/sdb with one partition (sdb1)bash
lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,RO
This will output:
NAME FSTYPE LABEL MOUNTPOINT SIZE RO
sda vfat boot /boot 256M
├─sda1 vfat boot /boot 255M
└─sda2 ext4 / 32G
sda3 swap [SWAP] 512M ro
sdb ntfs - 1000G
└─sdb1 ntfs C: 999G
In this example, we can see:NAME: The disk device name.FSTYPE: The file system type (e.g., vfat for /dev/sda).LABEL: A label assigned to the partition (not always present).MOUNTPOINT: The mount point of the partition (if it's mounted).SIZE: The size of the disk or partition.RO: Whether the file system is read-only.-o option, as shown above.