How can I mount an NFS drive via fstab

15,704

with the help of @arjarj 's comment, I checked the difference between my fstab entry and the mtab entry after a cli-mount.

The clearest was, I thought, the missing nfsvers=4, and without that option it works perfectly. Strange as the mount.nfs4 bin is there, but maybe the other side does not support it.

Final entry in fstab looks like:

192.168.178.4:/mountdir /mnt/mountdir  nfs auto,_netdev,noatime,nolock,bg,intr,tcp,actimeo=1800 0 0
Share:
15,704

Related videos on Youtube

Nanne
Author by

Nanne

Updated on September 18, 2022

Comments

  • Nanne
    Nanne over 1 year

    I am trying to auto-mount my NFS drives, but it doesn't work too well sadly.

    What does work is mounting from CLI:

    me@client:/$ sudo mount 192.168.178.4:/mountdir /mnt/mountdir
    me@client:/$ mount -t nfs
    192.168.178.4:/mountdir on /mnt/mountdir type nfs (rw,addr=192.168.178.4)
    

    when I try to add mountdir in the fstab, I cannot mount it due to "protocol not supported" (which seems strange as I can mount it)

    $ sudo mount films_d3
    mount.nfs: Protocol not supported
    

    So there might be something wrong with my fstab entry. This is my current entry:

    192.168.178.4:/mountdir /mnt/mountdir  nfs auto,_netdev,noatime,nolock,bg,nfsvers=4,intr,tcp,actimeo=1800 0 0
    

    During startup I also get this error twice: I was trying to fix the mount-from-fstab first, then worry about that, but nevertheless this might be a different problem:

    init: idmapd-mounting (/mnt/kazemat/films_d3) main process (445) killed by TERM signal
    

    This seems to be before the eth0 is initialised, while I thought the "_netdev" option would make the entry wait for the network to be up?

    can anywone see the mistake in my fstab entry?

    • Nanne
      Nanne over 9 years
      hmm, could it be that the cli uses a different version? In the fstab it says version 4. Does cli mount do some sort of fallback? Weird error in that case though.
    • arjarj
      arjarj over 9 years
      Any hints in /etc/mtab or /proc/mounts?
    • Nanne
      Nanne over 9 years
      @arjarj as you can see by my answer below: yes.yes there were :) .. thanks!