Hello, for some time now I noticed that some very important btrfs subvolumes (like /root and /opt) are not mounted when I am logged in, but get mounted without problems if I run mount -a
.
Checking the journal from boot time, it seems they get mounted in the beginning, get unmounted soon afterwards, and finally only few of them get remounted. In detail, I see the following messages after boot:
Nov 25 11:59:16 systemd[1]: Condition check resulted in dracut pre-mount hook being skipped.
Nov 25 11:59:16 systemd[1]: Mounting /sysroot...
Nov 25 11:59:16 systemd[1]: Mounted /sysroot.
Nov 25 11:59:16 systemd[1]: Condition check resulted in dracut mount hook being skipped.
Nov 25 11:59:17 systemd[1]: Mounting /.snapshots...
Nov 25 11:59:17 systemd[1]: Mounting /boot/efi...
Nov 25 11:59:17 systemd[1]: Mounting /boot/grub2/i386-pc...
Nov 25 11:59:17 systemd[1]: Mounting /boot/grub2/x86_64-efi...
Nov 25 11:59:17 systemd[1]: Mounting /home...
Nov 25 11:59:17 systemd[1]: opt.mount: Directory /opt to mount over is not empty, mounting anyway.
Nov 25 11:59:17 systemd[1]: Mounting /opt...
Nov 25 11:59:17 systemd[1]: Mounting /root...
Nov 25 11:59:17 systemd[1]: Mounting /srv...
Nov 25 11:59:17 systemd[1]: Mounting /tmp...
Nov 25 11:59:17 systemd[1]: Mounting /usr/local...
Nov 25 11:59:17 systemd[1]: Mounting /var...
Nov 25 11:59:17 systemd[1]: Mounted /.snapshots.
Nov 25 11:59:17 systemd[1]: Mounted /boot/grub2/i386-pc.
Nov 25 11:59:17 systemd[1]: Mounted /boot/grub2/x86_64-efi.
Nov 25 11:59:17 systemd[1]: Mounted /home.
Nov 25 11:59:17 systemd[1]: Mounted /opt.
Nov 25 11:59:17 systemd[1]: Mounted /root.
Nov 25 11:59:17 systemd[1]: Mounted /srv.
Nov 25 11:59:17 systemd[1]: Mounted /tmp.
Nov 25 11:59:17 systemd[1]: Mounted /usr/local.
Nov 25 11:59:17 systemd[1]: Mounted /var.
Nov 25 11:59:17 kernel: FAT-fs (nvme0n1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Nov 25 11:59:17 systemd[1]: Mounted /boot/efi.
But a few seconds all the partitions get unmounted:
Nov 25 11:59:19 systemd[1]: Unmounting /.snapshots...
Nov 25 11:59:19 systemd[1]: Unmounting /boot/grub2/i386-pc...
Nov 25 11:59:19 systemd[1]: Unmounting /boot/grub2/x86_64-efi...
Nov 25 11:59:19 systemd[1]: Unmounting /home...
Nov 25 11:59:19 systemd[1]: Unmounting /opt...
Nov 25 11:59:19 systemd[1]: Unmounting /root...
Nov 25 11:59:19 systemd[1]: Unmounting /srv...
Nov 25 11:59:19 systemd[1]: Unmounting /usr/local...
... ]
Nov 25 11:59:19 systemd[1]: \x2esnapshots.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /.snapshots.
Nov 25 11:59:19 systemd[1]: boot-grub2-i386\x2dpc.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /boot/grub2/i386-pc.
Nov 25 11:59:19 systemd[1]: boot-grub2-x86_64\x2defi.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /boot/grub2/x86_64-efi.
Nov 25 11:59:19 systemd[1]: home.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /home.
Nov 25 11:59:19 systemd[1]: opt.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /opt.
Nov 25 11:59:19 systemd[1]: root.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /root.
Nov 25 11:59:19 systemd[1]: srv.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /srv.
Nov 25 11:59:19 systemd[1]: usr-local.mount: Succeeded.
Nov 25 11:59:19 systemd[1]: Unmounted /usr/local.
Nov 25 11:59:19 systemd[1]: Condition check resulted in /dev/system/root being skipped.
Nov 25 11:59:19 systemd[1]: Found device /dev/mapper/system-root.
Nov 25 11:59:19 systemd[1]: Found device /dev/system/swap.
Nov 25 11:59:19 systemd[1]: systemd-update-utmp.service: Succeeded.
Nov 25 11:59:19 systemd[1]: Stopped Update UTMP about System Boot/Shutdown.
Nov 25 11:59:19 systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
Nov 25 11:59:19 systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
Nov 25 11:59:43 systemd[1]: Unmounting /tmp...
Nov 25 11:59:43 systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
Nov 25 11:59:43 systemd[1]: tmp.mount: Succeeded.
Nov 25 11:59:43 systemd[1]: Unmounted /tmp.
Even though /home was unmounted, it gets remounted later when I login as user:
Nov 25 12:00:02 sddm[2445]: Authenticated successfully
Nov 25 12:00:02 sddm-greeter[2497]: Message received from daemon: LoginSucceeded
Nov 25 12:00:02 systemd[1]: Created slice User Slice of UID 1000.
Nov 25 12:00:02 systemd[1]: Starting User Runtime Directory /run/user/1000...
Nov 25 12:00:02 systemd-logind[2486]: New session 2 of user jimis.
Nov 25 12:00:02 systemd[1]: Mounting /home...
Nov 25 12:00:02 systemd[1]: Mounted /home.
Nov 25 12:00:02 systemd[1]: Started User Runtime Directory /run/user/1000.
Nov 25 12:00:02 systemd[1]: Starting User Manager for UID 1000...
But the rest of the important partitions remain unmounted until I run mount -a
.
Any idea what’s going on? How can I trace systemd dependencies and figure out
what is causing the unmounting of the subvolumes?
Thank you in advance.
P.S. here is my /etc/fstab:
/dev/system/root / btrfs defaults 0 0
/dev/system/root /var btrfs subvol=/@/var 0 0
/dev/system/root /usr/local btrfs subvol=/@/usr/local 0 0
/dev/system/root /tmp btrfs subvol=/@/tmp 0 0
/dev/system/root /srv btrfs subvol=/@/srv 0 0
/dev/system/root /root btrfs subvol=/@/root 0 0
/dev/system/root /opt btrfs subvol=/@/opt 0 0
/dev/system/root /home btrfs subvol=/@/home 0 0
/dev/system/root /boot/grub2/x86_64-efi btrfs subvol=/@/boot/grub2/x86_64-efi 0 0
/dev/system/root /boot/grub2/i386-pc btrfs subvol=/@/boot/grub2/i386-pc 0 0
UUID=123A-567B /boot/efi vfat defaults 0 0
/dev/system/swap swap swap defaults 0 0
/dev/system/root /.snapshots btrfs subvol=/@/.snapshots 0 0