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.
  • Posts

    • DiskGenius 6.2.0.1829 - All Versions: Free, Lite & Portable by Razvan Serea DiskGenius is a full-featured partition manager, which is designed to optimize disk usage for Windows users. It will efficiently help you recover lost data, resize/split partition, backup files, edit hex data, check bad sectors, manage virtual disks, erase data, etc.. Create a system image backup for current Windows with simple clicks to keep the operating system under protection. DiskGenius key features: Partition Management - It can create format, resize, extend, backup, split, hide and clone partition, both MBR and GPT are supported. Disk and partition conversion - Convert dynamic disk to basic, convert virtual disk format and convert MBR to GPT, convert primary partition to logical. File recovery - It can recover files deleted or emptied form recycle bin, recover files from damaged partition or disk and recover files by file type and supports file preview and file filter. Partition recovery - It is the best partition recovery program in that it can recover files from damaged, corrupted and RAW partitions, search for lost partition and recover files from it, besides, it can fix partition table. RAID recovery - It can reconstruct Virtual RAID and recover files from it, and all RAID types are supported. Sector Editor - A Hex editor is embedded to help users edit raw hex data and recover data manually. Backup and Restore - It can backup and restore partition including system partition, hard disk and partition table. Bad Tracks - It can check and repair bad sectors for all storage devices; check hard disk S.M.A.R.T. information. Delete files permanently - It can delete files permanently so that they can't be recovered by any data recovery software. Virtual Disk - It supports virtual disks, including VMware, Virtual PC and Virtual Box. Create WinPE bootable disk and you can manage disk partition when system crashes or there is no operating system on your computer. Support FAT12/FAT16/FAt32/exFAT/NTFS/EXT2/EXT3/EXT4 file system format. DiskGenius 6.2.0.1829 changelog: Add the "Disk Speed Test" feature. Add the "Windows Boot Repair and Conversion" feature. Add the BMB21-2019 erase standard to the "Erase Sectors" feature. Add support for restoring an individual partition from a PMFX disk image file. Enhanced The "Verify Or Repair Bad Sectors/Blocks" feature displays disk read speed in the detection window during scanning. The "Quick Partition" dialog box allows users to quickly select the number of partitions by pressing the numeric keys 1, 2, 7, 8, or 9. The "Set Volume Name" dialog box supports selecting preset volume labels provided by the software. The "Copy Sectors" feature supports resuming copy tasks after modifying the number of skipped bad sectors. Add the "TRIM Optimization" option to the format dialog box. The "Clone Partition" and "Clone Disk" features perform TRIM optimization on target partitions or disks before cloning. Add support for Not Equal To search conditions (prefixed with "!") when searching hexadecimal data in the sector editor. Optimize the display of capacity values in the program interface to show two decimal places. Add a minimize button to dialogs that may require long processing time. Enhance support for the ReFS file system. Enhance support for newer HIF and MP4 formats when recovering files by type. Enhance support for the EXT4 file system. Enhance compatibility of the "File Recovery" feature with special data structures. Fixed Fixed the issue that the selected file system type automatically reverted to NTFS after changing it to exFAT or EXT4 in the "Quick Partition" dialog box. Fixed inaccurate Unicode string search results in the "Sector Editor" feature. Fixed the issue that exceptions might occur when adding multiple disks in the "Erase Sectors" feature. Fixed the issue that insufficient target disk space was incorrectly reported in some cases when cloning, backing up, or restoring disks. Fixed the issue that folder modification timestamps were not preserved when copying files from ReFS partitions. Fixed the issue that Excel-format reports generated by features such as file copying or bad sector checking could not be opened when the report contained more than one million rows. Fixed the issue that folders were not displayed in the exclude-folder dialog box when backing up partitions to image files. Fixed the issue that the "Erase Sectors" feature could not be executed in some cases. Download: DiskGenius 6.2.0.1829 | 63.9 MB (Freeware, paid upgrade available) Download: DiskGenius Portable 64-bit | 40.0 MB Download: DiskGenius Portable 32-bit | 36.0 MB Download: DiskGenius Lite 64-bit | 13.4 MB Download: DiskGenius Lite 32-bit | 11.6 MB View: DiskGenius Home Page | DiskGenius Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Really? Use a better search engine https://www.google.com/search?...ourceid=chrome&ie=UTF-8
    • Seems like Neowin has transitioned into being simps for the white house. I can't find a review for the last UFC games that came out.
  • Recent Achievements

    • Week One Done
      agatameier earned a badge
      Week One Done
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      513
    2. 2
      +Edouard
      182
    3. 3
      PsYcHoKiLLa
      143
    4. 4
      ATLien_0
      95
    5. 5
      Steven P.
      74
  • Tell a friend

    Love Neowin? Tell a friend!