-   Linux - General (
-   -   Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 (

dcorb62 08-30-2007 09:15 AM

Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22
I found out about Ubuntu and was attempting to install it onto my external hard drive. However, after installing it to the external drive and rebooting to my primary hard drive with XP partition, it now gives "GRUB error 22"(when I am trying to boot up my Primary XP hard drive). My desire was to run Ubuntu from the external drive using Virtual PC 2004 to see if I liked it and to get familiar with it. I can still see my files on my primary hard drive but Ubuntu appears to have changed my boot partition. Any suggestions on how to get my XP drive (primary drive) re-established?

Junior Hacker 08-30-2007 02:28 PM

In the grub manual, error 22 means the partition does not exist. I googled your situation using "Configure grub to boot external USB drive" as key words. The first link that came up looks like a very good tut.

dcorb62 08-30-2007 04:10 PM

I appreciate the information but I am trying to get my primary hard drive to boot up. For whatever reason, when installing Ubuntu on the external hard drive, it also changed the boot sector of my primary (XP) hard drive. I still want the primary drive to boot up to Windows XP until I get familiar with Ubuntu and make any decision to switch to it.


Junior Hacker 08-30-2007 09:53 PM

Ubuntu did the same thing to me, I have a boot manager and over 10 partitions with different operating systems. After installing Ubuntu, my boot manager was gone (it has it's own 8MB partition) and all the partitions that had all the other OS's. Had to re-install the boot manager and recover all the lost partitions. Ubuntu didn't even offer the choice to put grub in the root partition like all the other distributions, it just went ahead and put it in the MBR which was controlled by my boot manager. That's one mark against Ubuntu's installer, I'm going to write the developers and bitch.
If you have an XP CD, or the neighbor has one, you can use it to restore the Windows boot loader in the MBR. Instructions follow:

To restore Windows XP MBR

1: Boot with Windows XP CD in the drive
2: Hit any key to boot from the CD
3: Wait for installer to load drivers in memory
4: When asked to press enter to install, type: r
5: When asked which Windows installation would you like to log onto,
if there is only one, type: 1  (and hit enter)
6: When asked to type the Administrator password, I hit enter without
typing anything which will be the administrator password for most OEM
Windows installations, (No password). If you installed Windows XP
yourself and added an administrator password, type this password.
7: At the prompt type: fixmbr  (and hit enter)
-**CAUTION** and a warning appear
8: When asked "Are you sure you want to write a new MBR?:" type: y
-The new master boot record has been successfully written.
9: When the prompt returns, type: exit
-The computer re-boots and Windows kernel is loaded.

There are also rescue CD's available on-line that can restore a Windows boot loader in the MBR. Not sure which, will investigate and report back.

Junior Hacker 08-30-2007 10:04 PM

You can also try "fixboot" instead of "fixmbr" if it appears the boot sector of the Windows partition is holding Grub files instead of Windows boot.ini.

ham635 09-04-2007 10:32 AM

I'm having the same problem... but with a twist. I've got a laptop and whenever I try to boot up without the external drive, I get the same error (when I boot up WITH the external drive, I am able to boot to either windows or ubuntu just fine). However, when I try and use the recovery utility to reinstate the mbr, it doesn't detect my primary hard drive. If I try and use it without the external drive powered up, I get a 'no hard drives present' error and if I do it with the external drive, the external drive is the only one detected.... help?!

ham635 09-04-2007 10:59 AM

Apparently the solution was the least likely (at least in my mind. Windows system restore seems to do the trick if anyone else ends up having this problem. I've never had much luck with it before, but it sure saved me this time

dcorb62 09-05-2007 12:28 AM

Problem solved
I tried every suggestion recommended here and spent several days doing Google searches on the error and finally found a web site that had an .iso file that worked for me. The problem with most suggestions is that while trying to boot from a windows boot cd or from the install cd, it would not recognize my primary windows drive. From Ubuntu, I could see the drive and all of my files. Obviously, Ubuntu over-wrote my MBR so I finally tried the following web site: Using the Super Grub Disk, I was able to step through the procedures to re-write a windows MBR. Finally, after getting windows to boot up, I did a restore to the week prior to installing Ubuntu (just to be on the safe side). However, until I could get windows to boot up, there was no possibility to do a system restore. A valuable lesson learned.

thanks for all your help.
Darrell Corbitt

All times are GMT -5. The time now is 08:59 AM.