mount shows incorrect compress option for BTRFS subvolumes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have a number of subvolumes on a single BTRFS partition, the only partition on the disk, but the compression options passed for the subvolumes differ.
The correct compression is used when files are created, so that's all working fine, the only issue is that issuing a `mount` command (with no options) shows the wrong option.
In this particular case it shows that all subvolumes are using compress=zlib:3, when in reality some are using zstd.
My (trimmed) fstab:
UUID=83ed7b7f-
UUID=83ed7b7f-
UUID=36aa8383-
# User stuff
UUID=36aa8383-
UUID=36aa8383-
UUID=36aa8383-
UUID=36aa8383-
What mount shows:
$ mount | fgrep /dev/sd
/dev/sdc on / type btrfs (rw,relatime,
/dev/sdc on /home type btrfs (rw,relatime,
/dev/sdb4 on /boot type ext4 (rw,relatime,
/dev/sda on /home/ken/.cache type btrfs (rw,relatime,
/dev/sda on /home/ken/
/dev/sda on /home/ken/
/dev/sda on /home/ken/Downloads type btrfs (rw,relatime,
/dev/sda on /var/log type btrfs (rw,relatime,
/dev/sda on /home/ken/
/dev/sda on /home/test/
/dev/sda on /home/ken/
/dev/sda on /home/ken/
/dev/sda on /home/test/
And to confirm that the correct compression is being used:
$ sudo compsize /var/log/syslog
Processed 1 file, 30 regular extents (30 refs), 0 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 27% 188K 684K 596K
none 100% 28K 28K 28K
zstd 24% 160K 656K 568K
$ sudo compsize ~/Downloads/test
Processed 1 file, 0 regular extents (0 refs), 1 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 42% 458B 1.0K 1.0K
zlib 42% 458B 1.0K 1.0K
I don't know if mount is to blame here, it could be something lacking in the kernel/BTRFS.
$ uname -a
Linux ken 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: mount 2.37.2-4ubuntu3
ProcVersionSign
Uname: Linux 6.5.0-14-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: MATE
Date: Sun Jan 14 11:16:52 2024
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
mtime.conffile.