Today I had the unfortunate experience of having my Linux-based router crash. The hard drive was actually fine, but the southbridge on my old P4-based system apparently was the problem. I had an AMD Athlon 3500+ system laying around not doing much, so decided it would be extremely simple to swap the HDD from the Intel system to the AMD system... and it was, until I powered the thing on and expected to be greeted with my "root" login prompt.
At first the system booted normally, showing the CentOS GRUB bootloader screen, the boot continued for a good 15-20 seconds or so and then all the sudden the system halted, and said it was unable to find any Logical Volumes. After lots of searching around on the Internet, I couldn't come up with a good step-by-step guide on how to recover from this - just bits of information that vaguely said what should be done. So here is my guide on how to recover:
1. If you don't already have a Linux rescue disk, get one. Generally, the best bet is to go to the main website of whatever distribution of Linux you're running and either look for a rescue CD ISO image, or, in my case for CentOS - disk 1 of the installation set. Burn it to CD/DVD.
2. Boot from the rescue disk. At the boot prompt, type:
linux rescue
3. Answer any prompts (keyboard type, language, whether or not to initialize network, in my case).
4. chroot /mnt/sysimage
5. cd /boot
6. Determine the most recent initrd image you have. "ls -lat initrd*" will list them in date order with the newest at top. In my example, I'll be using "initrd-2.6.18-194.11.3.el5.img"
7. Make a backup copy of the most recent initrd image - note that due to the blog format some line wrapping may occur, everything should be on one line.
cp initrd-2.6.18-194.11.3.el5.img
initrd-2.6.18-194.11.3.el5.img-original
8. Now you will create the new initrd image. Notice the last parameter is just everything between "initrd-" and ".img" (again, everything should be on one line):
mkinitrd -f -v /boot/initrd-2.6.18-194.11.3.el5.img
2.6.18-194.11.3.el5
9. That's it, reboot. The reboot command on my system failed to complete, so I just manually did a "umount" on all mounted file systems (type "mount" to determine this list), and hit the reset button.
Thursday, September 16, 2010
Subscribe to:
Comments (Atom)