[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALCETrV0n4QZCdxPrz+PeLRqM0yD4rkJ1xO4WgK7Mvvmqa-mew@mail.gmail.com>
Date: Wed, 23 Apr 2014 22:06:33 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux FS Devel <linux-fsdevel@...r.kernel.org>
Subject: Re: How do I make a clean mount namespace?
On Wed, Apr 23, 2014 at 7:39 PM, Al Viro <viro@...iv.linux.org.uk> wrote:
> 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.
Wow -- thanks! I read that part, but I'm apparently bad at following
directions.
Should I expect things to work if I unshare mounts but don't do a
mount --make-rprivate / before the pivot_rot?
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists