Fix MBR with Ubuntu Live CD


Recommended Posts

I have seen the other thread about MBR but it wasnt of much help. What happened is, my GRUB is giving me error 22, and doesnt boot anymore.

I want to fix the MBR and boot to Windows again, I cannot afford to format the disk from scrach.

The problem is, I have no floppy drive, and only the Ubuntu Live CD. I can't use the Recovery console with a Windows XP CD because I *forgot* the admin password.

Please, if there is any way to fix Grub, or just the MBR to boot straight to Windows, using only the Ubuntu live CD, plese let me know. :)

Link to comment
https://www.neowin.net/forum/topic/365026-fix-mbr-with-ubuntu-live-cd/
Share on other sites

Grub error 22 means "no such partition". If you are using Grub, I'm assuming that you are dual booting between *nix and windows.

Can you upload your /boot/grub/menu.lst and tell us all you know about your partitions and hard drives? Maybe find the /dev folder on your *nix system and dump ls . to a file and upload that..

I *hope* that your problem is just that your menu.lst file is pointing to the wrong partition (for some reason), and that editing this file correctly will solve your problem. Otherwise, you'll have to get guidance from wiser people than me :p

I am pretty sure you need any password to boot the CD and enter the recovery console. :ermm: You sure you doing it right?

In any case, you can use the MBR that I posted here:

https://www.neowin.net/forum/index.php?show...#entry586362675

but do not use the full 512 byte command that I posted there. The actual MBR is only the first 446 bytes. The rest is the partition table, and will alter your partitioning!

Use a dd if=~/XP_mbr.bin of=/dev/hda bs=446 count=1 command (assuming you save the file locally in your home dir as "XP_mbr.bin".

Keep in mind that this is something that I haven't personally tried. It could cause all sorts of problems.

I strongly recommend the XP Pro CD boot method. :yes:

My partitons are as it follows:

Device Boot Start End Blocks Id System

/dev/hda1 * 1 2497 20057121 7 HPFS/NTFS

Disk /dev/hdb: 80.0 GB, 80026361856 bytes

255 heads, 63 sectors/track, 9729 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/hdb1 1 7179 57665286 7 HPFS/NTFS

/dev/hdb2 7180 9729 20482875 f W95 Ext'd (LBA)

/dev/hdb5 7180 9728 20474811 7 HPFS/NTFS

As you can see, there is no Linux partition, although there should be one at /dev/hda1. I Believe that is what is causing GRUB to complain.

I tried all my passwords from 5 years to this day, and none worked to acess the admin account of my Windows install - does it make a difference if I use a SP1 disk to boot a SP2 system? Because I'm certain I know the password, I always use the same ones.

Can I just edit GRUB to not point to the missing partition anymore, and simply boot into Windows?

Or ultimately, is there a way I can mount the partitions and backup my data from /dev/hda1 to /dev/hdb1 ?

Thanks everyone for the help so far.

Where is Grub installed?

I'm assuming that it must be installed on one of the windows partitions, given your PC is finding Grub to be able to try and load it..

Is it complaining about a missing partition before you get to the menu screen, or after you select an item?

If it's complaining about a non-existant partition that the linux menu item is pointing to, comment out the linux item, then see if you can boot back into Windows.

If you can do that, we'll see what can be done about getting your linux partition back..

There is nothing to edit, except the first block of bytes on your hard drive (the MBR). It points to where the rest of GRUB used to be in your former Linux partition. It cannot find it. It posts an error. You are stuck and sad. :(

You must re-write your MBR to 'fix' the computer and allow it to boot. If the XP Pro CD doesn't work, and you can't to the boot floppy thing, then you need an alternate method to write the MBR.

I think I will have to take the HD to another computer and use a floppy disk with the fdisk /mbr command to fix it. Or find a floppy drive and install it here. Anyway, I'm not touching this partition again to aovid further complications.

Thanks for the help

there's also a 3 meg file that you can burn to cd that will allow you to reset the windows password to blank, or whatever as well. oddly enough, it's a small linux boot. but i do have the file if you cant find it through google that i can send you too. great tool to have around if i may say so myself =)

is a 3 meg cd image. if i can find the link again i'll post it, otherwise just lemme know and i'll up it. :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.