fstab entry will mount with mount -a command but not on boot

If none of the more specific forums is the right place to ask

fstab entry will mount with mount -a command but not on boot

Postby wesleykonrad » 2021-02-18 04:51

So I am trying to setup a NFS export to mount on boot. The volume will mount when I use the mount -a option in the command line but it fails to mount on boot.

I am running it on a new install of Debian 10.8

The line in /etc/fstab is:

[ipv4 address]:/[export] /data nfs rw,relatime,vers=4.2,rsize=262144,wsize=262144,hard,timeo=600,sec=sys,proto=tcp,_netdev 0 2

It seems likely that it is trying to mount the volume before the network is up but I have the _netdev option enabled that should remedy that.

Any suggestions?
wesleykonrad
 
Posts: 3
Joined: 2021-02-18 04:29

Re: fstab entry will mount with mount -a command but not on

Postby reinob » 2021-02-18 08:11

How is the network configured?
reinob
 
Posts: 900
Joined: 2014-06-30 11:42

Re: fstab entry will mount with mount -a command but not on

Postby wesleykonrad » 2021-02-18 13:56

debian is a guest running on a vbox host. There are 2 NICs.
enp0s3 is connected to the lan and network access
enp0s8 is a seperate network that only has a vbox internal network.

my /etc/network/interfaces file contains:

auto lo
iface lo inet loopback

allow-hotplug enp0s3
iface enp0s3 inet dhcp

allow-hotplug enp0s8
iface enp0s8 inet dhcp
wesleykonrad
 
Posts: 3
Joined: 2021-02-18 04:29

Re: fstab entry will mount with mount -a command but not on

Postby reinob » 2021-02-18 20:32

systemd and remote filesystems seems to be (still) a hit-and-miss job, from what I read in this forum..

I can only recommend to check the boot log ("journalctl -b") and see if you can spot the problem. You can also post the log (or a link thereto) here.

Good luck!
reinob
 
Posts: 900
Joined: 2014-06-30 11:42

Re: fstab entry will mount with mount -a command but not on

Postby Bloom » 2021-02-18 22:11

_netdev doesn't work with systemd.
This is an fstab entry I used for nfs which worked flawlessly:
Code: Select all
opslag:/Videos   /mnt/Opslag   nfs4   rw,hard,intr,async,rsize=1048576,wsize=1048576,actimeo=0,timeo=14,nodev,nosuid,noauto,x-systemd.automount,x-systemd.device-timeout=10 0 0

BTW: 'opslag' is Dutch for 'storage'.
User avatar
Bloom
 
Posts: 322
Joined: 2017-11-11 12:23

Re: fstab entry will mount with mount -a command but not on

Postby wesleykonrad » 2021-02-19 01:59

@reinob

Thanks for the info. I may look into it.

@Bloom

I tried your fstab entry and it seems to work. I'll keep an eye on it through several reboots and see what happens.

Thanks everyone
wesleykonrad
 
Posts: 3
Joined: 2021-02-18 04:29

Re: fstab entry will mount with mount -a command but not on

Postby reinob » 2021-02-19 06:59

Bloom wrote:_netdev doesn't work with systemd.


According to man systemd.mount this option is used to force systemd to consider a mount a network mount.

This is an fstab entry I used for nfs which worked flawlessly:
Code: Select all
opslag:/Videos   /mnt/Opslag   nfs4   rw,hard,intr,async,rsize=1048576,wsize=1048576,actimeo=0,timeo=14,nodev,nosuid,noauto,x-systemd.automount,x-systemd.device-timeout=10 0 0

BTW: 'opslag' is Dutch for 'storage'.


But the OP wants to have the mount done at boot, which is not the same as automatically (upon first access).

If on-demand automounting (noauto,x-systemd.automount) is OK, then fine :)
reinob
 
Posts: 900
Joined: 2014-06-30 11:42


Return to General Questions

Who is online

Users browsing this forum: Jimmyfd and 9 guests

fashionable