LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Kernel Panic: can't mount root fs (https://www.linuxquestions.org/questions/linux-software-2/kernel-panic-cant-mount-root-fs-121311/)

gtanghookup 11-30-2003 01:59 PM

Kernel Panic: can't mount root fs
 
Hello, I have recently installed Gentoo Linux on one of my computers. Everything worked without a hitch until yesterday. I was in the middle of an X-Windows session when my speakers began to ping, reaching down to adjust the sound cable I interrupted the power source of the computer by pulling the power cable. The machine turned off. I then said 'shit' and turned the computer back on. It booted with a good amount of error messages. I was able to login, however now all of my commands had gone missing, any command ls, cd, etc seemed to have not been found once entered at the command prompt. I then reset to see if it was just a temporary problem. After rebooting I found that there is now a kernel panic
is_tree_node: node level does not match to the expected one 1
vs-5150: search_by_key: invalid format found in block 8211. Fsck?
vs-13070: reiserfs_read_inode2: i/0 failure occurred trying to find stat data of [1 2 0x0 SD]
VFS: Cannot open root device "hda3" or 03:03
Please append a correct "root=" boot option
and finally...
kernel panice: VFS: Unable to mount root fs on 03:03

My assumption is that during the power interruption, a few sectors on my hardrive could have been corrupted. I have never run into a problem as this. I am wondering if there is a way to fix this. I can obviously still use grub, is there a way in which I may use grub to remedy the situation? Should I prepare myself to learn again by installing Gentoo? Thank you for your help good kind sirs/siresses.
:scratch:

jailbait 11-30-2003 02:56 PM

" I am wondering if there is a way to fix this."

Boot a rescue CD. Then use fsck against each of your hard disk partitions:
fsck /dev/hda1
.
.
.
Then boot Red Hat again. Anything that is still missing is lost. You can restore what you have lost from backup or by reinstalling individual rpms. If what is missing is a very big mess then save as much of you data as you can and reinstall.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

gtanghookup 11-30-2003 07:38 PM

Thank you jailbait
 
Thanks for the help, I was able to do just your suggestion. Do you have any clue as to what demons could have gotten inside of my computer and ruffed up my hardrive? Thanks again

jailbait 11-30-2003 08:10 PM

"Do you have any clue as to what demons could have gotten inside of my computer and ruffed up my hardrive?"

Linux uses a disk cache to speed up access to your hard drives. When you power off abruptly then there are buffers in the cache that do not get written out to the hard drive and so the data on the hard drive is mangled. Normal the cache is all written out during normal shutdown.

There is some redundency in the information on the hard drive so fsck figures out the mess as best it can and puts everything back in place. fsck is remarkable successful. But fsck may find files or file fragments which it cannot figure out where they belong. It will put these files in a directory called lost+found. There is one lost+found on each of your partitions. You should look in all of your lost+found directories and see if fsck left any orphans there.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

gtanghookup 11-30-2003 08:27 PM

entire hardrive is in lost+found
 
After performing a fsck on my root drive, I tried booting. The kernel or whatever tries to mount the root partition was sucessful, however it needed an init= option to be given to the kernel. I tried /sbin/bash, this did not seem to work, however this is undiscovered territory for me. Anyhow, I then booted my system with a CD using the Gentoo boot install disk, which takes me to a command prompt contained on the CD. I then proceeded to mount my hardrive and have found that the only directory on the drive is the lost+found directory. Does this mean that fsck did not know what to do with anything on my hardrive? Is there anyway to recover the information? Thank you again for your help

jailbait 11-30-2003 09:59 PM

After reading your post I have the impression that you have /boot on a partition and that /boot is OK. You also have a root partition on /dev/hda3 and the only thing you can find in the root partition is lost+found.

When fsck examines a damaged partition if there is no lost+found directory then fsck will create one. Look at the creation date on lost+found to determine if lost+found was created when you installed Linux or if it was created by fsck. fsck cross checks your file sytem five different ways and tries to figure out what everything is and where it belongs. Things that fsck finds but does not know where they belong are given a number and placed in lost+found. If fsck put anything in lost+found it will be a file with a number for a name. You have to figure out what it is by examining its contents and either moving the numbered file to where it belongs or otherwise recreating that file.

If there are no files on the root partition, lost+found is empty, and lost+found was created by fsck then that means that fsck found a completely empty partition. The only way that I can see that happening from a power failure is if the partition table was clobbered.

