Sample Header Ad - 728x90

Shared folder remounts itself after umount

0 votes
0 answers
37 views
On a Oracle Linux 7.9 server, I have a directory that is mounted from another system. The fstab entry is:
`
myuser@192.168.10.2:/opt/commonfiles /opt/commonfiles/ fuse.sshfs identityfile=/home/myuser/.ssh/id_rsa,x-systemd.automount,x-systemd.nofail,_netdev,user,idmap=user,transform_symlinks,default_permissions,allow_other,rw,uid=1004,gid=1004,umask=0003   0 0
` I need the ownership set as myuser so that the applications that run on both machines would have suitable rights. This has been working satisfactorily for a number of years. Now, the server is being replaced by a newer, shinier one; let's call it 192.168.10.3. I duplicated the fstab line with the second IP, mounted the directory in a temporary path to test, unmounted it. Next, I wanted to umount this, change the pointing and mount to new server. When I give the command
sudo umount /opt/commonfiles
I get the bash prompt and no errors or warnings. Similarly, nothing in /var/log/messages. The command
df -h
shows that it has been unmounted, but only for a few seconds. But then, it get auto-remounted. If I say
sudo umount /opt/commonfiles;sudo mount /opt/commonfiles;df -h
, I get the response that directory is not empty and df shows the old server is still mounted even though its fstab entry has been commented out. Firstly, this is a production server with 24/7 transactions, so there is no time to reboot it unless I wake up in the wee hours to do this. Secondly, lsof shows no locks on any files within /opt/commonfiles. It looks to me that the reason is the x-systemd.automount option. Although, it should only mean that the device is to be mounted at boot time.
Asked by Hussain Akbar (145 rep)
May 3, 2024, 06:52 AM