PDA

View Full Version : [SOLVED] Ubuntu couldn't install Grub



xx55tt
June 22nd, 2011, 10:25 PM
I installed Win7. I wanted to install Ubuntu to another drive. I chose the third option to do things manually, as I couldn't change the hard drive in the first option. (keeping Windows and installing Ubuntu) So I made a root and a swap partiton for Ubuntu. The installer asked me to set the location of the bootloader, I chose the one with "Windows loader" in it. The installer accepted it and proceeded to the installation. Before it finished, it threw an error saying that it couldn't install Grub to the place I've set. The dialog allowed me to choose another drives, but it still failed. So I choose not to install Grub, but the dialog stayed there and did nothing. (bug probably) I had to restart the PC.

So I'm here with a working Windows, and Ubuntu without Grub. Thanks for your help in advance.

YesWeCan
June 22nd, 2011, 10:46 PM
When you have Ubuntu on a separate disk, you should install Grub to the MBR of that disk so that your Windows disk is untouched. Often I recommend disconnecting the Windows disk during install to avoid any confusion with the installer.

No problem. You need to boot from your live CD/USB and install Grub. After booing,
1) Run Disk Utility in System/Admin and see what the drive name is of your Ubuntu disk. It is probably /dev/sdb and your Windows disk is /dev/sda. Also confirm the number of your Ubuntu root partition, probably sdb1.

2) Install Grub to your Ubuntu disk. In a terminal (assuming your disk is /dev/sdb and root partition is sdb1):
sudo mount /dev/sdb1 /mnt
sudo grub-install --root-directory=/mnt /dev/sdb

If there are no other errors you should be able to boot your Ubuntu disk by telling the bios to boot it first. Once booted, you need to run a command to update Grub's boot menu:
sudo update-grub

Try that.

YesWeCan
June 22nd, 2011, 10:53 PM
I'm not sure from your description whether the installation completed or not. The grub install will fail if not and you'll have to do the Ubuntu install from scratch.

If you do, check in the installer that the bootloader is put on /dev/sdb (or whatever your Ubuntu disk is named) and not on a partition which are named /dev/sdbn, like /dev/sdb1.

xx55tt
June 22nd, 2011, 11:09 PM
So I've booted from liveCD, I could mount /dev/sdb1, but grub-install didn't work.

rm: cannot remove `/mnt/boot/grub/915resolution.mod': Permission denied


I guess I'll reinstall Ubuntu, just to be sure. But first I just need to clarify that I need to keep the Win bootloader on its disk, and install Grub on the Ubuntu disk. And Grub will add Win to the bootlist.

YesWeCan
June 22nd, 2011, 11:28 PM
Did you precede it with 'sudo'?

xx55tt
June 22nd, 2011, 11:53 PM
Yes I used sudo.

But the main problem was my lack of knowledge. I wanted to install the bootloader to the Win disk, now I installed it to Ubuntu's disk and it's working fine. Thanks for your help. :)

YesWeCan
June 23rd, 2011, 12:09 AM
You are welcome.
Don't forget to mark this thread as "solved" in the Thread Tools menu.

BLTicklemonster
June 23rd, 2011, 12:15 AM
Off Topic:
I just today learned that GRUB stands for GRand Unified Bootloader.