All of lore.kernel.org
 help / color / mirror / Atom feed
* pivot_root()
@ 2005-05-16 10:09 Lai Zit Seng
  2005-05-16 13:56 ` pivot_root() serue
  0 siblings, 1 reply; 3+ messages in thread
From: Lai Zit Seng @ 2005-05-16 10:09 UTC (permalink / raw)
  To: linux-kernel

Not sure where to post this, forgive me if there is a better place to 
post...

I'm trying to use pivot_root() to change root to a directory that is not 
a mount point, i.e. it is under a mount point of a different device from 
the current root device.

E.g.

# /root is mounted from /dev/sda1
pivot_root("/root/somewhere", "/root/somewhere/initrd");

But pivot_root() returns EINVAL. Both /root/somewhere and 
/root/somewhere/initrd exists.

Any pointers about what might be wrong? Many thanks :)

Regards,

.lzs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pivot_root()
  2005-05-16 10:09 pivot_root() Lai Zit Seng
@ 2005-05-16 13:56 ` serue
  2005-05-16 15:07   ` pivot_root() Lai Zit Seng
  0 siblings, 1 reply; 3+ messages in thread
From: serue @ 2005-05-16 13:56 UTC (permalink / raw)
  To: Lai Zit Seng; +Cc: linux-kernel

Quoting Lai Zit Seng (lzs@pobox.com):
> Not sure where to post this, forgive me if there is a better place to 
> post...
> 
> I'm trying to use pivot_root() to change root to a directory that is not 
> a mount point, i.e. it is under a mount point of a different device from 
> the current root device.
> 
> E.g.
> 
> # /root is mounted from /dev/sda1
> pivot_root("/root/somewhere", "/root/somewhere/initrd");
> 
> But pivot_root() returns EINVAL. Both /root/somewhere and 
> /root/somewhere/initrd exists.
> 
> Any pointers about what might be wrong? Many thanks :)

Try first doing

	mount --bind <newroot> <newroot>

See the comments above fs/namespace.c:sys_pivot_root() for the
explanation.

-serge

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pivot_root()
  2005-05-16 13:56 ` pivot_root() serue
@ 2005-05-16 15:07   ` Lai Zit Seng
  0 siblings, 0 replies; 3+ messages in thread
From: Lai Zit Seng @ 2005-05-16 15:07 UTC (permalink / raw)
  To: serue; +Cc: linux-kernel

Yes you're right. Thanks!

Regards,

.lzs
http://thinkingfarm.com/~lzs/

On Mon, 16 May 2005 serue@us.ibm.com wrote:
> Try first doing
>
> 	mount --bind <newroot> <newroot>
>
> See the comments above fs/namespace.c:sys_pivot_root() for the
> explanation.
>
> -serge

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-16 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-16 10:09 pivot_root() Lai Zit Seng
2005-05-16 13:56 ` pivot_root() serue
2005-05-16 15:07   ` pivot_root() Lai Zit Seng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.