[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFLxGvyn4q3VfRrAcjO6meZ1UJwRZ5-yeaMExGX5ogtnuAkPBQ@mail.gmail.com>
Date: Wed, 23 Apr 2014 22:01:27 +0200
From: Richard Weinberger <richard.weinberger@...il.com>
To: Andy Lutomirski <luto@...capital.net>
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 12:12 AM, Andy Lutomirski <luto@...capital.net> 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.
>
> mounting /mnt onto / using MS_MOVE seems to succeed, but / still
> points at the old root.
>
> Am I missing a clean way to do this? I want a way to say "make this
> mountpoint be the root of the whole mount namespace and lazy-unmount
> everything outside it". If there is no straightforward way to do
> that, can we add one?
I fear you have to read /proc/mounts and umount() everything in the
correct order.
If you find a better way, please tell. :-)
--
Thanks,
//richard
--
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