LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub problem on dual-booting with Ubuntu 11.04 and Windows (https://www.linuxquestions.org/questions/linux-newbie-8/grub-problem-on-dual-booting-with-ubuntu-11-04-and-windows-889746/)

Francoo 07-03-2011 09:10 PM

Grub problem on dual-booting with Ubuntu 11.04 and Windows
 
Hello.

I`m trying to make Dual-Boot on my machine.
Firstly I installed Ubuntu, but, when I installed Windows, the Grub don`t shows anymore, and starts directly the Windows.
I searched on the internet and I find that I have to reinstall the Grub.

Here are the problems:
My OS is Ubuntu 11.04, that comes with Grub 2.0

On the Live-CD (Pen drive) firstly I mounted the HD partition:
Code:

sudo -i
mount /dev/sda1 (I checked with fdisk) /mnt

I checked and it's everything correct.

Now, on the terminal I open Grub console:
Code:

grub
find /boot/grub/stage1
root (hd0,0)
setup (hd0)
done

The "setup (hd0)" out is this:
Code:

Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.ls
t"... succeeded
Done.

Now I restart my PC and instead of showing the menu, it shows the grub console, as I had open in a terminal.

I restarted my PC again and entered the Ubuntu Live-CD.

This time I mounted the partition and typed in the terminal:
Code:

grub-install --root-directory=/mnt /dev/sda1
Output:

Code:

Installing GRUB to /dev/sda1 as (hd0,0)...
Installation finished. No error reported.
This is the contents of the device map /mnt/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0)        /dev/fd0
(hd0)        /dev/sda
(hd1)        /dev/sdb

Again, I restarted my PC but stills shows only the console.

Can anyone help me please? :redface:

syg00 07-03-2011 10:19 PM

Your second attempt is closer - but you may have made a mess of that partition too now. You should have used
Code:

grub-install --root-directory=/mnt /dev/sda
But why are you installing grub1 ?. From the liveUSB run these and post the output
Code:

lsb_release -a
grub-install -v


iolpiolp8 07-03-2011 10:31 PM

When I was dual booting (Thats over with now), I first had windows installed, then created the necessary partition within windows. Thats a personal pref though, I guess if you really only use windows for a small number of things, you may want Ubuntu. After I was done with the install though, It gave me the option right when I started up my computer.

EDDY1 07-04-2011 12:18 AM

With Ubuntu if you have windows installed, already you can either free-up some space & use unallocated space for install, then Ubuntu wil install boot loader.

Nice machine.
I would like to add as an after thought, the motherboard you have has sata,if you're uncomfortable with dual-boot you can add an extra sata hdd & disable the other while you're installing Ubuntu, then enable the other drive, set ubuntu drive to have boot priority, reboot into Ubuntu open terminal issue command
Quote:

update-grub
It finds windows & you have dual-boot without touching mbr of wins drive.

Francoo 07-04-2011 12:47 PM

Quote:

Originally Posted by syg00 (Post 4403923)
Your second attempt is closer - but you may have made a mess of that partition too now. You should have used
Code:

grub-install --root-directory=/mnt /dev/sda
But why are you installing grub1 ?. From the liveUSB run these and post the output
Code:

lsb_release -a
grub-install -v


Here is the output:

Code:

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID:        Ubuntu
Description:        Ubuntu 11.04
Release:        11.04
Codename:        natty
root@ubuntu:~# grub-install -v
grub-install (GRUB) 1.99~rc1-13ubuntu3

I will use the Windows Partition for games and some video editing stuff, so I really can't use only Ubuntu (I would love to).

TobiSGD 07-04-2011 01:02 PM

Since this is a new setup I would recommend to do it from the beginning. But this time I would recommend to install Windows first into the first partition, after that install Ubuntu. Some Windows versions don't like to not be in the first primary partition, Windows 7 normally also creates a small boot partition which can be rather confusing.

Francoo 07-04-2011 01:20 PM

Quote:

Originally Posted by TobiSGD (Post 4404624)
Since this is a new setup I would recommend to do it from the beginning. But this time I would recommend to install Windows first into the first partition, after that install Ubuntu. Some Windows versions don't like to not be in the first primary partition, Windows 7 normally also creates a small boot partition which can be rather confusing.

If that is the only way... =/
Okay then...

Just to confirm, firstly I install Windows and then Ubuntu, right? Can I firstly create the partitions and then install or I have to create them on windows installer?
Also, do you recommend creating a separate partition for /home and /boot? There is any reason for doing that way?
Lastly, at least there will be 3 partition: Windows, Linux and Swap, do I need to create another for the Win? Or he itself will create the swap/any other?

Sorry for the large quantity of questions, I do not want to do wrong again.

EDDY1 07-04-2011 01:33 PM

Quote:

Just to confirm, firstly I install Windows and then Ubuntu, right? Can I firstly create the partitions and then install or I have to create them on windows installer?
Also, do you recommend creating a separate partition for /home and /boot? There is any reason for doing that way?
Lastly, at least there will be 3 partition: Windows, Linux and Swap, do I need to create another for the Win? Or he itself will create the swap/any other?
Yes you install windows first, If you have windows installation disk there is an option to erase partitions, erase partitions and create a new 1,, but leave empty space for your Ubuntu installation.
When you install Ubuntu choose the free space & Ubuntu will create it's own partition.

Arcane 07-04-2011 01:35 PM

Quote:

Originally Posted by Francoo (Post 4404642)
{...}Just to confirm, firstly I install Windows and then Ubuntu, right? Can I firstly create the partitions and then install or I have to create them on windows installer?{...}

Yes. First install Windows then Linux. Yes you can and need first create partitions if you haven't done it yet. Ubuntu Live CD mode should include GParted already for this task.
Quote:

{...}Also, do you recommend creating a separate partition for /home and /boot? There is any reason for doing that way?{...}
Just if you need it. It's basically setup where system is on one partition and personal files on other. Usefull when reinstalling OS or on system error.
Quote:

{...}Lastly, at least there will be 3 partition: Windows, Linux and Swap, do I need to create another for the Win? Or he itself will create the swap/any other?{...}
Windows needs one primary partition formatted as NTFS. Linux can use more and swap is extended memory for Linux OS. Think of it as extended memory or backup memory in case normal one runs low. If you have enough memory like 1-2 or more GB RAM you don't really need one as rule unless something specific may happen. In that case make swap same size as your normal RAM.

TobiSGD 07-04-2011 01:53 PM

It is essential to know which version of Windows you install. XP and Vista will only need one partition, 7 will automatically create two. So do it like EDDY1 one wrote, delete all partitions and create a new one on a part of the disk, using the Windows installer. Let the Ubuntu installer create Ubuntu's partitions in the free space.

Francoo 07-04-2011 03:12 PM

Okay. Thanks for the help guys!


All times are GMT -5. The time now is 09:52 AM.