Re: mount --bind /A /A multiplies mount entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 04, 2013 at 12:09:12PM +0100, Bernhard Voelker wrote:
>   $ ./mount | grep sdb
>   /dev/sdb on /home type ext4 (rw,relatime,data=ordered)
>   /dev/sdb on /home type ext4 (rw,relatime,data=ordered)

 Yes, it seems correct, use findmnt(8) to see what happen.  It's more
 tricky :-) (or see /proc/self/mountinfo where is Id<->Parent
 relationship described by two first columns).

 ... and don't forget that mounts are propagated in shared trees, so
 try to compare:

  mkdir /mnt/test

  mount --bind /mnt/test /mnt/test
  mount --make-private /mnt/test
  mount --bind /mnt/test /mnt/test
  mount --bind /mnt/test /mnt/test

 and:

  mount --bind /mnt/test /mnt/test
  mount --make-shared /mnt/test
  mount --bind /mnt/test /mnt/test
  mount --bind /mnt/test /mnt/test

you can also try to mount something else to /mnt/test/A to see what
happen.

> This is probably a kernel bug

 I don't think it's bug :-)

>, but as bind mounts to self
> are not that much of use, wouldn't it be worthwhile to
> prohibit it at all in mount(8)?

  mount --bind  /A /A

 is pretty common operation if you want to create a mountpoint
 from non-mountpoint directory.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux