0

I've two problems:

I took my old HDD and put it in a hard-drive enclosure.
Then I connected this to an notebook which is running on Windows Vista.
I also connected a USB stick with Ubuntu 14.04 with the notebook.
Next step was to install Ubuntu on the external HDD.
After the installation I had to make a restart to start with Ubuntu. I turned off the notebook and changed the BIOS to boot on the external HDD.
I turned it on and. Nothing happened.
Okay, I decided to boot the internal HDD from the notebook. Then a purple window from Ubuntu appeared asking if I wanna start Ubuntu or Windows Vista.
I choose Ubuntu and it worked. After that I did the same and chose Windows. It worked as well. BUT now I can't boot the internal HDD without having the external HDD connected to the notebook. It says something like error grub rescue. That is problem one.

Problem two is that I wanna use my HDD in the hard-drive enclosure also without this notebook. I wanna connect it to other computers.
What can I do?

muru
  • 197,895
  • 55
  • 485
  • 740
  • It looks like Grub got installed to the USB drive. – Fernhill Linux Project Jul 23 '14 at 10:32
  • Follow the instructions from the first answer on the following question / link and your problem should be solved. http://askubuntu.com/questions/125494/cant-boot-without-flash-drive-plugged-in – Fernhill Linux Project Jul 23 '14 at 10:34
  • I have flagged your question for closure as it is a duplicate of the one I have linked to. :o) – Fernhill Linux Project Jul 23 '14 at 10:36
  • Actually the problem is the reverse of the link. Grub2's MBR is on internal drive but rest of grub is on external. So both drives required to boot. Boot-Repair will auto fix this if you say external is removeable. Or reinstall grub to external and a Windows boot loader to the MBR of the internal drive. – oldfred Jul 23 '14 at 15:16

1 Answers1

0

Your grub seems has been installed on the external drive, so you need to repair it. Yes you can use the external hard drive on other machines.

To repair grub:

When you install Windows, Windows assumes it's the only OS on the machine--or at least it doesn't account for Linux. So, it replaces grub with its own boot loader. What you have to do is replace the Windows boot loader with grub. I've seen various instructions for replacing grub by mucking around with grub commands or some such, but to me the easiest way is to simply chroot into your install and run update-grub. chroot is great because it allows you to work on your actual install, instead of trying to redirect things here and there. It's really clean.

Here's how:

  1. Boot from the live CD.
  2. Determine the partition number of your main partition. GParted can help you here. I'm going to assume in this answer that it's /dev/sda2, but make sure you use the correct partition number for your system!
  3. Mount your partition:

    sudo mount /dev/sda2 /mnt  # make sure that sda2 is correct!
    
  4. Bind mount some other necessary stuff:

    for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
    
  5. chroot into your Ubuntu install:

    sudo chroot /mnt
    
  6. At this point, you're in your install, not the live CD, and running as root. Update grub:

    update-grub
    

    If you get errors, go to step 7. (Otherwise, it is optional.)

  7. Depending on your situation, you might have to reinstall grub:

    grub-install /dev/sda
    update-grub # I'm not sure if this is necessary, but it doesn't hurt.
    
  8. If everything worked without errors, then you're all set:

    exit
    sudo reboot
    
  9. At this point, you should be able to boot normally.

If you cannot boot normally, and didn't do step 7 because there were no error messages, try again with step 7.

  • Sometimes giving GRUB2 the correct configuration for your partitions is not enough, and you must actually install it (or reinstall it) to the Master Boot Record, which step 7 does. Experience helping users in chat has shown that step 7 is sometimes necessary even when no error messages are shown.

===================================================

The windows installer doesn't care about other OS in the system. So it writes own code over the master boot record. Its not a problem of windows installer, its intended. If you reinstall, upgrade windows you will face the issue. Fortunately the solution is easy too.

You need to repair the mbr. Do the following

Boot using a live usb/cd of ubuntu. Use boot-repair to fix the problem.

After booting with live usb/cd ,Run following command in terminal,

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Use Recomended Repair.

enter image description here

More info - https://help.ubuntu.com/community/Boot-Repair

These answers were given originally here.