using switch_root from initfamfs ( switch_root: error moving root)

Christian MICHON christian.michon at gmail.com
Tue Apr 21 14:12:11 UTC 2009


On Tue, Apr 21, 2009 at 4:05 PM, E Robertson <e.robertson.svg at gmail.com> wrote:
> However, with just exec switch_root -c /dev/console /tmp/root
>  or
> exec switch_root  /tmp/root
> I'm having problems mounting the root:
> Kernel panic - not syncing: Attempted to kill init!
>
> The same filesystem I use for my Initramfs is the same file system I
> used to change into so I don't think that's it.
> Anyone has any ideas what I might be missing here? I've done this with
> no problems before but only with mtd devices but not sure what I might
> be doing wrong.
> Thanks.

you need a filesystem with a true /sbin/init if using linux-2.6.x+initramfs

it's a mistake to believe a filesystem valid for initramfs will be a
good candidate to switch_root into.

you quite likely will have a /init in your initramfs and it'll be a
shell script.

in DetaolB (the link is in my signature), I use the initramfs /init to
populate a mount point called /live.
In this /live, I've a true linux system, where /sbin/init is a true
init, not a shell script.

my 2 last lines  in my initramfs /init is:



-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !


More information about the busybox mailing list