5

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.

The portable HDD does not boot when connected to another computer.

Please help me, I want to:

  • Boot Windows from the internal drive, without GRUB
  • Boot Ubuntu from the external drive via the BIOS boot menu (F8 or F12)

1 Answer 1

4

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.

GRUB is installed to /dev/sda while /dev/sdb was chosen for installation in the 10.04 installer

To verify, the error message you are shown will look like this upon boot without the external hard drive: GRUB throws an error because of a missing hard drive

The Background

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

  1. The initial code of the bootloader in Master Boot Record (MBR)
  2. 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

System Monitor shortcut in 10.04/Gnome 2

root filesystem shown in System Monitor with device ID

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!

Write to MBR button is shown in EasyBCD under the BCD Deployment options

2.1. Fixing the Windows 7 bootloader with the Windows install disk

To be sure: Disconnect the external drive! Now, boot the Windows 7 install disk and follow this How-To: http://www.howtogeek.com/howto/32523/how-to-manually-repair-windows-7-boot-loader-problems/

2
  • "i only get the boot option when portable HDD is conected" - I guess it means that GRUB is on the external one as well Mar 25, 2012 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.
    – LiveWireBT
    Mar 25, 2012 at 21:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .