Comment 3 for bug 1827286

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I followed the first hits that I have found [1][2] to set up a similar situation.

After mounting NFS the first time I moved all in my ~ to /vol/home

mount:
192.168.122.247:/mnt/sharedfolder on /vol/home type nfs4 (rw,relatime,vers=4.2,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.118,local_lock=none,addr=192.168.122.247)

autofs.master:
/vol /etc/auto.nfs
/etc/auto.nfs:
home -fstype=nfs,rw,retry=0 192.168.122.247:/mnt/sharedfolder

# detach target
$ sudo umount /vol/home

# check autofs
1. /vol is empty
2. ll /vol/home shows the content
3. mount shows an NFS mount that seems about right

Now lets remove the /home and replace it with a symlink as you did (that feels wrong btw).
  lrwxrwxrwx 1 root root 9 May 3 10:02 home -> /vol/home/

After a reboot (now the symlink exists) I find the system like that:
1. the mount looks ok
  192.168.122.247:/mnt/sharedfolder on /vol/home type nfs4
  (rw,relatime,vers=4.2,rsize=65536,wsize=65536,namlen=255,hard,
  proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.118,
  local_lock=none,addr=192.168.122.247)
2. the symlink still is fine
  $ ll /home
  lrwxrwxrwx 1 root root 9 May 3 10:02 /home -> /vol/home/
3. my home dir looks fine
  $ ll /home/ubuntu/
  total 32
  drwxr-xr-x 5 ubuntu ubuntu 4096 May 3 10:05 ./
  drwxrwxrwx 3 nobody nogroup 4096 May 3 09:53 ../
  -rw-r--r-- 1 ubuntu ubuntu 220 Apr 4 2018 .bash_logout
  -rw-r--r-- 1 ubuntu ubuntu 3771 Apr 4 2018 .bashrc
  drwx------ 2 ubuntu ubuntu 4096 May 3 09:39 .cache/
  drwx------ 3 ubuntu ubuntu 4096 May 3 09:39 .gnupg/
  -rw-r--r-- 1 ubuntu ubuntu 807 Apr 4 2018 .profile
  drwx------ 2 ubuntu ubuntu 4096 May 3 09:38 .ssh/
  -rw-r--r-- 1 ubuntu ubuntu 0 May 3 09:40 .sudo_as_admin_successful

Summing that up, the case that you described works fine for me.
Could you outline what is different in your config?
And best attach all of your autofs and NFS related configuration?

[1]: https://wiki.ubuntuusers.de/Autofs/
[2]: https://vitux.com/install-nfs-server-and-client-on-ubuntu/