I export NFS share form server as described in /etc/exports:
Code:
/home/maciek/back/RSYNC 192.168.0.7(rw,no_root_squash,subtree_check,crossmnt)
This is the only entry in /etc/exports file. Both server and client use NFS v4.
Than I have such entry in fstab of NFS server:
Code:
LABEL=4TB /home/maciek/back/RSYNC ext4 user,noauto,defaults,noatime 0 0
HDD with LABEL=4TB is USB v3 connected external disk with one ext4 partition.
I use all of it for off-line backup, running from script. The script works as follows:
1 - mount USB HDD on server to /home/maciek/back/RSYNC dir using command:
Code:
/bin/mount LABEL=4TB
2 - client mount /home/maciek/back/RSYNC NFS share using command:
Code:
/bin/mount -w -v -t nfs -o rw -O user=root.password=pass 192.168.0.2:/home/maciek/back/RSYNC /share/CACHEDEV2_DATA/mnt
3 - script backup desired files using rsync
4 - client umount NFS share using command:
Code:
/bin/umount /share/CACHEDEV2_DATA/mnt
5 - server umount USB HDD:
Code:
/bin/umount -l $dev
$dev is formerly calculated device name of USB HDD ext4 partition.
When umount command has no "-l" option, it does not umount HDD partition because device is busy.
lsof for /home/maciek/back/RSYNC shows nothing.
Than I run the same script again. And it hangs when client try to mount NFS share from server.
The only solution I found so far is to restart nfs-server service on server.
So what I am doing wrong that mounting NFS share for the second time hangs? All logs shows that both NFS and local mounts are properly dismounted. If any additional info are necessary, will post ASAP.