Score:1

fstab and systemd

cn flag

On a fresh installation of Ubuntu 23.04, I have an entry in my /etc/fstab:

yyy.yyy.yyy.yyy:/storage   /storage   nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0

If I want to mount the NFS share, I get a systemd error:

mount /storage/
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

When executing the systemctl command, mountig works without a problem. But now comes the issue: even after rebooting, the NFS share is not mounted and I have to enter "systemctl daemon-reload" again to mount the share manually.

Any hints why systemd even after a reboot does not recognize the fstab?

uz flag
Jos
I suspect `systemd` stores a modification date of the `fstab` and compares that to the actual date; however, a `daemon-reload` fails to update this modification date. Perhaps this works: Actually modify the fstab (say, put a space somewhere), save the file, and do another reload. Possibly the new modification date gets picked up this time.
TomZ avatar
cn flag
Thanks, but this didn't helped. Also, I don't see that there are problems with date/time on the file - I changed it in the morning today: ls -laht fstab -rw-r--r-- 1 root root 232 May 11 11:06 fstab
Terrance avatar
id flag
After you get it mounted manually, what is the output of `grep nfs4 /etc/mtab`? You should see a line that you can actually use and put into your `/etc/fstab` file that can assist in getting it to properly automount.
TomZ avatar
cn flag
Thank you both for your answers, it was Jos who brought me to the solution: the problem is that a Raspberry Pi does not have a clock and all files under /run/systemd/generator had the wrong date and time. I added now a little cron job (@reboot) which waits 5 seconds until the Raspberry has the correct time, then reloads the systemd deamons and then mounts the NFS share. Works fine ;-)
Terrance avatar
id flag
Mentioning the Raspberry Pi in your question would have helped a ton! Glad you found your answer.
TomZ avatar
cn flag
Sorry you are right, I didn't thought into that direction ;-)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.