1

Possible Duplicate:
How can I repair grub? (How to get Ubuntu back after installing Windows?)

I upgraded my laptop with an SSD, moving my old HDD to where the DVD-drive was, so that I could have speed and storage.

Now, I have reinstalled Ubuntu on the SSD, deleting all the partitions on the old HDD to make space for a data partition. But now the laptop doesn't even get to GRUB 2 if the HDD is plugged in! If I take it out, everything works, but as soon as I plug it in and retry to boot, I won't find GRUB.

At first, I thought it was because of the boot order, but the order was OK: first the notebook hard drive (SSD) and then the CD/DVD drive (which in reality is the HDD).

How can I fix it?

Doing a simple grub-install /dev/sda doesn't work.. The SSD is sda, and the HDD is sdb.

uahug
  • 51

3 Answers3

1

The fact that the machine boots without the HDD plugged in suggests that GRUB is indeed installed correctly on your SSD and the problem is in the boot order, i.e. your HDD is probed first, BIOS finds (non-functional) GRUB there and passes control to it.

Please note that even if you installed the HDD into the bay where DVD drive used to be, it will still be seen as hard drive by BIOS. Some BIOSes have two separate menus for setting boot order - one where you choose between Hard Drive, CD/DVD and USB boot, and another separate menu where you can specify order of hard drives.

I strongly suspect that you have Hard Drive on the top in the first menu, but in the second menu your HDD takes precedence over the SSD.

enter image description here

In the picture above, apart from making [Hard Drive] the Fist Boot Device, you also need to go into Hard Drive Boot Priority sub-menu and make sure your SSD takes priority over the HDD.

Sergey
  • 44,353
0

I suggest you do a complete format to the HDD and then try again. It is possible that the partitions on the HDD still contain information that confuses the grub loader.

If that doesn't help you will HAVE to have the grub installed on the HDD, when both HDD and SSD are present (while the rest of the OS on the SSD). So, sudo grub-install /dev/sdb etc. It is possible that although the SSD is sda and the HDD is sdb both are on the same SATA/IDE channel and the BIOS give priority by default to the HDD based on the device type.

Another option you can try is Grub Customizer first. It is a graphical tool for customizing grub. But since the grub itself is not the problem but getting to it is, it may be irrelevant. Here is the info anyway:

Installation of the graphical 'grub-customizer' tool:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
OM55
  • 401
  • 3
  • 6
0

Does the computer pass the boot-time hardware check when the HDD is plugged in? Do you see a command prompt (like grub>)? Try the HDD on another device if possible. Maybe HDD is damaged. And try update-grub instead of grub-install.

If you want to use grub-install, though, you should have the partition that contains the /boot directory mounted. e. g. if the /boot directory is in the /dev/sda1, then:
sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt/ /dev/sda