some mount options are not applied during boot
Hi,
I have Alpine 3.15 installed on a Btrfs RAID-1 filesystem. The issue I am having is that some mount options are not applied by localmount.
/etc/fstab:
# Swap
UUID=c3f049fd-64e6-48bd-b3c1-b9f2ab7071ad none swap sw 0 0
UUID=4fcdf68f-1f1a-48b7-abf3-ba68a2dcdbfd none swap sw 0 0
# Main root filesystem
UUID=558ec0b4-869e-4f8e-a143-258d4d380847 / btrfs noatime,compress=zstd:1,ssd,subvol=/volume/root 0 0
UUID=558ec0b4-869e-4f8e-a143-258d4d380847 /var/log btrfs noatime,compress=zstd:1,ssd,subvol=/volume/log 0 0
UUID=558ec0b4-869e-4f8e-a143-258d4d380847 /var/tmp btrfs noatime,compress=zstd:1,ssd,subvol=/volume/tmp 0 0
UUID=558ec0b4-869e-4f8e-a143-258d4d380847 /mnt/rootvol btrfs noatime,compress=zstd:1,ssd,subvolid=5 0 0
# SSD RAID1
UUID=d34c187e-c57d-44b9-ac08-203bbe00a56a /mnt/nas_ssd btrfs noatime,compress=zstd:1,subvolid=5 0 0
/proc/cmdline:
BOOT_IMAGE=/volume/root/boot/vmlinuz-lts root=UUID=558ec0b4-869e-4f8e-a143-258d4d380847 ro rootflags=subvol=volume/root modules=sd-mod,usb-storage,btrfs quiet rootfstype=btrfs
We can see that the output from mount shows that noatime
is missing from the first root filesystem mountpoint and that compress=zstd:1
is missing from all of the root filesystem mount points, but not from the separate filesystem on /dev/sdg1
# mount
/dev/sdb3 on / type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=256,subvol=/volume/root)
/dev/sdb3 on /var/log type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=257,subvol=/volume/log)
/dev/sdb3 on /var/tmp type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=258,subvol=/volume/tmp)
/dev/sdb3 on /mnt/rootvol type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=5,subvol=/)
/dev/sdg1 on /mnt/nas_ssd type btrfs (rw,noatime,compress=zstd:1,ssd,space_cache=v2,subvolid=5,subvol=/)
The result is the same with busybox mount and with util-linux-misc mount.
One different with util-linux-misc
is that mount -a -o remount
sets correct mount options.
It is possible to amend /etc/grub.d/10_linux
with GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol},noatime,rw,compress=zstd:1 ${GRUB_CMDLINE_LINUX}"
which sets the correct options for all rootfs mount points.