* Re: pivot_root.2: new_root must be a mountpoint
[not found] <20190919053801.bwqWTilN@vla3-2bcfd5e94671.qloud-c.yandex.net>
@ 2019-09-19 6:34 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; only message in thread
From: Michael Kerrisk (man-pages) @ 2019-09-19 6:34 UTC (permalink / raw)
To: Yang Bo; +Cc: mtk.manpages, linux-man
Hello Yang Bo,
On 9/19/19 4:38 AM, Yang Bo wrote:
> The man page says that new_root does not have be a mountpoint
> but it must be, I tried to pivot_root into a non-mountpoint
> directory and always failed with EINVAL, the kernel source
> fs/namespace.c confirms that, to quote a comment from this file:
>
> - it's okay to pick a root that isn't the root of a file system, e.g.
> - /nfs/my_root where /nfs is the mount point. It must be a mountpoint,
> - though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
> - first.
Yes, you are correct. There are in fact many problems in the
current pivot_root(2) page, and I am in the process of
substantially revising it.
Thanks
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] only message in thread