LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-07-2003, 01:14 PM   #1
yajnworb
LQ Newbie
 
Registered: Jan 2003
Location: Vancouver, BC
Distribution: RedHat 7.3
Posts: 5

Rep: Reputation: 0
Angry kernel panic / unable to open console... twist


Hi all,

The errors above are pretty common and I've found plenty of info and/or solutions to the problem. The twist is that I have tried a host of possible solutions and nothing has worked.

I have referenced RH docs which describe the rescue process. The catch is that it cannot find the system and fails to mount anything in /mnt/sysimage What I have done is choose 'skip' then mounted them myself. This is how I tried the things listed below.

I am on the verge of reinstalling the system :-( and preserving the important dirs (/home, /var) which would save data and speed the rebuild process. I post here in the hope that someone can point me to a solution I've yet to try as I think this is a case of a confused mapping or similar.

The system: PIII 500, .5 GB RAM, RedHat 7.2 (2.4.18-3 kernel)
It was set up Dec 17 and ran fine until a reboot, then all hell broke loose... this was early yesterday morning.

Me: Know my way around, used linux as desktop for 2 years. First time facing such a problem though, relative newbie re: sysadmin

What I have tried:
// Boot with linux rescue
Edit /etc/fstab
if you have labels like:
LABEL=/ remove this and use the device instead
/dev/hda1

// from another src, run this from grub cmd line
grub> root (hd0,0) <enter>
grub> kernel /vmlinuz root=/dev/hda2 <enter>
grub> boot <enter>

// still another possible
replace /sbin/init with one from the redhat CD, this one is likely corrupted

// when editing the grub entry put single at the end of the line kernel /vmlinuz-2.4.7-1 ro root=/dev/hda2 single

pass the string "init=/dev/hda2/sbin/init" inside of grub.

// boot off install CD using:
linux root=/dev/hda2 ro

// again, in grub editing the entry
// remove this line (or similar)
initrd /initrd-2.4.18-7.img

// still another suggestion
edit /etc/fstab and replace ext3 with ext2

// tried replacing grub with lilo, but when I try running /sbin/lilo it can't find lilo.conf because it's mounted in the rescue shell so /etc is not really the /etc I want.

// yes, I do have /etc/initrd

I respectfully ask for help!!

tia,
Jay B
 
Old 01-07-2003, 01:15 PM   #2
yajnworb
LQ Newbie
 
Registered: Jan 2003
Location: Vancouver, BC
Distribution: RedHat 7.3
Posts: 5

Original Poster
Rep: Reputation: 0
oops, that should read RedHat 7.3... sry

Jay
 
Old 01-07-2003, 01:32 PM   #3
smartes
LQ Newbie
 
Registered: Jan 2003
Location: London, UK
Distribution: Red Hat
Posts: 14

Rep: Reputation: 0
The exact message prior to kernel panic is important.

However you may try adding the kernel options nomce at the end of the kernel line

ex for my kernel:
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi pci=off nomce

or in your case:
kernel /vmlinuz root=/dev/hda2 nomce
nomce - no machine check

Whatever option works you have to edit the grub.conf or lilo.conf file eventually.

Initially boot with the boot disk and at the boot prompt type
Hope you have one

boot: linux nomce rescue

You should be able to logon as root

If you have a list of options you can only try them out on a trial and error basis:

other options are
noisapnp, nodma, nopentium, nobiospnp, noauto, nousb
and so on
 
Old 01-07-2003, 01:35 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
// tried replacing grub with lilo, but when I try running /sbin/lilo it can't find lilo.conf because it's mounted in the rescue shell so /etc is not really the /etc I want.

Boot up from the rescue cd.

/sbin/fsck.ext3

chroot /mnt/<mountpoint> /bin/bash --login

will create a new shell with your linux root partition as pseudo-root. That should help you with lilo.

What makes you think the init is corrupted?
 
Old 01-07-2003, 02:20 PM   #5
yajnworb
LQ Newbie
 
Registered: Jan 2003
Location: Vancouver, BC
Distribution: RedHat 7.3
Posts: 5

Original Poster
Rep: Reputation: 0
Thx for responding.

smartes:
kernel panic: no init found. try passing init= option to kernel
Today, I can only get Warning: unable to open initial console error. I'd have to mess around more to reproduce the kernel panic. I've googled a whole lot lately and tried many things.

Yup, have the boot disk, but the nomce rescue arg did nothing. "unable to open..." error

nxny:
I suspected the init file was corrupt based on one of many solutions I found. Replacing it did nothing.

I think I may have neglected to chroot my mounted dir prior to setting up lilo. Aha... here is how I came to this: http://bugzilla.redhat.com/bugzilla/...?buglist=65207
While the specific hardware is not relevant, it appears it uncovered a bug in pre-2.4.19 kernels.

I'll try again to install lilo.

Thank you for your time. I'll post the resolution when I find one.

Jay
 
Old 01-07-2003, 02:37 PM   #6
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
in 99.99% of the cases I've seen, if the kernel cant find init it is because init is not where someone told the kernel to look for it.

If you're getting kernel panics like these, I'd suggest to keep away from initrd unless you *know* what you're using it for...eg ext3-modules, raid modules etc.
 
Old 01-07-2003, 03:11 PM   #7
yajnworb
LQ Newbie
 
Registered: Jan 2003
Location: Vancouver, BC
Distribution: RedHat 7.3
Posts: 5

Original Poster
Rep: Reputation: 0
Hey nxny,

Believe me, I am not happy about this venture and would far prefer to not be doing this at all. I just set up an old P100 to get into kernel building, etc. and would not choose to do this on a production box.

I have verified (repeatedly) the existence of init and have tried various means to pass its location to the kernel. I do understand this and can easily see how it would be a show-stopper. I don't know wtf I'm supposed to do! Would it make any diff if I put it somewhere else and tried a new path?

There was one post I came across that suggested something like this might be caused by an unsuccessful hack attempt. Does that seem reasonable? I had planned to run chkrootkit once I got it up again.

More fun and games following up the suggestions.

/sbin/fsck.ext3 gave me cmd not found, so I ran e2fsck /dev/hda and got a verbose error:
Couldn't find ext2 superblock, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/hda

It went on talking about a corrupt superblock, if the device actually has ext2 fs. It suggested I run it again and specify a different superblock. I'm really out of my depth here!

I did run e2fsck successfully on /dev/hda2 (after unmounting it), no errors

Moving along... boot up in rescue mode, get chrooted to my /boot partition

/sbin/lilo produces: Fatal: open /dev/hda: No such file or directory
I examine the dev dir and it has only: initctl (red [means broken symlink to me]), null, pts/ & shm/ (dirs are empty) there are no device pointers.

Thanks again,
Jay
 
Old 01-07-2003, 05:04 PM   #8
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
>I have verified (repeatedly) the existence of init and have tried various means to pass its location to the kernel. I do understand this and can easily see how it would be a show-stopper. I don't know wtf I'm supposed to do! Would it make any diff if I put it somewhere else and tried a new path?

From my experience, the primary cause of "init not found" is that the kernel cannot find/mount the root filesystem as specified by the boot loader/command line. Would you post the output( from the rescue prompt ) to /sbin/fdisk -l /dev/hda? That should list your partition table. Also post (outside the chroot shell) cat /proc/mounts

where the hell are your device files?? download the MAKEDEV script that would create the rudimentary character/block devices. Availiable at http://ftp.no.linuxfromscratch.org/l...AKEDEV-1.7.bz2

bunzip2 it, move the unpacked script to as /dev/MAKEDEV and from the /dev directory, run
chmod 744 MAKEDEV && ./MAKEDEV -v generic
 
Old 01-07-2003, 07:41 PM   #9
yajnworb
LQ Newbie
 
Registered: Jan 2003
Location: Vancouver, BC
Distribution: RedHat 7.3
Posts: 5

Original Poster
Rep: Reputation: 0
Ya, the missing device files really threw me too. I could read my partition table fine, mounted any partition I wanted. I decided it was best to re-install so I backed up what was important (mounting all the partitions in rescue mode and dumping to the 2nd HD) and re-installed the entire system. This time I used lilo per the reported grub bug. It's running and I'm back at home where I can complete the apache, etc. remotely.

Ultimately, I decided I had pursued all reasonable solutions to their end. Given that my issue so closely matched so many others yet none of the solutions yielded any results whatsoever, it was time to take a new approach. I also knew that had I simply reinstalled Monday, it would be all over now ;-)

