How do I configure NFS server to start after the required filesystem mounts are ready?

Using x-systemd.before=local-fs.target as an additional mount option worked perfectly. I also note this from the systemd.mount man page:

x-systemd.before=, x-systemd.after=

In the created mount unit, configures a Before= or After= dependency on another systemd unit, such as a mount unit. The argument should be a unit name or an absolute path to a mount point. This option may be specified more than once. This option is particularly useful for mount point declarations with nofail option that are mounted asynchronously but need to be mounted before or after some unit start, for example, before local-fs.target unit. See Before= and After= in systemd.unit(5) for details.

1 Like