PDA

View Full Version : Knoppix as Rescue - Fixing the MBR



ChivalricRonin
04-12-2004, 05:16 PM
Hello all, I recently got myself into a scrape with a debian installation. Suffice it to say, I cannot boot into either winxp or debian anymore due to the WinXP rescue console's FIXMBR command. So I've loaded up knoppix...

Recently a similar thing happened to a friend and he used some varient of fdisk /mbr (THAT command does not work) in knoppix under root term to fix the MBR so that he could boot back into windows.

I would REALLY appreciate it if anyone could tell me the command to fix/write a new MBR. Thanks

Stephen
04-12-2004, 08:02 PM
Hello all, I recently got myself into a scrape with a debian installation. Suffice it to say, I cannot boot into either winxp or debian anymore due to the WinXP rescue console's FIXMBR command. So I've loaded up knoppix...

Recently a similar thing happened to a friend and he used some varient of fdisk /mbr (THAT command does not work) in knoppix under root term to fix the MBR so that he could boot back into windows.

I would REALLY appreciate it if anyone could tell me the command to fix/write a new MBR. Thanks

Boot with the Knoppix CD using knoppix 2 then.


mount /dev/hd?? /mnt/hd??
chroot /mnt/hd??/ /sbin/lilo -v
shutdown -r now


Replace the ?? with the partition number and drive letter of the / partition. When you chroot (change root) and write lilo to the disk it will use the same configuration that was working before if you want to make any changes you should do so before the chroot command.

ChivalricRonin
04-13-2004, 02:11 PM
I was using Grub before as a bootloader, not Lilo. Will that impact anything? Also, I managed to get into windows by semi-reinstalling debian and editing the menu.lst of grub, but after deleting the partition I just get error 22 from Grub.

To recap...

I now have one partition that is NTFS, and a whole bunch of freespace. A Broken GRUB is in my MBR. Is there a method that I could like write a clean MBR of all zeros or something, so that I could boot to my WinXP recovery disk, and have it FIXMBR and write a new bootloader? At this point I'm not interested in reinstalling linux. Thanks!

EDIT: GOT IT! It turns out FIXMBR will work, but only if any linux partitions have been completely deleted.