LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   pivot root error while booting kernel 2.6.7 (https://www.linuxquestions.org/questions/linux-newbie-8/pivot-root-error-while-booting-kernel-2-6-7-a-211728/)

tuxrules 07-31-2004 12:41 AM

pivot root error while booting kernel 2.6.7
 
I just finished compiling kernel 2.6.7 on my RH 9. I followed the instructions given in this article
posted on LQ. Well everything went smooth and I have the new kernel and initrd.img files copied to my /boot. When I boot using the new kernel I get the following error message.

mounting root filesystem
mount: error 19 mounting ext3
pivot root: pivot_root (/sysroot, /sysroot/initrd) failed: 2
umount /initrd/proc failed: 2
Mounting devfs on /dev
Freeing unused kernel memory: 184k freed
Kernel panic: No init found. Try passing init= option to kernel.

Anyone knows whats wrong. I'll appreciate if someone can give me exact pointers as its my first kernel compile.

Thanks,
Tux

tuxrules 07-31-2004 01:50 AM

Anyone????

frob23 07-31-2004 01:58 AM

Well, I know, and I don't know. This is one of those things where a geek wants 20 minutes, a couple of repair floppies, and a private room alone with the computer. :cool:

From the messages I would say that init either got wasted or the new kernel doesn't look in the right place (usually /sbin/init in my experience). Let me read through the steps and ponder how they would have changed init.

frob23 07-31-2004 02:03 AM

Quote:

STEP 8:

This is very important. Make sure you're .config has the
following in it CONFIG_EXT3_FS=y You'll run into the following
error if you leave this =m instead of =y:

pivotroot: pivot_root(/sysroot,/sysroot/initrd) failed

This is because Redhat 9.0 and 8.0 use the ext3 filesystem
for /boot ...
Looks like this might be part of the problem right here. Did you remember to set this option correctly?

Edit: Of course, if you can't mount the filesystem you can't find init on it. ;)

tuxrules 07-31-2004 04:38 PM

Well, tried to compile again (from start) and also edited the following line in .config file (copied my old config and make oldconfig)
from CONFIG_EXT3_FS=m to CONFIG_EXT3_FS=y.

then i gave,
make bzImage
make modules && make modules_install && make install

I got this error (I think during the make install process):

if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.6.7; fi
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CHK include/linux/compile.h
Kernel: arch/i386/boot/bzImage is ready
sh /usr/src/linux-2.6.7/arch/i386/boot/install.sh 2.6.7 arch/i386/boot/bzImage System.map ""
All of your loopback devices are in use.
mkinitrd failed
make[1]: *** [install] Error 1
make: *** [install] Error 2

Can anyone point out why so????

tuxrules 07-31-2004 05:09 PM

Anyone knows about this????

tuxrules 07-31-2004 09:35 PM

Does anyone knows this???? Please post if you know the reply.

Demonbane 07-31-2004 10:08 PM

get rid of initrd, make sure you have the filesystem and ide chipset support compiled into the kernel, and change reference of "=LABEL=/" in /etc/fstab and kernel parameters to the actual device(eg /dev/hda1).
Or try using the latest version of mkinitrd from here
Or install the precompiled RPMs from the same link.

frob23 07-31-2004 11:53 PM

tuxrules, please follow the guidelines of the forum and do NOT bump your message till it has gone unanswered for at least 24 hours. People do take time to respond and they do check more than the first page for questions they can help on. You have bumped this thread almost as much as people have responded.

It is one thing to post new or more information it is another to see this
Quote:

Anyone knows about this????
repeatedly in the same thread especially in such a short amount of time.

Relevant information:
http://www.linuxquestions.org/rules.php

Quote:

We do insist that you abide by the rules and policies detailed below.
* While almost every question does get an answer, we cannot guarantee a response. Please do not bump your post until 24 hours has past.

tuxrules 08-01-2004 09:50 AM

Hi frob23,
Sorry for bumping the threads. This is the first time i've bumped a thread and I promise not to do it again. I was a little frustrated by repeated compiling and got a little impatient to get answers. Anyway thanks for your replies.

