muesli / duf

Disk Usage/Free Utility - a better 'df' alternative
Other
12.94k stars 402 forks source link

Group btrfs subvolume mounts #98

Open julian-klode opened 3 years ago

julian-klode commented 3 years ago

So I have multiple subvolumes mounted of my BTRFS /, to exclude them from snapshots, as you can see below. I think it would be nice to somehow group them together a bit and not print duplicated information, but like just "..." or so, to improve readability. OTOH, I'm not sure, as the list of mount point seems ordered. But maybe it makes sense to group anyway - the /var and /srv mounts below would then be slightly indented below / for example.

$ duf -hide-fs squashfs
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 9 local devices                                                                                                      │
├────────────────────────────┬────────┬────────┬────────┬───────────────────────────────┬───────┬──────────────────────┤
│ MOUNTED ON                 │   SIZE │   USED │  AVAIL │              USE%             │ TYPE  │ FILESYSTEM           │
├────────────────────────────┼────────┼────────┼────────┼───────────────────────────────┼───────┼──────────────────────┤
│ /                          │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │
│ /boot                      │ 704.5M │ 229.2M │ 424.0M │ [######..............]  32.5% │ ext4  │ /dev/nvme0n1p2       │
│ /boot/efi                  │ 511.0M │  21.1M │ 489.9M │ [....................]   4.1% │ vfat  │ /dev/nvme0n1p1       │
│ /home                      │ 170.0G │ 159.3G │  10.7G │ [##################..]  93.7% │ xfs   │ /dev/ubuntu--vg/home │
│ /mnt                       │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │
│ /srv/lxd                   │  30.0G │  15.7G │  13.5G │ [##########..........]  52.3% │ btrfs │ /dev/ubuntu--vg/lxd  │
│ /var/cache/apt/archives    │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │
│ /var/cache/squid-deb-proxy │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │
│ /var/log                   │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │

maybe like this, but with nicer arrow.

$ duf -hide-fs squashfs
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 9 local devices                                                                                                      │
├────────────────────────────┬────────┬────────┬────────┬───────────────────────────────┬───────┬──────────────────────┤
│ MOUNTED ON                 │   SIZE │   USED │  AVAIL │              USE%             │ TYPE  │ FILESYSTEM           │
├────────────────────────────┼────────┼────────┼────────┼───────────────────────────────┼───────┼──────────────────────┤
│ /                          │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │
[...]
│ ->  /var/cache/apt/archives │  ... │  ... │  ...    │  ...                                          │ ....    │ ...                             │
[...]
│ /boot                      │ 704.5M │ 229.2M │ 424.0M │ [######..............]  32.5% │ ext4  │ /dev/nvme0n1p2       │
│ /boot/efi                  │ 511.0M │  21.1M │ 489.9M │ [....................]   4.1% │ vfat  │ /dev/nvme0n1p1       │
│ /home                      │ 170.0G │ 159.3G │  10.7G │ [##################..]  93.7% │ xfs   │ /dev/ubuntu--vg/home │
│ /mnt                       │  31.0G │  28.3G │   2.2G │ [##################..]  91.3% │ btrfs │ /dev/ubuntu--vg/root │
petaramesh commented 1 year ago

I agree on the point that each filesystem should only be output once, even if it is mounted several times at several places, which is extremely common with BTRFS (as different subvolumes pertaining to the same filesystem, thus the same usage figures, are almost always mounted at different places).

petaramesh commented 1 year ago

See how redundant this can quickly become... Screenshot_20230104_090940

arran4 commented 5 months ago

Would be nice, also if it would group them on one line for really short mount paths when there are much longer open, ie

image

Could be /content, /home rather than just using a 'ditto mark'