linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: How do I make a clean mount namespace?
Date: Wed, 23 Apr 2014 22:06:33 -0700	[thread overview]
Message-ID: <CALCETrV0n4QZCdxPrz+PeLRqM0yD4rkJ1xO4WgK7Mvvmqa-mew@mail.gmail.com> (raw)
In-Reply-To: <20140424023925.GW18016@ZenIV.linux.org.uk>

On Wed, Apr 23, 2014 at 7:39 PM, Al Viro <viro@zeniv.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

      reply	other threads:[~2014-04-24  5:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 22:12 How do I make a clean mount namespace? Andy Lutomirski
2014-04-23 20:01 ` Richard Weinberger
2014-04-24  0:54   ` Andy Lutomirski
2014-04-24  2:24     ` Al Viro
2014-04-24  2:39 ` Al Viro
2014-04-24  5:06   ` Andy Lutomirski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALCETrV0n4QZCdxPrz+PeLRqM0yD4rkJ1xO4WgK7Mvvmqa-mew@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).