Description of problem: Unmount need several umount command to get nfs unmounted when the nfs mounted is remounted on top of the mounted mount. Version-Release number of selected component (if applicable): util-linux-2.23.2-33.el7.x86_64 How reproducible: mount the nfs several time mount nfs:/path /mnt <-- do this several times and then try to umount the mount point. It will also needs several umount command to get it unmounted. Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Only takes one umount command to get the mounted filesystem unmounted despite how many mount command being ran on the mount point. Additional info:
It works as expected and it's wanted behaviour.
(In reply to Karel Zak from comment #2) > It works as expected and it's wanted behaviour. Hi Karel, Any reference on why this is expected and wanted behaviour? Regards
You can create multiple mount nodes on the same place (same mountpoint). For example imagine situation when you have running process (web server, DB, ...) that uses something from /foo and you don't want to kill the process, but you want to force a new instances of the process to use new version of the /foo. In this case you can mount new content over the old. The old running process will still use the old (now by path invisible data), but new process will use new version. We use this for example during system boot where original system root is from initramfs, but later replaced by a real device ... and so on. The umount has to work the same but in opposite way. Note that mount the same source to the same target (mountpoint) is not always possible (mount(2) syscall returns EBUSY). It depends on the used kernel filesystem driver. Not sure, but if I good remember network filesystems (e.g. cifs) has no problem to use the same source more than one for the same target, for example cifs: # mount /mnt/sounds # mount /mnt/sounds # findmnt -o TARGET,SOURCE ... └─/mnt/sounds //sr.net.home/sounds └─/mnt/sounds //sr.net.home/sounds # umount /mnt/sounds # findmnt -o TARGET,SOURCE ... └─/mnt/sounds //sr.net.home/sounds # umount /mnt/sounds Anyway, umount works correctly in this case -- one umount(2) call foe each node.
All I want to say is that for system all the mounts are independent, so it's necessary to use separate umount calls.
Hi Karel, Thanks! Understood! Regards