Let me try the options given by demonbane.

Thanks again for replies.

Tux

tuxrules 08-03-2004 11:57 AM

well, I am doing this kernel compile since many days now. I know I can install the kernel rpm but i want to compile it (just for the heck of it).

demonbane, I dont get what you mean by
Quote:

get rid of initrd
Can you elaborate on it???

Tux

tuxrules 08-06-2004 10:56 PM

well,
I recompiled the kernel again for RH9 (old kernel-2.4.20-8) and this time I didnt choose ramdisk support (initrd) because of the problem i had during the previous compiles (read my earlier posts). I also opted for inbuilt support for ext3 filesystem. I compiled the kernel alright and copied bzImage and system.map to boot partition (hdb1). RH9 is on hdb3. hdb2 is swap.

Here's the part of original fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2

and here's the part of original grub.conf
title Red Hat Linux 9 (2.6.7)
root (hd1,0)
kernel /bzImage-2.6.7 ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi
title Red Hat Linux 9 (2.4.20-8)
root (hd1,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi
initrd /initrd-2.4.20-8.img

Here's the part of modified fstab (after kernel-2.6.7 compile)
/dev/hdb3 / ext3 defaults 1 1
/dev/hdb1 /boot ext3 defaults 1 2

Here's the part of modified grub.conf after compile
title Red Hat Linux 9 (2.6.7)
root (hd1,0)
kernel /vmlinuz-2.6.7 ro root=/dev/hdb3
title Red Hat Linux 9 (2.4.20-8)
root (hd1,0)
kernel /vmlinuz-2.4.20-8 ro root=/dev/hdb3 hdc=ide-scsi hdd=ide-scsi
initrd /initrd-2.4.20-8.img

If i try to boot using the original fstab and grub.conf,
I get the following error:
VFS: cannot open root device "LABEL=/" or unknown-block(0,0)
please append a correct "root=" boot option
kernel panic: VFS: Unable to mount root fs on unknown-block(0,0)

If i try to boot using modified fstab and grub.conf
I get a superblock error, and it asks me to repair the file system. Says something like superblock error.

Can you tell me whats going on??? I'm a little lost. Should I include the ram disk support and recompile. Just an odd thought, I've tried several times to compile this kernel on RH9. Is it really necessary to have make initrd in RH9. I compiled the kernel for slackware 10 and I didnt do that.

Thanks,
Tux

tuxrules 08-07-2004 10:04 AM

Okay more problems, looks like RH 9 is very stubborn.

Here's what I did with modified fstab
/dev/hdb3 / ext3 defaults 1 1
/dev/hdb1 /boot ext3 defaults 1 2

Here's the part of modified grub.conf after compile
title Red Hat Linux 9 (2.6.7)
root (hd1,0)
kernel /vmlinuz-2.6.7 ro root=/dev/hdb3
title Red Hat Linux 9 (2.4.20-8)
root (hd1,0)
kernel /vmlinuz-2.4.20-8 ro root=/dev/hdb3 hdc=ide-scsi hdd=ide-scsi
initrd /initrd-2.4.20-8.img

Now i get error like this;

Checking root filesystem
fsck.ext3/dev/hdb3:
The superblock couldnot be read or does not describe a correct ext2 filesystem. If the device is valid & it really contains an ext2 fs (and not swap or nfs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock.
e2fsck -b 8193 <device>
:No such file or directory while trying to open /dev/hdb3

I dont understand whats going on??? can anyone help me figure out??

frob23 08-07-2004 10:37 AM

Can you cut and paste the lines dealing with ext3 from .config ?

Give the whole block... starting with ext2 as well.

Demonbane 08-07-2004 10:46 AM

Double check that ide chipset and ext2/3 filesystem support is compiled into the kernel. Also do not edit .config file directly unless you know what you're doing, use menuconfig/xconfig etc since these frontends sorts out dependencies(though not always perfect)
My suggestion is that do a make mrproper, and configure everything from scratch, making sure everything you need is compiled in.

Lastly see if this link is any help.


All times are GMT -5. The time now is 02:28 PM.