Incorrect ZFS file system 'atime' property in zpool
Hello,
Despite having set the atime
property to off
for the root pool, several file systems are mounted with atime=on
from initramfs (container names are redacted):
# zfs get -r atime
NAME PROPERTY VALUE SOURCE
rpool atime off local
rpool/ROOT atime off inherited from rpool
rpool/ROOT/alpine atime on temporary
rpool/home atime on temporary
rpool/lxc atime on temporary
rpool/lxc/<c1> atime off inherited from rpool
rpool/lxc/<c2> atime off inherited from rpool
rpool/srv atime on temporary
rpool/var atime on temporary
#
This is not how ZFS should work, importing the root pool should honour this setting, as it does on Solaris and FreeBSD.
I guess this is not necessarily Alpine related, but a more generic Linux problem because of how Linux boots with initramfs, then does a pivot_root. Though Solaris (and derivatives) works similarly with its boot archive. Issue #8609 (closed) looks related: the resolution there seemed to cause this.
I tried a workaround by adding rootflags=atime=off
to default_kernel_opts
in /etc/update-extlinux.conf
, then ran update-extlinux
and reboot, but it did not help. Maybe I'm missing a point.
Edit, addition on 11.2.2021:
It seems like it affects non-root zpools, too. I've reinstalled the server meanwhile (for other reasons, out of scope) and here's what I can see currently (redact.sh
just replaces the poolname):
zfs list -t all -r | ./redact.sh
NAME USED AVAIL REFER MOUNTPOINT
linux_sda4 4.59M 221G 96K /linux_sda4
linux_sda4/home 124K 221G 124K /home
linux_sda4/srv 96K 221G 96K /srv
linux_sda4/var 2.11M 221G 2.11M /var
# zfs get -r mountpoint,atime,canmount,mounted | ./redact.sh
NAME PROPERTY VALUE SOURCE
linux_sda4 mountpoint /linux_sda4 default
linux_sda4 atime off local
linux_sda4 canmount noauto local
linux_sda4 mounted no -
linux_sda4/home mountpoint /home local
linux_sda4/home atime on temporary
linux_sda4/home canmount on default
linux_sda4/home mounted yes -
linux_sda4/srv mountpoint /srv local
linux_sda4/srv atime on temporary
linux_sda4/srv canmount on default
linux_sda4/srv mounted yes -
linux_sda4/var mountpoint /var local
linux_sda4/var atime on temporary
linux_sda4/var canmount on default
linux_sda4/var mounted yes -
# mount | grep zfs | ./redact.sh
linux_sda4/var on /var type zfs (rw,noatime,xattr,noacl)
linux_sda4/srv on /srv type zfs (rw,noatime,xattr,noacl)
linux_sda4/home on /home type zfs (rw,noatime,xattr,noacl)
#
So:
- no matter if I set
atime=off
for the whole pool, the mountpoints do not inherit this - the output of
zfs get
andmount
are contradicting each other:atime=on
vsnoatime
.