I have a Asus A42F laptop which has Windows 7 32 bit installed on it's internal HDD.

I have just installed Ubuntu 10.04 on a portable HDD using the laptop. Now my laptop does not boot Windows 7 if the portable HDD is disconnected. I can only get the boot menu when the portable HDD is connected.

2 Answers
2

You have installed Ubuntu on the external hard drive but probably you have installed it's bootloader (GRUB) to the internal hard drive. As I have found out this is a bug in the installer of Ubuntu 10.04.

To verify, the error message you are shown will look like this upon boot without the external hard drive:

The Background

If I recall correctly GRUB and GRUB2 consist of two stages:

The initial code of the bootloader in Master Boot Record (MBR)

The bootloader in the Volume Boot Record

In this case we have the first stage of GRUB in the MBR of the internal drive, but the second stage on the partition where Ubuntu is installed. If we remove the Ubuntu drive, we get the above error message.

1. Fixing the Ubuntu bootloader

Boot Ubuntu, open the System Monitor and look for the entry of the root directory ( / ) under File Systems, note down the Device. The device ID follows this naming scheme:

/dev/sd[a_letter_from_a_to_z][partitionnumber]

We don't need the partitionnumber, so your device ID should look like this: /dev/sdb. Great, now we know on which hard drive in Linux terms Ubuntu is installed and we can install it's bootloader there. Now, open a terminal and type the following commands:

sudo grub-install [your_device]
sudo update-grub

Needless to say [your_device] has to be replaced with your device, in this example /dev/sdb.

2. Fixing the Windows 7 bootloader without a Windows install disk

Since you can boot Windows and most people don't have a Windows install disk at hand, we
download and install EasyBCD. Click the link named Download free for limited, non-commercial use and just press the download button. Don't be scared, there is no registration and no purchase required to use this tool. I recommend disconnecting the External drive at this point. Start EasyBCD and under BCD Deployment select Install the Windows Vista/7 bootloader to the MBR and press the button write to MBR. You're done!

"i only get the boot option when portable HDD is conected" - I guess it means that GRUB is on the external one as well
–
Lev LevitskyMar 25 '12 at 15:11

@lev-levitsky That just means GRUB is run from the MBR of the internal drive and is able to find it's Volume Boot Record on the external drive, if connected.I have added a section the explain the background. And yes this is a bug in the 10.04 installer. I just took my Windows 7 VM, added a second disk in VirtualBox and installed Ubuntu 10.04. You can see in the first screenshot that, while I chose to install to sdb the bootloader is installed to sda, thus overwriting the Windows 7 bootloader.
–
LiveWireBTMar 25 '12 at 21:16

You probably need to adjust the boot device choice order in your laptop BIOS settings. These are usually accessed by pressing the Del (or some other) key in the beginning of the booting process.
Try connecting the external HDD and turning on the laptop, then enter the BIOS menu, get to Boot Device list, and make sure that external HDD is first, followed by the internal HDD with your Windows system, so that it boots Windows when the external HDD is not connected.