The upside is I know a whole lot more about handling this type of situation than before. I am truly grateful for your assistance. I saved the system logs so I can go back and try to figure out wtf happened. My LogWatch from Sunday reported an ftp login that I didn't recognize. I had been in there Sunday am, then come Monday it was hooped. That precipitated a remote restart then it never came back... I'm rather suspicious of this whole affair, there's just no reasonable explanation.

Anyhow, I'm rambling... live long and prosper:-) This forum rocks!

Jay
 
Old 02-06-2003, 01:27 AM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Posible grub menu.lst solution.

FWIW, I had that same problem. The kernel option was pointing at the wrong partition. I'm on debian (sid) on a 2.4.21-pre3 kernel at the moment.

title Debian GNU/Linux, kernel 2.4.21-pre3
root (hd0,1)
#--- the next line had the wrong partition -- root=/dev/hda1
kernel /boot/vmlinuz-2.4.21-pre3 root=/dev/hda2 ro
savedefault
boot

HTH

Shadow_7
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel 2.4 in Zipslack (Waring: unable to open an initial console | Kernel Panic...) kurtamos Linux - General 2 05-10-2006 12:58 PM
Warning: unable to open an initial console, kernel panic aso blish_blash Linux - General 16 10-31-2004 03:45 PM
Kernel Panic - VFS unable to open root device JcB Slackware 17 10-30-2004 11:27 AM
kernel compile ----unable to open console masand Linux - General 3 04-17-2004 10:20 AM
Kernel 2.6.0-test11 unable to open initial console graemec Debian 4 01-28-2004 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:07 AM.

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