Author Topic: kernel + init  (Read 1293 times)

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
kernel + init
« on: 19 October 2002, 16:47 »
I just compiled a new (well only 2.4.18) kernel and it seem to be booting fine until it cant find init. It suggested to pass init= to the kernel. So I added init=/sbin/init to my grub file but I had the same problem again.
I think I have done the init= bit wrong.
using RH8.0
Contains scenes of mild peril.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
kernel + init
« Reply #1 on: 19 October 2002, 20:09 »
Actually you shouldn't need the "init=" line. What you most likely have wrong is you don't have the boot (/boot) or root (/) partitions right. On my setup I have this:

Code: [Select]

The "root (hd0,2)" is actually the partition where the kernel and boot loader reside and happens to be my "/boot" partition on /dev/hda3 which = (hd0,2).  That tells grub where the kernel is. The kernel is passed parameters to know where the root (/) partition is "root=LABEL=/". In my case I have my file system on "/dev/hda7" labeled "/" so the kernel knows that the file system labeled "/" is to become the root file system. I could also have used "root=/dev/hda7" and it should work.  You can check the label of the filesystem by typing "/sbin/tune2fs -l /dev/hda7 | grep volume".

So to summarize, use the "root (hdx,x)" in grub.conf to specify the partition that your "/boot" directory resides. Then pass the location of your root (/) partition to the kernel as a parameter.

[ October 19, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
kernel + init
« Reply #2 on: 19 October 2002, 20:10 »
ummm.... dont you have to set
init=/boot/initrd (or just the /initrd if grub is using boot as root (if you have boot on a separate partition)).
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
kernel + init
« Reply #3 on: 19 October 2002, 20:11 »
damn you void main!!!  
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
kernel + init
« Reply #4 on: 19 October 2002, 20:25 »
I just edited my message (the original reply to the first message) because I originally had it horribly wrong. It should be accurate now. And you only need the "initrd" line if in fact you use an "initrd" file. It usually isn't necessary unless you have SCSI drives.

[ October 19, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
kernel + init
« Reply #5 on: 19 October 2002, 20:39 »
so... I was right.... cool (reminds me of all the times i gave people directions even though i didnt know where they were going)

[ October 19, 2002: Message edited by: The Master of Reality / Bob ]

Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
kernel + init
« Reply #6 on: 19 October 2002, 21:16 »
my GRUB file reads:

title Red Hat Linux (2.4.18)
        root (hd0,2)
        kernel /vmlinuz-2.4.18 ro root=LABEL=/ hdb=ide-scsi
        initrd /initrd-2.4.18.img

Which *should* be right, unfortunately it still complains.
Contains scenes of mild peril.

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
kernel + init
« Reply #7 on: 19 October 2002, 21:25 »
quote:
Originally posted by Tux:
kernel /vmlinuz-2.4.18 ro root=LABEL=/ hdb=ide-scsi

that bolded part isnt correct (is it?)
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
kernel + init
« Reply #8 on: 19 October 2002, 21:56 »
That should be correct as long as his root file system is "labeled" as "/" and you don't have more than one file system labeled as "/". You have to use the tunefs command to see the label as I mentioned. Is the name of the kernel correct and reside in /boot?

Otherwise try changing the "root=LABEL=/" to "root=/dev/hda?" depending on which parition contains your root file system.

Also, make sure your /etc/fstab file is correct which shouldn't come into account until the kernel remounts the root file system for rw.

[ October 19, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
kernel + init
« Reply #9 on: 19 October 2002, 21:56 »
It wouldnt be on any other distro, but redhat is wacky....
Contains scenes of mild peril.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
kernel + init
« Reply #10 on: 19 October 2002, 21:59 »
Well there are advantages to using LABEL rather than the device path. Have you tried using the device path? Either way should work.
Someone please remove this account. Thanks...