Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
switch_root not rootfs - ramdisk help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
mem_gentoo
n00b
n00b


Joined: 27 Apr 2007
Posts: 27

PostPosted: Tue Jun 26, 2007 1:27 am    Post subject: switch_root not rootfs - ramdisk help Reply with quote

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 :D
Back to top
View user's profile Send private message
mirekm
Apprentice
Apprentice


Joined: 12 Feb 2004
Posts: 210
Location: Gliwice

PostPosted: Tue Jun 26, 2007 7:22 am    Post subject: Reply with quote

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
View user's profile Send private message
mirekm
Apprentice
Apprentice


Joined: 12 Feb 2004
Posts: 210
Location: Gliwice

PostPosted: Tue Jun 26, 2007 7:34 am    Post subject: Reply with quote

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
View user's profile Send private message
mem_gentoo
n00b
n00b


Joined: 27 Apr 2007
Posts: 27

PostPosted: Tue Jun 26, 2007 4:19 pm    Post subject: Reply with quote

tried the 1s to no avail. will checkout the 2nd 1 tomorrow
Back to top
View user's profile Send private message
JeliJami
Veteran
Veteran


Joined: 17 Jan 2006
Posts: 1086
Location: Belgium

PostPosted: Wed Jun 27, 2007 8:25 am    Post subject: Reply with quote

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
View user's profile Send private message
mem_gentoo
n00b
n00b


Joined: 27 Apr 2007
Posts: 27

PostPosted: Wed Jun 27, 2007 8:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum