The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: serue@us.ibm.com
To: Lai Zit Seng <lzs@pobox.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: pivot_root()
Date: Mon, 16 May 2005 08:56:45 -0500	[thread overview]
Message-ID: <20050516135645.GA5842@serge.austin.ibm.com> (raw)
In-Reply-To: <42887147.9000302@pobox.com>

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

  reply	other threads:[~2005-05-16 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-16 10:09 pivot_root() Lai Zit Seng
2005-05-16 13:56 ` serue [this message]
2005-05-16 15:07   ` pivot_root() Lai Zit Seng

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=20050516135645.GA5842@serge.austin.ibm.com \
    --to=serue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lzs@pobox.com \
    /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