LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   power failure corrupted parition (https://www.linuxquestions.org/questions/linux-general-1/power-failure-corrupted-parition-244320/)

nifflerX 10-18-2004 04:11 PM

power failure corrupted parition
 
Hi,

I've got a Red Hat Enterprise v3 running and all was well until a power failure occurred. The machine tried to restart and hung while the kernel was loading. I rebooted and everything seemed to come up fine. After a while the machine rebooted on its own again, and again hung during boot up. This time when I manually rebooted the machine did not come back up but gave the error message:

Kernel panic: No init found. Try passing init= option to kernel

I tried booting off of the other kernels installed on the machine, but all failed at this point.

I booted off the linux installation disk, but when I booted into linux recovery mode, I was told that no linux installations could be found. I can do fdisk -l and get output which looks all right. Also, when I booted off the installation disk I was able to see the hard drive partitions under "Manually define disk partitions using Disk Druid".

As a last resort I tried adding 'init=/dev/hda1' and 'init=/dev/hda5' to my kernel command when my machine booted up without a CD, both failed at the same point.

I think I've solved the power supply problem (I think it was a faulty power cord). However, now I'm stuck with a machine that can't boot. Is there some way for me to try and repair my partitions and get my data off without doing a complete wipe and install? Thanks so much.


-NifflerX

avarus 10-18-2004 05:54 PM

Hi,

Time to abandon the pointy-clicky tools and embrace the command line then..

When the kernel boots, it first mounts the root partition. You seem to think that this is either /dev/hda1 or /dev/hda5, which seems sensible (or does RHE3 use labels??). You need to try and see from the bootup logs if the kernel succeeds in this - you may need to use Shift+PgUp to scroll the screen. The kernel parameter 'root=' tell the kernel what to mount.

If root is mounted, the kernel then wants to execute /sbin/init. So from your recovery disc get a command line and try these things:

fsck /dev/hda1 #fsck checks for and hopefully fixes errors

mkdir /mnt/root
mount /dev/hda1 /mnt/root
ls -L /mnt/root/sbin

If 'init' really is missing you need to replace it. I'll let a RedHat expert suggest where to get a copy, but it seems likely there will be more stuff missing or damaged.

Hope this gives you a starting point.

TIM

SlipAway172 10-18-2004 07:31 PM

thanx ive had the SAME problem with mandrakel and smoothwall . so now i dont have to reinstall mandrake. HAHAHAH. now time to write down the commands

nifflerX 10-19-2004 09:38 AM

Thanks for the ideas. As it turns out I didn't fix my power supply issue as well as I thought. The fact that my machine keeps randomly restarting as I'm working on it convinced me of this.

I was able to run fsck on one of the partitions and I got the following:

fsck /dev/hda
...
Couldn't find ext2 Superblock, trying backup blocks...
Bad magic number in Super-block while trying to open /dev/hda

In any case I'll try to solve the power issue before I work on this again. Thanks for the help, and if you have any other thoughts on what I might try, I'm all ears.

-NifflerX

avarus 10-19-2004 05:50 PM

One observation:

/dev/hda represents the actual disk, with a partition table and the like
/dev/hda1 (2,3) represents a disk partition, conceptually a big data bucket, onto which one generally maps a file system

In other words, fsck /dev/hda will never work. You should fsck /dev/hda1 (or /dev/hda2 etc).

Side note:
On some hard drives it is possible to make a file system on the disk itself. Your drive works a bit then breaks horribly!

TIM

nifflerX 10-20-2004 01:29 PM

Thanks for the heads up on fsck. I'll run it again as soon as I get the chance. Unfortunately my power supply issue has morphed into a motherboard issue, and the motherboard is pretty old. Hopefully I'll be able to fix this all and report back before this thread gets too obsolete. Thanks for all the help.


-NifflerX

nifflerX 10-21-2004 11:08 AM

Hi,

So I was finally able to get the the machine to boot up off of the rescue CD in a stable environment and it appears as though my / partition is gone! I can mount /dev/hda1, 2,3, etc. and they all appear to have my different partitions in them, except than none of them correspond to the / partition. And, when I mount /dev/hda5, where I think the / partition is located, I just get an empty folder. Is there anyway for me to get a / partition back on this hard drive? Or should I try and mount my home partition, get all my data off and reformat the drive? Thanks so much.

Just as an update I got all of my data off of the the drive for precautionary measures. Is there any advantage to trying to just install the / partition, rather than reinstalling the entire operatering system? Thanks again.


-NifflerX


All times are GMT -5. The time now is 12:56 PM.