Re: How do I make a clean mount namespace?

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

 



On Tue, Apr 22, 2014 at 03:12:11PM -0700, Andy Lutomirski wrote:
> I want to set up a little container.  So I unshare the mount namespace
> and mount something somewhere (say /mnt) that I want to be my new
> root.  Now what?
> 
> pivot_root("/mnt", "/mnt/garbage") seems to frequently return -EBUSY.

RTFM.  Literally - man 2 pivot_root and look for the only place where
it mentions EBUSY.

If you get that error, check what you've got in /proc/mounts (in the
namespace your process is in, obviously) just before the syscall.
With these arguments you really want /mnt to be a mountpoint.  If your
new root really lives on the same fs as the old one, just do
mount --bind /mnt /mnt before any other mounts.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux