Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: NFS not mounted at boot

  1. #1
    Join Date
    Feb 2007
    Beans
    12
    Distro
    Xubuntu 20.04 Focal Fossa

    NFS not mounted at boot

    Hi,

    I have a file server on Raspberry Pi (Raspberry OS + OpenMediaVault)
    My Xubuntu 20.10 laptop cannot connect automatically to RPi's NFS share at boot (entry in fstab). The laptop uses wifi, no LAN port if that makes a difference.

    I can mount it manually using a command:
    Code:
    sudo mount -t nfs 192.168.1.140:/export/shared/ /mnt/shared/
    My fstab entry looks like that:
    Code:
    192.168.1.140:/export/shared/   /mnt/shared/    nfs     auto,defaults,nofail,noatime,nolock,tcp,rsize=8192,wsize=8192,actimeo=1800,timeo=14 0 0
    I tried with or without various options in the line above: auto, defaults, _netdev, nfsvers=3 and retry=1 (so after 1 minute).
    No luck.

    Removed tailing slashes from paths in fstab (so ...:/export/shared /mnt/shared etc...) - also no luck.

    Searching for NFS in dmesg givs the result below:
    Code:
    [    1.839073] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    2.656154] FS-Cache: Netfs 'nfs' registered for caching
    [    2.775216] NFS: Registering the id_resolver key type
    [    2.801509] NFS4: Couldn't follow remote path
    [  440.374225] NFS4: Couldn't follow remote path
    The last line at 440 comes up at the time of manual mounting using the command from the top of this post.

    showmount -e 192.168.1.140 give a result:
    Code:
    Export list for 192.168.1.140:
    /export        192.168.1.0/24
    /export/shared 192.168.1.0/24
    Tried autofs which was doing the job on mounting at boot, but unmounting at shutting down or restart took a few minutes, so uninstalled it.

    My 2nd Raspberry Pi (Raspberry OS + moode) can connect to NFS at boot with no problem out of the box.

    Any idea how to fix it?

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: NFS not mounted at boot

    Try:
    Code:
    sudo mkdir /mnt/shared
    fstab:
    Code:
    192.168.1.140:/export/shared   /mnt/shared    nfs     proto=tcp,async  0 0
    Bogus options cause lines to be ignored. Only use valid options, please. NFS servers have negotiated the correct rsize and wsize parameters for years. Wifi that is a poor connection will always have issues. Avoid wifi on any NFS server and as much as possible on clients unless you 100% KNOW the client wifi connection is better than good.

    I only use aufofs for NFS and USB devices. That's because they may not always be available. autofs should automatically remove any unused mount within about 5 minutes. The only reason it would delay a shutdown would be if there are files still open on the NFS share from the client. I.e. the NFS file system is busy still. Besides that, autofs performance is just like any fstab or manual mount.

  3. #3
    Join Date
    Feb 2007
    Beans
    12
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: NFS not mounted at boot

    /mnt/shared already exists. forgot to mention that in the original post.

    Your fstab line also doesn't work.

    In meantime I've noticed that /mnt/share ownership was nouser:nogroup. Changed it to root:root (same as /mnt/win10 where I mount win10 partition).
    It didn't change anything unfortunately.

    RPi server is connected to router via 1Gbps LAN. A laptop is via wifi.

    No files were opened when I used autofs. Everything was closed. Just bare system.


    Any ideas?
    Last edited by kjur; February 23rd, 2021 at 11:43 PM.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: NFS not mounted at boot

    What do you mean "my fstab line also doesn't work?" Be explicitly clear, please.

    Start by showing the /etc/exports, exactly.
    Then the /etc/fstab, exactly.
    Finally, which file system is on the server-side shared directories?
    Then the commands you run when you modify each - on each system. Please be clear. Just changing the file is NOT sufficient.

    Having nested NFS shares is a bad idea. When you do that, I think the fsid= option is needed to keep the share from becoming confused.

  5. #5
    Join Date
    Feb 2007
    Beans
    12
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: NFS not mounted at boot

    Hi again.

    By saying 'your fstab line also doesn't work' I meant that changing fstab line to the one from your post didn;t help. Still no automount.

    /etc/exports doesn't exist on a client side.
    /etc/exports from a server (Raspberry Pi OS based on Debian Buster + OpenMediaVault NAS software):
    Code:
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.
    
    # /etc/exports: the access control list for filesystems which may be exported
    #               to NFS clients.  See exports(5).
    /export/shared 192.168.1.0/24(fsid=1,rw,subtree_check,insecure)
    
    # NFSv4 - pseudo filesystem root
    /export 192.168.1.0/24(ro,fsid=0,root_squash,no_subtree_check,hide)
    /etc/fstab from a client (Xubuntu 20.10):
    Code:
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # / was on /dev/nvme0n1p7 during installation
    UUID=a1616d5e-3728-4549-940b-f072a4272256 /               ext4    errors=remount-ro 0       1
    # /boot/efi was on /dev/nvme0n1p1 during installation
    UUID=94B7-D6DE  /boot/efi       vfat    umask=0077      0       1
    # /home was on /dev/nvme0n1p8 during installation
    UUID=5d8be7b1-8a59-453e-8c9e-8fb0ed344593 /home           ext4    defaults        0       2
    /swapfile                                 none            swap    sw              0       0
    /dev/disk/by-uuid/A62493FD2493CEA5 /mnt/win10 auto nosuid,nodev,nofail 0 0
    
    # rpi4 nfs shared
    192.168.1.140:/export/shared    /mnt/shared     nfs     proto=tcp,async    0 0
    The server is RPi4 + Raspberry Pi OS (previously called Raspbian) based on Debian Buster + OpenMediaVault NAS software. All up-to-date.

    Not sure what you mean about the command when I modify something.
    I don't modify anything on the server side.
    I previously tried different options in the fstab line for NFS entry, but now I have your line. Also tried to add _netdev, but didn't help so it is now as above.

    I don't know what you mean 'nested NFS shares'. I don't thing it's nested. It is on a USB3 external drive connected to Raspberry Pi server. Other RPi's can connect to it on boot with no problem. I also can manually mount it on Xubuntu. Just mount on boot from fstab doesn't work.

    I hope that's clear now.

    Thanks for your help.
    Greg

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: NFS not mounted at boot

    192.168.1.140:/export
    and
    192.168.1.140:/export/shared
    is nested. One is above the other. Nested. Disable one for now. Might change the order too in the exports file. It shouldn't matter, but who knows?
    I assume the IP address for the NFS server never changes?

    After you modify the fstab, did you run sudo mount -a? What are the errors, if any? Look in the system logs and dmesg. There isn't any need to reboot for this stuff until everything is working. The reboot would be the final test.

    BTW, "automount" is a very specific term that has NOTHING to do with the fstab. I'd assumed you were using amd - the automount daemon tool when you said that. You want it to mount at boot automatically, but aren't using amd.

    On the server, please should the mounted storage for:
    Code:
    /export/shared 
    /export
    I'd use df -Th and remove all the junk except those areas and the header. Thanks.

  7. #7
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,578
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: NFS not mounted at boot

    Quote Originally Posted by kjur View Post
    My fstab entry looks like that:
    Code:
    192.168.1.140:/export/shared/   /mnt/shared/    nfs     auto,defaults,nofail,noatime,nolock,tcp,rsize=8192,wsize=8192,actimeo=1800,timeo=14 0 0
    I'd get rid of the rsize and wsize parameters, or increase them considerably to something like 65536. The value of 8192 was established back when most networks ran 10MBit Ethernet.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  8. #8
    Join Date
    Feb 2007
    Beans
    12
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: NFS not mounted at boot

    Quote Originally Posted by TheFu View Post
    is nested. One is above the other. Nested. Disable one for now. Might change the order too in the exports file. It shouldn't matter, but who knows?
    I assume the IP address for the NFS server never changes?

    After you modify the fstab, did you run sudo mount -a? What are the errors, if any? Look in the system logs and dmesg. There isn't any need to reboot for this stuff until everything is working. The reboot would be the final test.

    BTW, "automount" is a very specific term that has NOTHING to do with the fstab. I'd assumed you were using amd - the automount daemon tool when you said that. You want it to mount at boot automatically, but aren't using amd.

    On the server, please should the mounted storage for:
    Code:
    /export/shared 
    /export
    Sorry, been busy with other things.
    I understand now what nested means in that case. I guess the extra /export/ part in the NFS path is added by default in NFS v3. Removed in v4 if I'm correct.

    A server IP never changes and it's always on (definitely it is on when booting a laptop to automount the share.

    I was actually rebooting the laptop completely. Didn't use sudo mount -a.

    I didn't hear about the amd. I thought happens automatically if there is an entry in /etc/fstab. I'll look into it.
    I used autofs before, but as mentioned unmounting was taking ages.

    Will modify export entries as you suggested and let you know.


    @SeijiSensei - rsize and wsize are removed now as per instructions of TheFu in other posts. Still no luck

    Funny enough another RPi with Raspberry Pi OS (based on Debian Buster) mounts the share straight away with an entry:

    Code:
    192.168.1.140:/export/shared/mp3   /mnt/mp3    nfs     auto,_netdev    0    0

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: NFS not mounted at boot

    Did you change the exports file?

    Perhaps I'm too close now. Some fresh eyes needed.

  10. #10
    Join Date
    Feb 2007
    Beans
    12
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: NFS not mounted at boot

    Hi, sorry, not yet. Not access to this computer at the moment.
    However look at my export file one of the posts above. /export/shared is listed first, then /export. So what to change? fsid=1 and fsid=0?

Page 1 of 2 12 LastLast

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
  •