Another possibility is that you may have your partition numbers mixed up and be working on recovering the swap partition instead of the root partition. Do you have a swap partition on /dev/hda2?

"Is there anyway to recover the information? "
If fsck cannot find your data then the data is lost.

But I would like to emphasize that a power failure causing a partition to completely disappear without leaving even a few fragments for fsck to find is very unlikely. So you should triple check /dev/hda3 (or wherever your root partition is) before you declare your system dead.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

gtanghookup 12-01-2003 03:13 PM

INIT: cannot execute "/sbin/rc"
 
The lost+found directory was created by fsck, the date is set to yesterday (the day I ran fsck)
I have now moved all the directories with items which I knew their proper location. Which are the important directories:
/sbin, /bin, /etc, /lib, /dev, /mnt, /usr, and /home
(still in the lost+found directory are many lost files, mostly executables, 3 directories and some others)
It seems the important files within the known directories are still intact. I don't believe that my problem involves any of the many executables in lost+found. My problem is that when I boot I get this message:

INIT: version 2.84 booting
INIT: cannot execute "/sbin/rc"
INIT: cannot execute "/sbin/rc"
INIT: Entering runlevel: 3
INIT: cannot execute "/sbin/rc"

Seeing this I think that the problem is with the /sbin/rc binary file, I check for it to see if it exists, it does. I then check to see if it is executable, and it is. Performing a 'ls -l /sbin/rc' reveals this:
-rwxr-xr-x 1 root root 16372 Nov 8 20:30 rc

To me this looks in order, however INIT seems to not be able to execute this program. I do not know why... I have renamed the numbered folder that contained the files native to sbin "sbin" and placed it in the root directory. I ran the rc file that was on the hardrive in the /sbin directory using my boot CD to get to a command prompt to make sure it is not curupt, and it ran(not doing anything worthwhile). I am totally lost on this one, any help would leave me with a smile as I slip into slumber this eve.

jailbait 12-01-2003 07:29 PM

"INIT: cannot execute "/sbin/rc""
Not only must rc have the correct permissions but so must every directory above it in the tree. Check to make sure that /sbin has permissions of 755.

Another, gloomier possibility is that /sbin/rc is only a fragment of the original file, which means that you will have to restore the file from someplace else.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

gtanghookup 12-01-2003 08:57 PM

Well, I'm out of ideas
 
I chmod 755'ed /sbin, / and made sure that rc had permissions 755. This gave me the same error, so I tried placing the simple rc file from my Gentoo CD in the /sbin directory, saving a backup copy of the old rc file. The same error occurs again. What does this sound like? It seems that /sbin/rc should be able to be executed since the disk is mounted and the file is intact and in the proper location. I am using reiserFS if that makes any difference. Any ideas? Or should I begin the journey installing Gentoo again? Thanks for your help

jailbait 12-01-2003 09:57 PM

" I am using reiserFS if that makes any difference."

Perhaps your rescue system and your desktop system disagree on what type of file system is mounted on /dev/hda3. Presumably your desktop system is getting the file type from /etc/fstab and presumably /etc/fstab says that /dev/hda3 is reiserfs.

When you mount /dev/hda3 from your rescue system are you specifying a file system type, i.e. are you using something like:
mkdir /checkitout
mount -t reiserfs /dev/hda3 /checkitout

or are you using something like:
mkdir /checkitout
mount /dev/hda3 /checkitout

If you are not specifying -t then you are mounting it as ext2. Whatever you are mounting it as is working.

Back when you first ran fsck against /dev/hda3 I did not think to have you run fsck.reiserfs. fsck is actually a front end for a whole lot of file system type dependent programs. The main fsck identifies the file system type from either the command name or by examining the file system. Suppose that the reiserfs file system was so corrupt that fsck did not recognize what it was and chose the default, ext2. Then it rebuilt an ext2 file system which it thought was completely scrambled because it was actually a reiserfs.

This is a whole lot of speculation on my part but it is easy to test. If you are mounting /dev/hda3 as ext2 on the rescue CD then try changing /etc/fstab to make /dev/hda3 ext2 and see what happens. This idea is somewhat farfetched but I am fast running out of reasonable guesses.

And yes, whenever you are completely stumped then use the rescue CD to back up whatever data you want to save and then reinstall Gentoo.
___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

gtanghookup 12-03-2003 05:14 PM

Thank you for all of your help
 
Thanks jailbait, I have decided to just make life simple and reinstall, this is my backup computer anyways. Hope I have better luck next time there's a power interuption!!!:cry:


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