Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using an USB disk as root fs.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
knopper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2002
Posts: 106
Location: The Netherlands

PostPosted: Fri Aug 27, 2004 8:05 am    Post subject: Using an USB disk as root fs. Reply with quote

Hi all,

I'm currently working on a small busybox/uclibc based rescue system which can be found here: http://www.knopper.tk/projects/

Though now I'm looking for a way to boot with a usual floppy and then use an USB disk as root fs. So I made an initrd with the proper modules in it (using 2.6 kernel) and all this gets loaded correctly since in recognizes the usb disk and shows the partition table.

The failure comes when the kernel tries to mount the root fs, it gives this output:

Code:

mount: error 6 mounting ext2
pivotroot: pivot_root failed 2
can't unmount /initrd/proc


I made a directory called "initrd" on the usb disk and just te be sure also on the floppy disk, this doesn't help.

Here's my grub.conf :

Code:

# By default, boot the first entry.
default 0

timeout 15

title  Knopperdisk
root   (fd0)
kernel /kernel-2.6.8.1 root=sda1 vga=791
initrd /initrd-2.6.8.1


The root variable is correct, I know for sure since it shows the partition table of the usb disk at boot.

Does anyone have any idea what I might be doing wrong?

Of course there's ext2 support directly compiled into the kernel and I formatted the usb disk as ext2. (after I cleared it with dd if=/dev/zero of=/dev/sda)
Back to top
View user's profile Send private message
knopper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2002
Posts: 106
Location: The Netherlands

PostPosted: Fri Aug 27, 2004 10:55 am    Post subject: Reply with quote

anybody?

I've tried to make the initrd both with pivot and without. They both give the same error.
Back to top
View user's profile Send private message
smart
Guru
Guru


Joined: 19 Nov 2002
Posts: 455

PostPosted: Fri Aug 27, 2004 1:53 pm    Post subject: Reply with quote

I think its not related to initrd or usb, but proc instead.
Back to top
View user's profile Send private message
jdong
n00b
n00b


Joined: 01 Mar 2004
Posts: 41

PostPosted: Fri Aug 27, 2004 2:57 pm    Post subject: Reply with quote

your kernel line should have root=/dev/sda1, not just sda1
Back to top
View user's profile Send private message
knopper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2002
Posts: 106
Location: The Netherlands

PostPosted: Fri Aug 27, 2004 5:05 pm    Post subject: Reply with quote

That was a typo, the problem was that there was not device called "sda1" in the initrd dev directory. So I mounted it as loopback device and made it myself.
Back to top
View user's profile Send private message
Nate_S
Guru
Guru


Joined: 18 Mar 2004
Posts: 414

PostPosted: Fri Aug 27, 2004 6:08 pm    Post subject: Reply with quote

A quick google search turns up that you may need to unmount /proc before you try to piviot_root. Also depending on your init scripts, you may need to change them to point to the real device, rather than /dev/root (if they are)

ref:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=62206
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=64736
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=65099

If that doesn't help, post your init scripts

-Nate
Back to top
View user's profile Send private message
knopper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2002
Posts: 106
Location: The Netherlands

PostPosted: Fri Aug 27, 2004 6:20 pm    Post subject: Reply with quote

I forgot to mention that besides create the right device block in /dev of the initrd image I also changed "/dev/root" to the right device in the "linuxrc" script. Actually I found thesame websites...;)

Thanks anyway!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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