4

I have recently started using Linux and would love to know how to interpret the output from the lsblk -f command.

More specifically, I would like to know the different partitions and sizes.

  • For instance, I understand that ext4 and xfs are different file systems in unix. But the entire picture has a tree structure. So I was wondering if the total number of partitions is 4, i.e.,sda1, sda2, sda3 and sdb.
  • If so, then what are the sub-partitions (root, swap, home and var)?
  • Also, is lvm2_member a filesystem too?
NAME            FSTYPE      LABEL MOUNTPOINT   SIZE
sda                                            1.1T
├─sda1                                           2M
├─sda2          xfs               /boot          2G
└─sda3          LVM2_member                    1.1T
  ├─centos-root ext4              /            200G
  ├─centos-swap swap              [SWAP]       128G
  ├─centos-var  ext4              /var          10G
  └─centos-home ext4              /home        777G
sdb             ext4        data  /data       81.9T
loop1           squashfs                     487.5M
0

1 Answer 1

4

You have two disks, sda and sdb. Your second disk, sdb doesn't have a partition table and is formatted directly to ext4. Your first disk has 3 partitions, sda1 (from its size, I assume it's a BIOS boot partition), sda2 used for /boot and sda3 which is used as LVM Physical Volume (or LVM2_member as shown by lsblk here).

LVM (Logical Volume Manager) provides another "abstraction" layer for storage -- it allows you to "merge" multiple block devices (partitions or disks) to a Volume Group (or VG, your VG is named centos) and create new block devices, called Logical Volumes (or LVs) inside the VG. You have 4 LVs for your /, /home, /var and swap. You can picture LVs as just another layer of partitions on top of sda3 (it's more complicated than that, but you don't really need to worry about that).

LVM is not really needed or that much helpful with a single disk, but it is the default storage layout in CentOS and it offers a lot of useful features. For example if you add third disk in the future you can add it to your existing centos VG and grow your /home (for example) using space on the second disk, it offers support for creating snapshots, caching, RAID, clustering etc. It's also way easier to resize LVs than partitions (e.g. shrinking /home and using the newly created free space for / would be way harder with partitions). If you are interested in details I recommend Logical Volume Manager Administration guide from Red Hat.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .