Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94
Rep:
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.
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.
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94
Original Poster
Rep:
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.
/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!
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94
Original Poster
Rep:
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.
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.