Skip to content

"Mounted at: " Only shows one of the mount points if there are multiple

This issue is most common with btrfs filesystems because it supports subvolumes.

Example:

├─ /dev/sdc2 482.8 GB (482822062080 Bytes) (exactly 943011840 sectors)
│    btrfs "Manjaro" UUID=07c86a92-206e-46a2-9d64-78d9e5cdae91
│    Mounted at : /var/log
│    Total Space: 482.8 GB (482822062080 Bytes) (exactly 943011840 sectors)
│    Used    36%: 171.5 GB (171549511680 Bytes) (exactly 335057640 sectors)
│    Available  : 311.2 GB (311242272768 Bytes) (exactly 607895064 sectors)

(/dev/sdc2 is also my / mount)

Fixing this is easier than I thought, instead of lsblk --output=mountpoint ..., I can do lsblk --output=mountpoints .... This would be applied to https://gitlab.com/coldwater-systems/aspen/aspen-diskinfo/-/blob/main/lib/aspen/diskinfo/partition.rb#L19. Then its just a matter of making the output look nice.

Since this affects subvolumes, it would also be useful to output which subvolume is mounted.