- a NFS share is mounted on
/mnt/temp/dir(and other shares are mounted in subdirectories),
umounteverything there but supposedly, it doesn't work well (maybe I start with
umount /mnt/temp/dirinstead of umounting "nested" shares like
- I do
mount -o bind /data/temp /mnt/temp,
- I do
- I do
mount /mnt/temp/dir/subdir1... and it works well.
/mnt/temp is initially hosted on the root (
/data is another filesystem from
I cannot delete the
/mnt/temp/dir directory on the root filesystem:
# mount -o bind / /test/root # rmdir /test/root/mnt/temp/dir rmdir: failed to remove `dir': Device or resource busy
/mnt/temp/dir is mounted twice, probably once on the root fs, and once on the
nfsserver:/some/share/ /mnt/temp/dir nfs rw,relatime(...) 0 0 nfsserver:/some/share/ /mnt/temp/dir nfs rw,relatime,(...) 0 0
More interesting, here is
29 20 0:18 / /mnt/temp/dir rw,relatime - nfs nfsserver:/some/share/ rw,(...) 33 31 0:18 / /mnt/temp/dir rw,relatime - nfs nfsserver:/some/share/ rw,(...)
See, the two numbers at the beginning are different.
Kernel doc says for these two fields:
(1) mount ID: unique identifier of the mount (may be reused after umount) (2) parent ID: ID of parent (or of self for the top of the mount tree)
They also have different parents 20 and 31 (root fs and
/data fs), see:
20 1 8:6 / / rw,relatime - ext4 /dev/sda6 rw,(...) 31 20 8:8 /temp /mnt/temp rw,relatime - ext4 /dev/sda8 rw,(...)
If I try to
umount /mnt/temp/dir, I get 2 error messages:
umount.nfs: /mnt/temp/dir: device is busy umount.nfs: /mnt/temp/dir: device is busy
How can I
umount the "bad" one (mount ID 29)?
umount(2) system call takes a path for argument, and not a "mount ID".