View previous topic :: View next topic |
Author |
Message |
mem_gentoo n00b
Joined: 27 Apr 2007 Posts: 27
|
Posted: Tue Jun 26, 2007 1:27 am Post subject: switch_root not rootfs - ramdisk help |
|
|
Following on from my original thread https://forums.gentoo.org/viewtopic-t-564137-highlight-unionfs+rootfs.html
Everything was working fine, went to boot off my disk and this message comes up Quote: | switch_root: not rootfs |
my current init Im using
Code: | #!/bin/sh
# mems root unionfs linuxrc - WIP
. /etc/initrd.defaults
. /etc/initrd.scripts
exec >${CONSOLE} <${CONSOLE} 2>&1
mount -t proc proc /proc
mount -o remount,rw / >/dev/null # is this needed ??
mount_sysfs
sdelay
start_dev_mgr
/bin/busybox --install -s
echo "*** Attaching ramdrive to /rd-root"
mount -n -t tmpfs none /rd-root
echo "*** mounting /dev/hda3 on /real-root"
mount -t ext2 -r /dev/hda3 /real-root
echo "*** Creating unionfs"
mount2 -n -t unionfs -o dirs=/rd-root=rw:/real-root=ro unionfs /fake-root
echo "*** Switching root"
switch_root -c /dev/console /fake-root /sbin/init
echo "*** Getting Kernel command line options"
CMDLINE=`cat /proc/cmdline`
echo "Start system init script"
exec /bin/chroot /fake-root /sbin/init ${CMDLINE} <dev/console >dev/console 2>&1 |
atm I have no idea why this error suddenly popped up - help please |
|
Back to top |
|
|
mirekm Apprentice
Joined: 12 Feb 2004 Posts: 210 Location: Gliwice
|
Posted: Tue Jun 26, 2007 7:22 am Post subject: |
|
|
Try to:
cd /fake-root
exec switch_root -c /dev/console /fake-root /sbin/init
But I am not sure if this will work with unionfs, because you mount 2 file systems to 2 folders, and then join them into third using unionfs. I think you have to ask on forum of busybox, or unionfs. As far I know switch_root or pivot_root exchange only fs of mentioned folder with existing root, and then dismounts old root filesystem. So in that case you get new root as you request, but the filesystems the root is build on get removed, so you stay without root FS at all. |
|
Back to top |
|
|
mirekm Apprentice
Joined: 12 Feb 2004 Posts: 210 Location: Gliwice
|
Posted: Tue Jun 26, 2007 7:34 am Post subject: |
|
|
One think more. I don't know how unionfs is working. You can try to do 2 tricks, maybe one of them helps.
1. Try to create same directories as you have on your initramfs, where you have mounted parts of unionfs, maybe on sitch of root, the parts will get remounted automagically to these folders.
or
2. Try to mount the part filesystems into folders located inside of your new root fs, and then using them build unionfs.
I hope one of these tricks will help. |
|
Back to top |
|
|
mem_gentoo n00b
Joined: 27 Apr 2007 Posts: 27
|
Posted: Tue Jun 26, 2007 4:19 pm Post subject: |
|
|
tried the 1s to no avail. will checkout the 2nd 1 tomorrow |
|
Back to top |
|
|
JeliJami Veteran
Joined: 17 Jan 2006 Posts: 1086 Location: Belgium
|
Posted: Wed Jun 27, 2007 8:25 am Post subject: |
|
|
And as I have mentioned in that other thread, try switching to aufs. I could not get busybox + ro nfs root + tmpfs root + unionfs working. It does work with aufs. _________________ Unanswered Post Initiative | Search | FAQ
Former username: davjel |
|
Back to top |
|
|
mem_gentoo n00b
Joined: 27 Apr 2007 Posts: 27
|
Posted: Wed Jun 27, 2007 8:31 am Post subject: |
|
|
yah its a good call man, I think Ive tooled around with unionfs long enough time to switch to the popular vote. |
|
Back to top |
|
|
|