mounting my kernel on new partition
Hi,
I am trying to install linux from the scratch on to a new parition on my system.
my system setup.
I have 4 partitions
hda1 / (Redhat 9.0)
hda2 swap
hda5 ext3 (kernel1)
hda6 ext2 (kernel2)
I made the partitions using fdisk and then used mkfs -t extx /dev/hdax comand to format them.
both kernel1 and kernel2 are same (compiled images). I creted two partitions to check whether it shows any differences for ext2 and ext3
On hda5 and hda6 i created following directories.
bin, boot,dev,etc,initrd,lib,mnt,opt,proc,root,sbin,usr,var
In bin directory i have put bash and sh (copied from Redhat 9.0)
In dev directory i have put hda devices using command ./MAKEDEV hda -d ./
(MAKEDEV i copied from redhat 9.0)
In boot directory is my kernel image bzImage and initrd-2.4.20-8.img (This one is copied from redhat as it is. (I think it is used only if itz a ext3 partition))
contents of grub.conf are as :
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/hda1
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/ vga=792
initrd /boot/initrd-2.4.20-8.img
title kernel1
root (hd0,4)
kernel /boot/bzImage ro root=/dev/hda5 init=/bin/sh
initrd /boot/initrd-2.4.20-8.img
title kernel2
root (hd0,5)
kernel /boot/bzImage ro root=/dev/hda6 init=/bin/sh
Now the problem is that when i try to boot my kernel with the above grub.conf then i get error
EXT-Fs warning (device ide(x,x)) : ext2_read_super : mounting ext3 filesystem as ext2 (This line is only for kernel1)
VFS:Mounted root (ext2 filesystem) readonly
freeing unused kernel memory : 132k freed
Warning : unable to open an initial console
Kernel Panic : No init found. Try passing init=option to the kernel.
If i remove the root=/dev/hdax option from grub.conf for the kernel1 and kernel2 then shell is opened without any errors but on ls it shows contents of hda1 (that means sh was launched from hda1)
if i put root=/dev/hda1 option for kernel1 and kernel2 then shell is opened from hda1 (I think this is alright).
Problem is that why is it not able to launch sh from my /dev/hda5 and /dev/hda6 partition.
Can anybody tell me why is this happening.......
i tried looking into init/do_mounts.c and init/main.c. I think at the end of main.c is where execve launches the shells. and if it is not able to launch any of the shells then it displays "No init found...." message. but i am not able to figure out why is it not displaying any errors while mountin root=/dev/hdax parameter if it is not able to initialise /.
wizardjack.
|