Results 1 to 8 of 8

Thread: nfs shares in /etc/fstab not loaded on boot in 18.04

  1. #1
    Join Date
    Nov 2005
    Location
    Rotterdam
    Beans
    24
    Distro
    Ubuntu 11.04 Natty Narwhal

    Question nfs shares in /etc/fstab not loaded on boot in 18.04

    Hi, I have some nfs shares to my synology nas configured in /etc/fstab. After installing ubuntu 18.04 these shares are not loaded on boot but I have to manually mount by entering
    Code:
    sudo mount -a
    for them to be loaded.

    the relevant lines in /etc/fstab are:

    Code:
    192.168.0.20:/volume1/music			/var3/ds415/music			nfs		user,auto 	0	0
    192.168.0.20:/volume1/photo			/var3/ds415/photo			nfs		user,auto	0	0
    192.168.0.20:/volume1/video			/var3/ds415/video			nfs		user,auto	0	0
    192.168.0.20:/volume1/backups		/var3/ds415/ds415_archives	nfs		user,auto	0	0
    The main difference I see towards my previous 16.04.4 installation was that the network manager has changed. It now uses /etc/netplan instead of /etc/network/interfaces Can that have anything to to with it?

  2. #2
    Join Date
    Oct 2012
    Beans
    2

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    Same issue here...
    it appears that for some reason, ubuntu tries to mount the folder before nsf is loaded during boot...no idea how to change this, but a (messy) workaround is to create a bash script (say runfstab.sh) with:
    sleep 30s (or something else)
    mount -a
    and to schedule a cron job at reboot (edit crontab -eu root with : @reboot /pathtofile/runfstab.sh)
    (for some reason the cron job @reboot is also often run before nfs is loaded, hence the sleep 30s, which is probably way too long)

    hope that helps

    Vincent

  3. #3
    Join Date
    Jul 2013
    Beans
    14

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    Try the _netdev option along with user,auto.

  4. #4
    Join Date
    Aug 2018
    Beans
    2

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    Quote Originally Posted by HNmYk3h View Post
    Try the _netdev option along with user,auto.
    Can you give an example... I tried to had the option...but doesn't seem to work.

    Thanks

  5. #5
    Join Date
    Aug 2018
    Beans
    2

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    Quote Originally Posted by RobertLos View Post
    Hi, I have some nfs shares to my synology nas configured in /etc/fstab. After installing ubuntu 18.04 these shares are not loaded on boot but I have to manually mount by entering
    Code:
    sudo mount -a
    for them to be loaded.
    Found a solution?

  6. #6
    Join Date
    Dec 2009
    Beans
    6,302

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    How about this:

    [1] Create a file at: /etc/network/if-up.d/fstab


    [2] Add this to it:
    Code:
    #!/bin/sh
    mount -a
    [3] Make the file executable:
    Code:
    sudo chmod +x /etc/network/if-up.d/fstab
    You are directing the system at boot time to issue a "mount -a" after the network stack is up and operation which if it's like a cifs mount in fstab is the reason your shares are not mounting at boot.

  7. #7
    Join Date
    Jan 2019
    Beans
    1

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    For me the solution was to edit the netplan configuration (/etc/netplan/50-cloud-init.yaml)file and set interface as optional: false

  8. #8
    Join Date
    Jun 2005
    Beans
    4

    Re: nfs shares in /etc/fstab not loaded on boot in 18.04

    Quote Originally Posted by Morbius1 View Post
    How about this:

    [1] Create a file at: /etc/network/if-up.d/fstab


    [2] Add this to it:
    Code:
    #!/bin/sh
    mount -a
    [3] Make the file executable:
    Code:
    sudo chmod +x /etc/network/if-up.d/fstab
    You are directing the system at boot time to issue a "mount -a" after the network stack is up and operation which if it's like a cifs mount in fstab is the reason your shares are not mounting at boot.
    Brilliant! thanks.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •