Util-Linux package development
 help / color / mirror / Atom feed
* Expected behavior of "mount /mnt/root /mnt/root --bind"
@ 2015-08-29  3:32 james harvey
  2015-08-29  3:58 ` Isaac Dunham
  0 siblings, 1 reply; 2+ messages in thread
From: james harvey @ 2015-08-29  3:32 UTC (permalink / raw)
  To: util-linux

If /dev/vda is a btrfs volume (not using partitioning) and is mounted to /mnt

And if /mnt/root is made as a normal directory (not a subdirectory)

And if an nfs share is mounted to /mnt/root/mnt

And for some reason "mount /mnt/root /mnt/root --bind" is ran

... Should /mnt/root/mnt now be viewable as an empty mountpoint,
hiding the nfs share?

Right now it does that.  Not sure what the expected behavior would be.
Not sure if "mount x x" is ever desired to be allowed, or if it should
refuse to do that.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Expected behavior of "mount /mnt/root /mnt/root --bind"
  2015-08-29  3:32 Expected behavior of "mount /mnt/root /mnt/root --bind" james harvey
@ 2015-08-29  3:58 ` Isaac Dunham
  0 siblings, 0 replies; 2+ messages in thread
From: Isaac Dunham @ 2015-08-29  3:58 UTC (permalink / raw)
  To: james harvey; +Cc: util-linux

On Sat, Aug 29, 2015 at 03:32:30AM +0000, james harvey wrote:
> If /dev/vda is a btrfs volume (not using partitioning) and is mounted to /mnt
> 
> And if /mnt/root is made as a normal directory (not a subdirectory)
> 
> And if an nfs share is mounted to /mnt/root/mnt
> 
> And for some reason "mount /mnt/root /mnt/root --bind" is ran
> 
> ... Should /mnt/root/mnt now be viewable as an empty mountpoint,
> hiding the nfs share?

Yes, since you used --bind not --rbind.

> Right now it does that.  Not sure what the expected behavior would be.
> Not sure if "mount x x" is ever desired to be allowed, or if it should
> refuse to do that.

It's a documented and used feature that you can bind mount a directory
over itself.

HTH,
Isaac Dunham

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-29  3:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-29  3:32 Expected behavior of "mount /mnt/root /mnt/root --bind" james harvey
2015-08-29  3:58 ` Isaac Dunham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox