Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.


  Search this Thread
Old 12-12-2003, 01:00 AM   #1
LQ Newbie
Registered: Nov 2003
Posts: 5

Rep: Reputation: 0
mounting my kernel on new partition


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
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 /.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting Partition DDRfreak2 Mandriva 8 09-10-2005 12:33 PM
problem in installing kernel and mounting ntfs partition buchalkalan Linux - Software 1 11-27-2004 10:02 AM
Partition mounting/KDE errors after creating Fat32 Partition BertBert Linux - General 1 07-07-2004 10:59 AM
second reiserfs partition not mounting after upgrading from 2.4 to 2.6 kernel greenmuzz Linux - General 1 05-12-2004 08:13 AM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 03:13 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration