LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-17-2003, 05:39 PM   #1
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Rep: Reputation: 0
Wierd kernel panic


Good evening gentlemen,

I have a query for those of you who are proficient with Linux Redhat 8.

The following occurs after i've pressed b in grub to load up the latest kernel (.26 i believe).


error trying to mount root filesystem
Kernel Panic
try passing init=

yes yes, i understand there are thousands of posts here all under the same circumstances.

What makes this case interesting is that i ran the recovery CD, while detecting the installation it came up with an error (notably "cannot mount /mnt/sysimage/ from /dev/hda5"), then promptly told me i had no installation on the harddisk
(To believe this would be extremely niave)

I got into the recovery prompt and ran the following (without my file system mounted) fsck -y /dev/hda5 to which i got a lovely welcomed sight of lots of repairs going on.

I once more tried booting, this time i got a slighly different response from the machine :-

init not found

kernel panic

try passing init=



So i went back into recovery and successfully mounted my /dev/hda5

this is where it gets INTERESTING (or not depending on how much you know about linux) :-

it mounted the filesystem very nicely to my /mnt/temp folder

however half of the files were missing from my /etc directory (fstab for instance)

So i took a look at the lost+found directory and there are a few hundred files there all named with LOTS of numbers all preceded by a HASH (i.e #)

could you guys please explain to me how to recover these files ? (if this is the correct course of action)

if not then please explain how i could go about recovering my filesystem.

My level of understanding of linux is minimal - such to say i understand my boot fs is off /dev/hda1 i think

and i use a GRUB loader to load my kernel up

Im using REDHAT 8 with the latest up2date

ahh yes, i was not doing anything with the machine prior to crash.
 
Old 03-18-2003, 12:16 AM   #2
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Re: Wierd kernel panic

Quote:
Originally posted by hiren_a
Good evening gentlemen,

I have a query for those of you who are proficient with Linux Redhat 8.

The following occurs after i've pressed b in grub to load up the latest kernel (.26 i believe).


error trying to mount root filesystem
Kernel Panic
try passing init=

yes yes, i understand there are thousands of posts here all under the same circumstances.

What makes this case interesting is that i ran the recovery CD, while detecting the installation it came up with an error (notably "cannot mount /mnt/sysimage/ from /dev/hda5"), then promptly told me i had no installation on the harddisk
(To believe this would be extremely niave)

I got into the recovery prompt and ran the following (without my file system mounted) fsck -y /dev/hda5 to which i got a lovely welcomed sight of lots of repairs going on.

I once more tried booting, this time i got a slighly different response from the machine :-

init not found

kernel panic

try passing init=



So i went back into recovery and successfully mounted my /dev/hda5

this is where it gets INTERESTING (or not depending on how much you know about linux) :-

it mounted the filesystem very nicely to my /mnt/temp folder

however half of the files were missing from my /etc directory (fstab for instance)

So i took a look at the lost+found directory and there are a few hundred files there all named with LOTS of numbers all preceded by a HASH (i.e #)

could you guys please explain to me how to recover these files ? (if this is the correct course of action)

if not then please explain how i could go about recovering my filesystem.

My level of understanding of linux is minimal - such to say i understand my boot fs is off /dev/hda1 i think

and i use a GRUB loader to load my kernel up

Im using REDHAT 8 with the latest up2date

ahh yes, i was not doing anything with the machine prior to crash.
i had similiar problem while using jfs as the root partition in my mandrake linux distribution
after you use fsck you cannot go back to your previous state
so there are two ways of solving your problem
manually add the fstab ,inittab
(provided your rc.sysinit and rc.d,init.d are intact)
or browse through each individual file in your lost+found directory
i preferred the former and came up with a working system again
if you have money to spare there is a utility called
r-linux which recovers most files (from windows)
http://www.r-tt.com/RLinux.shtml
though you can individually search each sector too(if you can do it)
to recover your files
keep posted

Last edited by rch; 03-18-2003 at 12:18 AM.
 
Old 03-18-2003, 02:02 AM   #3
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
Thankyou kindly,

I will not attempt to use the r-linux program to recover my files. I have a spare windoze machine lying around in the shed.

Hopefully this program will restore the files for me.
 
Old 03-18-2003, 08:00 AM   #4
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
Hopefully this program will restore the files for me.
you are talking about which program?
 
Old 03-19-2003, 02:06 AM   #5
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
Thankyou kindly for your expertise,

Non of the utilities above worked, so ended up having to reinstall.

I'm wondering if there is any way to create an image of the ENTIRE harddisk once its set up so that if a crash occurs again, i can transfer the image to the drive and maintain all my backed up settings.
 
Old 03-19-2003, 11:59 PM   #6
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
Originally posted by hiren_a
Thankyou kindly for your expertise,

Non of the utilities above worked, so ended up having to reinstall.

I'm wondering if there is any way to create an image of the ENTIRE harddisk once its set up so that if a crash occurs again, i can transfer the image to the drive and maintain all my backed up settings.
do you want to backup your data
here is a howto
http://tldp.org/REF/INTRO/Backup-INTRO/index.html
or you can make a image of your partition with a utility called
partimage
http://www.desktop-linux.net/partimage.htm
or you want to do it manually
just bzip and tar your your whole partition
and back it up somewhere else
keep posted
 
Old 03-20-2003, 04:04 AM   #7
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
Hello again, im wondering if this is acceptable:-

I'm runnig a squiddy proxy server and i use webmin to administer it.

It has some backup facilities built into it. I currently have 7 ibm 120 gig disks in the machine on raid and backed my

/
/usr
/var
/boot

to appriopriate files on my raid.

I also found that when my computer initially crashed, it was the /swap partition that became corrupted. Do i have to backup the swap partition? If so how. Or are the steps to backup i've already taken sufficient.

Webmin uses dump and restore (i checked the manual)
 
Old 03-20-2003, 11:46 PM   #8
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
Originally posted by hiren_a
Hello again, im wondering if this is acceptable:-

I'm runnig a squiddy proxy server and i use webmin to administer it.

It has some backup facilities built into it. I currently have 7 ibm 120 gig disks in the machine on raid and backed my

/
/usr
/var
/boot

to appriopriate files on my raid.

I also found that when my computer initially crashed, it was the /swap partition that became corrupted. Do i have to backup the swap partition? If so how. Or are the steps to backup i've already taken sufficient.

Webmin uses dump and restore (i checked the manual)
well you should not back your swap partition
swap means the swap usued in memory management of the operating system
(ie it is a partition where pages of memory are stored in a multiprogramming os like linux when they are not in physical memory)
so if the swap becomes corrupted
just delete it
(initially i don't think swap can be corrupted -becoz when the os boots it adds the swap and the content is cleared)
keep posted
 
Old 03-21-2003, 02:05 AM   #9
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
I dont think the data got corrupted, its the partition. It kept telling me bad superblock number and that there was something wrong with the magic number.

Maybe i should hire a sourcerer.
 
Old 03-21-2003, 05:12 AM   #10
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
Originally posted by hiren_a
I dont think the data got corrupted, its the partition. It kept telling me bad superblock number and that there was something wrong with the magic number.

Maybe i should hire a sourcerer.
give the content of the command
fdisk -l
and the file
/etc/fstab
then i could try
 
Old 03-21-2003, 05:35 AM   #11
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
STOP. Please.

I've had experience of this and believe me, if you don't know what you're doing you can easily make a mess of a fs (and I should know!)

Grub is looking for the init program - you know ... the one to change runlevels, usually located in /sbin/init.

If you try to mount the fs using a recovery CD or floppy, you won't be able to run init. All you needed to do actully was append init=/dev/hdax where x is the location of your root partition (not the boot partition).

People get confused because grub doesn't recognise this boot option, but this boot option is not for grub - it's for the kernel.

So next time just append init=/dev/hdax and save youself a lot of time and trouble.

Q*Bert
 
Old 03-21-2003, 07:15 AM   #12
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
right i'd just like to remind you guys that im a complete newbie to linux.

I am completely confused by rch's last post and Q*berts post while i understand he is telling me not to do what rch has said i'm lost by what is says after the (and i should know!) comment.

really sorry for being so ignorant, but we all have to start somewhere .
 
Old 03-21-2003, 09:26 AM   #13
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
Originally posted by hiren_a
right i'd just like to remind you guys that im a complete newbie to linux.

I am completely confused by rch's last post and Q*berts post while i understand he is telling me not to do what rch has said i'm lost by what is says after the (and i should know!) comment.

really sorry for being so ignorant, but we all have to start somewhere .
well i have to say nothing about Q*bert as apparently he did not understood the problem
i was talking about your swap partition
and i was wondering whether it has been swapon'ed' properly
so i asked you to give the output of
fdisk -l(from command line)
and the content of /etc/fstab
anyway
if you can't do that
just give the output of the commands
cat /proc/partitions
and
cat /proc/swap

Last edited by rch; 03-21-2003 at 09:28 AM.
 
Old 03-21-2003, 10:00 AM   #14
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
fdisk -l

Disk /dev/hde: 255 heads, 63 sectors, 15017 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hde1 * 1 15017 120624021 c Win95 FAT32 (LBA)

Disk /dev/hda: 255 heads, 63 sectors, 1216 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 680 5357677+ 83 Linux
/dev/hda3 681 924 1959930 83 Linux
/dev/hda4 925 1216 2345490 5 Extended
/dev/hda5 925 989 522081 83 Linux
/dev/hda6 990 1086 779121 82 Linux swap
/dev/hda7 1087 1216 1044193+ 83 Linux

Disk /dev/hdb: 255 heads, 63 sectors, 19929 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 2 19929 160071660 f Win95 Ext'd (LBA)
/dev/hdb2 * 1 1 8001 1 FAT12
/dev/hdb5 2 19929 160071628+ b Win95 FAT32

Partition table entries are not in disk order

and /etc/fstab i've editted

btw my SWAP is now ok, the system is running, i just want to know how to repair the swap partition if it happens again, i cannot afford to keep reinstalling linux.

cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/hda6 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hdb5 /fileserver auto defaults,rw 0 0
/dev/hde1 /fileserver2 auto defaults 0 0
 
Old 03-21-2003, 11:07 AM   #15
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
Quote:
Originally posted by rch
well i have to say nothing about Q*bert as apparently he did not understood the problem
Nope. The problem is that I understod the problem all too well, because I've been here before.

The recovery CD tries to mount the sysimage so that you can repair it, only because of a bug in the installer for RH8.0 it will remount and write to it and abort (just like if you try to do a dummy run upgrade which also won't work).

What I'm saying is you're fs is borked if you do a hard reboot a few times after getting this init message.
Quote:
Originally posted by hiren_a
btw my SWAP is now ok, the system is running, i just want to know how to repair the swap partition if it happens again, i cannot afford to keep reinstalling linux.
Append init=/dev/hdx where x is the root partition (where the sbin directory is) and you'll never see this nightmare again.


Q*Bert
 
  


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
Wierd happenings after Kernel Compile on Fedora claudius753 Linux - Software 3 12-31-2004 11:24 PM
Kernel panic puts me in a panic theeeg Linux - Software 2 07-31-2004 04:46 PM
ALSA, KDE 3.2, Kernel 2.6 and a wierd problem cccc828 Slackware 2 03-05-2004 07:21 AM
kernel panic (narius panic) narius Linux - Newbie 3 06-20-2002 03:56 PM
Kernel panic making me panic! Linux_N0oby Linux - Software 19 05-29-2002 12:31 AM

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

All times are GMT -5. The time now is 11:58 PM.

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