Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tinygentoo (variant): unable to mount root fs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 460
Location: Canberra Australia

PostPosted: Mon Jun 12, 2006 12:52 pm    Post subject: Tinygentoo (variant): unable to mount root fs Reply with quote

I have tried to create a variant of tinygentoo at http://gentoo-wiki.com/TinyGentoo. I've created the initrd as per the instructions and I've created an .iso file using the following commands:
Code:
#!/bin/bash
cd /tmp/tinygentoo && find . | cpio -H newc -o | gzip -9 > /tmp/initramfs-tg.igz
cp -f /tmp/initramfs-tg.igz /tmp/system/boot
cd /tmp/system
mkisofs -R -b boot/grub/stage2_eltorito \
    -gui -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 4 \
    -hide-rr-moved -c boot.catalog \
    -o /tmp/tinygentoo.iso /tmp/system
chmod 755 /tmp/tinygentoo.iso

When I try to boot image up (I'm using qemu for testing), I get the dreaded:
Quote:
Kernel panic - not synching: VFS: Unable to mount root fs on unknown-block(1,0)

Here is my /boot/grub/menu.lst:
Quote:
title TESTING
root (cd)
kernel /kernel-2.6.15-tg1-TESTING root=/dev/ram0 ramdisk_size=24000 init=/linuxrc vga=0F01
initrd /boot/initramfs-tg.igz

Can anybody point me in the right direction?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Mon Jun 12, 2006 1:02 pm    Post subject: Reply with quote

Robert S,

Your initrd is not loading or if it is, /dev/ram0 cannot be read because the kernel does not have the filesystem to read it built in.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 460
Location: Canberra Australia

PostPosted: Mon Jun 12, 2006 1:34 pm    Post subject: Reply with quote

I've enabled ext2, initrd, ram filesystem etc in my kernel. What else do I need to enable?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Mon Jun 12, 2006 2:18 pm    Post subject: Reply with quote

Robert S,

Since
Code:
kernel /kernel-2.6.15-tg1-TESTING root=/dev/ram0 ramdisk_size=24000 init=/linuxrc vga=0F01
loads your kernel, your /boot dir needs a symbolic link
Code:
 boot -> .
boot pointing to itself for
Code:
initrd /boot/initramfs-tg.igz
to work.
Not all filesystems support symbolic links, so you may need to write
Code:
initrd /initramfs-tg.igz

I have a feeling that Grub would give you Error 15 if that was the issue though.

How have you compressed the initrd?
I believe the kernel expects bzip, though I think other formats are supported now.

All the items you list must be built into your kernel, not modules.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 460
Location: Canberra Australia

PostPosted: Tue Jun 13, 2006 9:33 am    Post subject: Reply with quote

Sadly I'm still no further ahead. I've tried the following:

  • Compiled the kernel so that there aren't any modules
  • Compressed the image using bzip2 (using bzip2 -cjf initrd.bz2 initrd)
  • Used an uncompressed image
  • Fiddled around with location of kernel and image

I get the following message on bootup:
Quote:
Checking if image is initramfs.. it is

I therefore assume that the file is a valid initramfs.

Is the line "root=/dev/ram0" correct? The final message says "Unable to mount root fs on unknown-block(1,0)". I get the impression that the root filesystem is not mounting.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Tue Jun 13, 2006 1:13 pm    Post subject: Reply with quote

Robert S,

Yes, "root=/dev/ram0" is correct. The message
Code:
unknown-block(1,0)
is unknown-block(major_num, minor_num). Looking at
Code:
less /usr/src/linux/Documentation/devices.txt
shows thats
Code:
  1 block       RAM disk
                  0 = /dev/ram0         First RAM disk

The unknown-block(x,y) message comes in various guises. When x and y are both zero, it means the kernel cannot get to the root device at all. Normally a hardware layer is missing. When x and y are both non-zero, the /dev/ has been found but the kernel cannot understand what it finds there. Normally the filesystem is missing from the kernel.

You are correct that the root filesystem is not mounting, but the kernel can see it.
How do you make your initrd file ?
If the kernel is correct, it must be the internal format of the file.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 460
Location: Canberra Australia

PostPosted: Wed Jun 14, 2006 9:56 am    Post subject: Reply with quote

I've used this to create the initrd:
Quote:
# cd /tmp/tinygentoo && find . | cpio -H newc -o | gzip -9 > /tmp/initramfs-tg.igz

..as per the wiki.

I have discovered that the following works:
Quote:

dd if=/dev/zero of=/tmp/initrd.img bs=1MB count=20
mke2fs -F /tmp/initrd.img
mkdir /mnt/initrd
mount -o loop /tmp/initrd.img /mnt/initrd
rsync -avz /tmp/tinygentoo/ /mnt/initrd
umount /mnt/initrd
cd /tmp
gzip -9 initrd.img

.. but I'm still mystified why the first command from the wiki does not work. I've just tried a 2.4.* kernel with the same result.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Wed Jun 14, 2006 1:27 pm    Post subject: Reply with quote

Robert S,

Well, both methods should work. The cpio way creates a file that contains lots of seperately compressed parts.
The loop method creates a filesystem, that is then compressed as a whole.
A 2.6 kernel understands both.

Hmm ... maybe grub does the decompress, not the kernel. The cpio method is quite recent, perhaps its a new addition to grub ?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 460
Location: Canberra Australia

PostPosted: Thu Jun 15, 2006 11:10 am    Post subject: Reply with quote

I've just upgraded grub and have used the latest 2.6.16 gentoo-sources kernel. Still no luck. Have also tried bzip -9 with no luck.

I'd be interested to hear of other peoples' experience with this.

Oddly enough I've got the cpio method to work on my amd64 box on qemu, using the latest vanilla-sources. The loop method seems to hang on bootup. Think I'll try the 2.6 vanilla-sources on my x86 system - the 2.6 vanilla-sources kernel seems to be masked on the uclibc profile.
Back to top
View user's profile Send private message
jac_goudsmit
n00b
n00b


Joined: 29 Nov 2005
Posts: 4

PostPosted: Sat Aug 12, 2006 1:24 am    Post subject: [SOLVED] Tinygentoo (variant): unable to mount root fs Reply with quote

Try this in your chroot before you create your file system with the cpio method:
Code:
cd /tinygentoo
ln -s bin/busybox init


It creates /init in the file system which lets the 2.6 kernel handle the file system differently. The new way (which the kernel apparently detects by checking for /init in the initramfs file system) works with the cpio method, the old way (to which the kernel reverts when it doesn't find /init) does not.

See http://www.timesys.com/timesource/march_06.htm and http://www.timesys.com/timesource/initramfs.htm. Excellent stuff, took me a long time to find.

===Jac
Back to top
View user's profile Send private message
psychocandy
Apprentice
Apprentice


Joined: 09 Nov 2006
Posts: 192

PostPosted: Tue Dec 05, 2006 3:52 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Robert S,

Well, both methods should work. The cpio way creates a file that contains lots of seperately compressed parts.
The loop method creates a filesystem, that is then compressed as a whole.
A 2.6 kernel understands both.

Hmm ... maybe grub does the decompress, not the kernel. The cpio method is quite recent, perhaps its a new addition to grub ?


Interesting.... So are you saying you can create the image file using either the cpio method or the old way (creating fs on file) ?

I can't get either working with my 2.6 kernel though...

Are they dependent on the inclusion of /linuxrc and /init (respectively) though ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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