1

I installed autofs and it's mounting a network drive to a folder in my local linux filesystem. I use -fstype=cifs,rw in the mount command in an /etc/auto.smb.shares file.

If I cd into the mounted folder (or if I have got it open in a Windows Samba Share) and I stop autofs systemctl stop autofs the folder stays mounted.

I check with systemctl status autofs and it says the autofs process is dead. But I check with the mount command and df -h and the mounted folder is still there and indeed I can cd in and out of the folder from linux or browse in and out from the Windows Samba share.

If I manually unmount the drive then it unmounts it. Now if I restart autofs I get the expected behavior again. If I now cd out of the mounted folder and stop autofs it does not mount the folder if I try to cd in to it.

Am I just describing standard behavior of autofs or why does a folder stay mounted if I happen to have it open when I stop autofs?

Cheers, Flex

2
  • 1
    Killing autofs removes the reason your automounts were being unmounted in the first place - for lack of use. This is expected behaviour. Sep 28, 2020 at 0:01
  • Thank you. That makes perfect sense. If you want to make that an official answer I will accept it. Sep 28, 2020 at 19:14

1 Answer 1

1

When you stop the autofs service, you're removing the reason your automounts were being unmounted in the first place - for lack of use. This is expected behaviour.

So, unless you manually unmount the filesystem, it will stay mounted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .