Quote:
The Situation
I use an external hard-drive to test operating systems. Debian on my internal drive uses GRUB. When an OS is installed on the external drive with a different boot-loader, during boot-up I simply enter the BIOS and choose the external drive.
But once I installed a system on the external drive that also uses GRUB. I do not know if it was because there were two GRUBs or because both drives had Debian, but after installing the second system I could not boot my computer without the external hard-drive being connected.
|
The thing to watch out for when installing GNU/Linux on two hard drives (whether both internal, or one internal and one external) is that
both drives have an MBR. It is necessary then to be very careful when specifying which MBR to instal grub into.
In your case, when you installed to the external drive, you may have accidentally specified to have grub installed to the MBR of the internal drive. Now the pointer in the internal drive MBR points to the rest of the grub files on the external drive. You can't boot the internal Linux installation unless the external drive is connected, so that grub can see the config file which lists Linux installations on both the internal and extenal drives.
To repair this, boot into the internal drive Linux installation and run grub install to rewrite the pointer in the MBR (which will then point to the internal drive grub config file). It should detect all bootable Linux installations and write a config file which will show you a menu on boot wihch lists the Linux installations on both the internal and external drives without the need to tweak the BIOS in order to select which drive to boot.
If you prefer to switch drives via the BIOS, you will then need to write grub to the MBR of the external drive. Boot into the Linux installation on the external drive and run grub install, but be very careful to specify grub install to the MBR of the external drive and not the internal drive. That will give you working grub installations in both drives.
For example:
Let's assume the internal drive is /dev/sda, and the external drive is /dev/sdb.
To repair the MBR of the internal drive, run grub-install /dev/sda to write grub to the MBR with pointer to grub files on the internal drive.
To repair the MBR of the external drive, run grub-install /dev/sdb to write grub to the MBR with pointer to grub files on the external drive.
Now, on boot you will have the grub menu from the internal drive from which you can select to boot into Linux on either the internal or external drive. If you select to boot from the extenal drive, you will see another grub menu (from the extenal drive) showing you both external and internal drive installations. Just select the extenal installation to boot, or wait for the timeout to expire, which will have the same effect.