Filesystems from fstab are not mounted automatically on boot

My /home, swap and network filesystems aren’t mounted automatically on boot. Every time I boot, I have to log on as my user and issue sudo mount -a, sudo swapon -a. Then after logging out and in again, everything is okay.

I notice that the link light on my NIC comes on after the login screen is shown, so Fedora is not waiting for the network before showing the gdm screen.

Is there something wrong with the fstab below? Please help. The root filesystem mount is obviously working.

#
# /etc/fstab
# Created by anaconda on Mon Aug 28 18:47:01 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=5122fe7a-d71d-4dfb-ae8c-bffe1ded3809 /                       btrfs   subvol=root,compress=zstd:1,x-systemd.device-timeout=0 0 0
UUID=dc6c2b13-f9b6-44c7-b168-75edc402d267 /boot                   ext4    defaults        1 2
UUID=396F-2DF2          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=5122fe7a-d71d-4dfb-ae8c-bffe1ded3809 /home                   btrfs   subvol=home,compress=zstd:1,x-systemd.device-timeout=0 0 0
#/swap/swapfile	none	swap	defaults 0 0
jonas.lan.fa2k.net:/mnt/wpool/data/nobackup    /data/nobackup  nfs     _netdev,x-systemd.requires=network-online.target
jonas.lan.fa2k.net:/mnt/wpool/data/ephemeral   /data/ephemeral nfs     _netdev,x-systemd.requires=network-online.target
jonas.lan.fa2k.net:/mnt/wpool/data/projects    /data/projects  nfs     _netdev,x-systemd.requires=network-online.target
jonas.lan.fa2k.net:/mnt/wpool/data/home        /data/home      nfs     _netdev,x-systemd.requires=network-online.target
jonas.lan.fa2k.net:/mnt/wpool/data/openhab     /data/openhab   nfs     _netdev,x-systemd.requires=network-online.target
jonas.lan.fa2k.net:/mnt/wpool/data/sw  /data/sw        nfs     _netdev,x-systemd.requires=network-online.target
jonas.lan.fa2k.net:/mnt/wpool/data/intermediate        /data/intermediate      nfs     _netdev,x-systemd.requires=network-online.target

(the swap is commented out for troubleshooting)

I found that it’s not able to mount anything automatically, even if I comment out the NFS mounts. It was actually an SELinux problem, as indicated by this message:

Jan 08 19:24:15 nepe kernel: audit: type=1400 audit(1736360655.149:4): avc:  denied  { read } for  pid=1455 comm="systemd-fstab-g" name="fstab" dev="dm-0" ino=26485206 scontext=system_u:system_r:sy>
Jan 08 19:24:15 nepe systemd-fstab-generator[1455]: Failed to open /etc/fstab: Permission denied

After doing restorecon /etc/fstab, it now works well again. (The solution was to have the patience to read through the full system log)

1 Like