Can't start Windows after trying Ubuntu on a Flash Drive

Asked by Rafael Pajarillo on 2011-01-02

I put Ubuntu 10.10 on a flash drive so I could try it out. At first I liked it, so I decided to install it on a portable hard drive. Later I realised that I preferred Windows 7. After trying to start up my computer again, without the flash drive and hard drive, it showed a black screen that said something about a grub rescue error.

I tried going into the BIOS menu and changing the boot order to no avail.

On a side note, Ubuntu only starts if I use the flash drive -- the portable hard drive only brings up a black command prompt screen.

I can only start my computer up with Ubuntu, and I don't have a recovery CD. How do I solve this issue?

Question information

English Edit question
Ubuntu grub2 Edit question
No assignee Edit question
Last query:
Last reply:
bcbc (bcbc) said : #1

Boot Ubuntu, and install lilo to the MBR of your internal drive. It's likely /dev/sda but you should check.
From a terminal (CTRL+ALT+t) install lilo and then install the lilo bootloader to your master boot record:
sudo apt-get install lilo
Press ENTER to bypass warning screen - warnings are for booting linux not windows
sudo lilo -M /dev/sda mbr

Otherwise, you can download a windows repair CD and use that to install the windows bootloader... boot to a repair command prompt and run: bootrec.exe /fixmbr
You can download a win7 repair CD image from here:

Baljeet Singh (baljeetsingh) said : #2

you have to restore window 7 bootloader by inserting window 7 disk and then choose startup recovery...........after press any key to boot from cd............
if have any problem you can watch this video on how to

Tom (tom6) said : #3

Hi :)

Please ignore the 2 suggestions given earlier.

Can you still boot into Ubuntu when the portable hard-drive is plugged in? If so can you also boot into Windows when it is plugged in? If you can boot into Windows then do so and while in Windows "safely remove" the portable drive. You should see the option in the system tray in Windows.

Inside Windows you only need to get to a command-line, something like
Start button - "All programs" - Accessories - "System Tools" - CmdPrmt
On the Windows command-line try


That should sort the Mbr so that only Windows can be booted into. Once we have got that far then we can work at sorting out the boot-loader for Ubuntu too.

Please let us know how this goes!
Good luck and regards from
Tom :)

delance (olivier-delance) said : #4

What probably happens is:
   you installed Ubuntu MBR (which is first step to boot from disk) in Windows drive (first sector)
   the boot menu is in /boot/grub folder on USB stick
so when you boot without USB stick, the MBR try to read boot files on USB stick

So Tom propose you to reinstall Windows MBR in first sector of internal drive, to boot again on Windows drive.
After you could installed again Grub2 from Ubuntu USB stick, but you will have:
   to install Ubuntu MBR on first sector of USB stick
   to set in BIOS boot order external device before internal device

After having repair MBR on internal disk, post again, and Tom or me will help you to reinstall Grub2 on external device.

Tom (tom6) said : #5

Hi :)

Yes, exactly as Delance said. My plan is to get the internal hard-drive working on its own first. Then later on we can help you figure out how to get the external working only when it is plugged in. It's exactly the set-up i use at work.
Good luck and regards from
Tom :)

bcbc (bcbc) said : #6

You can't run "fixmbr" from a normal windows command prompt. It's supplied on the Windows DVD or a Windows repair CD when you boot to a repair prompt. In Windows 7 the command you'd use is "bootrec.exe /fixmbr".

Since you already said you don't have a recovery CD, you can also use lilo as I mentioned before with the benefit that you can do this right from within Ubuntu. Or use that link I provided to download and burn a WIn7 repair CD.

Tom's suggestion to make sure you can still boot windows before removing the grub bootloader from /dev/sda is a good one. If it boots then it's safe to reboot into Ubuntu and replace the bootloader. If not, you'll be needing that Windows repair CD

Good luck :)

Tom (tom6) said : #7

Hi :)

I have not used Win7 yet so bcbc is likely to have better info. The "fixmbr" command was fine in Xp but things have changed a lot in Vista and 7.
Regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask Rafael Pajarillo for more information if necessary.

To post a message you must log in.