LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   /sbin/init problems with initrd-boot (https://www.linuxquestions.org/questions/linux-software-2/sbin-init-problems-with-initrd-boot-298284/)

Fonk 03-06-2005 08:43 AM

/sbin/init problems with initrd-boot SOLVED
 
Hello,

I have to use an initrd because I've to load the module for my RAID-Controller. So I wrote my own initrd with an ext2 fs, copied the module and necessary Programs and now booting with the following testing /linuxrc:

Code:

#!/bin/sh
/bin/insmod /hpt374.ko
exec /bin/sh

After getting the shell do:

Code:

/bin/mount -o ro /dev/sda3 /new-root
cd new-root
/bin/pivot_root . initrd
exec chroot . /bin/sh

So, my last shell should have PID 1. If I now do
Code:

exec /sbin/init
I get:
Code:

Usage: init 0123456SsQqAaBbCcUu
VFS: Cannot open root device "sda3" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

So what is wrong? My kernel options are "root=/dev/sda3" which is the correct root... I think the problem is that /sbin/init does not execute the initial-steps (Usage: "init 0123456SsQqAaBbCcUu") - I also tried "exec /sbin/init s" (although I don't really know for what s,q,a,b,c oder u stand...) - then it complains that /dev/initctl does not exist...

My grub.conf (menu.lst) is like this:
Code:

default 0
timeout 10

title=Gentoo Linux 2.6.9
root (hd0,2)
kernel (hd0,2)/boot/vmlinuz-2.6.9 root=/dev/sda3
initrd (hd0,2)/boot/initrd-2.6.9

So thanks for any hints - I tried the last 6 hours to get the initrd working!! :-((

Fonk 03-06-2005 12:48 PM

So I solved the Problem myself:

Code:

kernel (hd0,2)/boot/vmlinuz-2.6.9 root=/dev/ram0
linuxrc:
Code:

insmod hpt374.ko
mount /dev/sda3 new-root

mount -t proc none proc
echo 0x83 > /proc/sys/kernel/real-root-dev
umount /proc
cd new-root
mkdir initrd 2>/dev/null
pivot_root . initrd
exec /bin/chroot . /sbin/init </dev/console >/dev/console 2>&1

man initrd helps!!


All times are GMT -5. The time now is 12:10 PM.