[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: switch_root: not rootfs
From: Rob Landley <rob () landley ! net>
Date: 2006-08-30 18:28:56
Message-ID: 200608301428.56537.rob () landley ! net
[Download RAW message or body]
On Wednesday 30 August 2006 11:15 am, Jon Saints wrote:
> I am new to busybox and things are working fairly well
> until i try:
>
> switch_root /tmp/nfsroot /sbin/init
>
> Then I see:
>
> switch_root: not rootfs
>
> I don't seem to find any google results on this error
> when searching. Any ideas where I might start to
> debug?
From switch_root.c:
// Additional sanity checks: we're about to rm -rf /, so be REALLY SURE
// we mean it. (I could make this a CONFIG option, but I would get email
// from all the people who WILL eat their filesystemss.)
if (lstat("/init", &st1) || !S_ISREG(st1.st_mode) || statfs("/", &stfs) ||
(stfs.f_type != RAMFS_MAGIC && stfs.f_type != TMPFS_MAGIC) ||
getpid() != 1)
{
bb_error_msg_and_die("not rootfs");
}
It's checking that you have an /init, and that it's a regular file. It checks
that / is ramfs or tmpfs. And it checks that you are PID 1.
If any of those is _not_ true, then doing the equivalent of "find / -xdev |
rm -f" (which is how switch_root frees up the memory used by rootfs before
mounting the new root filesystem on top of it) probably isn't a good idea.
Rob
--
Never bet against the cheap plastic solution.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic