CentOS: MBR corrupted (Error 15)

R

red

Guest
My MBR became corrupted. I put in the install CD and ran the linux rescue to restore it grub-install etc... Now I get this error when I boot up:

Booting 'CentOS (2.6.18-194.el5xen)'

root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
kernel /boot/xen.gz-2.6. 18-194.el5

I was told that this could be because files were moved, or renamed? How do I solve this without doing a complete reinstall? CentOS is the only OS. I did not try to get partition information. I do know that /boot lives on hda1. From what I can tell, I think everything is there.

I made a backup CD of my /boot directory and put it on a CD as a .iso using mkisofs. How do I get the /boot.iso on my system to replace the one that's messed up?
 


Hey red - welcome to Linux Forum!

I would start by booting off the rescue cd or a live cd, mount hda1 and see what's on there.

You could then pop in the cd if you want and see if you can copy the files you need into the boot directory..

Let us know how it goes - it's been a while since I had to repair a boot problem..
 
try to see the kernel lines in your menu.lst, it seem like it didn't found the file xen.gz-2.6. 18-194.el5
you need to edit Grub Boot Parameters to see it. Go to the grub command line by pressing "e" when booting options were flash on screen or you can simply boot a live CD to edit it.
 
Would I just mount the .iso CD and cp the files over to /boot?

enhu - I was told that to check menu.lst as well, I'll see what I can do with that.

Thanks for the help so far, this is by far one of the more friendly Linux communities I've found.
 
Also, how do I load the CD with /boot backup on it if I need to use the LiveCD in order to boot my computer?
 
red,
i have another "standard" path to suggest you. If your boot directory is ok on your hda1 you can chroot it and grub-install from the resulting /boot/grub:

start with a live distro, and opening a shell:

Code:
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1
mount -t proc none /mnt/hda1/proc
mount --rbind /dev /mnt/hda1/dev
chroot /mnt/hda1 /bin/bash
source /etc/profile

#now you can:
cd /boot/grub

#verify menu.lst or grub.cfg. after that:
grub-install /dev/hda

#if success you can exit from chrooted fs on hda1:
exit
reboot

hoping this helps :)
 
red,
i have another "standard" path to suggest you. If your boot directory is ok on your hda1 you can chroot it and grub-install from the resulting /boot/grub:

start with a live distro, and opening a shell:

Code:
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1
mount -t proc none /mnt/hda1/proc
mount --rbind /dev /mnt/hda1/dev
chroot /mnt/hda1 /bin/bash
source /etc/profile

#now you can:
cd /boot/grub

#verify menu.lst or grub.cfg. after that:
grub-install /dev/hda

#if success you can exit from chrooted fs on hda1:
exit
reboot

hoping this helps :)

I tried that, as it turns out both menu.lst and grub.conf are missing. All I get now is a Kernel panic- not syncing: VFS: unable to mount root FS on (3,1) /boot was on hda1 and grub.conf had (hd0,0) originally.
 
.... root FS on (3,1) /boot was on hda1 and grub.conf had (hd0,0) originally.
Have you changed anything on BIOS? "(3,1)" is very strange. in any case, if you did the /boot backup, you can try to restore the entire directory while /dev/hda1 is mounted on /mnt/hda1 and try to do grub-install after that (while in chroot).

EDIT: If that does not work, i suggest you to backup your relevant data, and reinstall. With a live CD you can mount the data partition and backup the data inside. i suggest you to do a simple partition like this (unless you have other special needings):

hda1: /boot
hda2: swap
hda3: /
hda4: /home

in this case you can easily have a complete independent partitions set. And remember: only if the hardware is physically broken is near impossible to save data inside! If the partition is mountable in some manner you are (closely) safe :eek:

Let me know.
 
Have you changed anything on BIOS? "(3,1)" is very strange. in any case, if you did the /boot backup, you can try to restore the entire directory while /dev/hda1 is mounted on /mnt/hda1 and try to do grub-install after that (while in chroot).

EDIT: If that does not work, i suggest you to backup your relevant data, and reinstall. With a live CD you can mount the data partition and backup the data inside. i suggest you to do a simple partition like this (unless you have other special needings):

hda1: /boot
hda2: swap
hda3: /
hda4: /home

in this case you can easily have a complete independent partitions set. And remember: only if the hardware is physically broken is near impossible to save data inside! If the partition is mountable in some manner you are (closely) safe :eek:

Let me know.

I think it is at the point that I am just going to have to reinstall, I tried doing the chroot /mnt/sysimage grub-install.
Thanks for the help though, it was really appreciated. Considering it's the end of the week, I pretty much have no other choice but to rebuild.
 

Staff online

Members online


Latest posts

Top