PDA

View Full Version : [ubuntu] new 12.04 install grub 2 boot problem



james2b
December 2nd, 2012, 09:56 AM
I just installed a fresh Ubuntu 12.04 and during install selected to have grub put on it's own partition for the boot device since I use the Windows 7 boot manager for my booting. I also boot Ubuntu version 10.04 with the 7 and 12.04. I use Easy BCD to configure the boot menu, and did add in my new 12.04, but when I select it to boot it re-directs to the 10.04 grub menu. So I added the 12.04 in the neo-grub option in Easy BCD which now does boot up 12.04. I did try to run; grub-install /dev/sda7 in a terminal which failed due to the use of blocklists. The 12.04 is on sda7, 10.04 on sda6, and windows 7 is on sda1. So how can I install a working grub 2 onto the root partition of 12.04 so it can be booted directly ?

Karlchen
December 2nd, 2012, 04:02 PM
Hello, James2b.

About forcing Grub to install into the boot sector of a partition:


sudo grub-install --verbose --force /dev/sda7This will force Grub to install into the boot sector of the partition /dev/sda7.


About limits imposed by EasyBCD

To the best of my knowledge (based on my own experience) EasyBCD will only see and add to the Windows bootmgr boot menu a single Linux installation.
By default this will be the first Linux installation on the disk. But as you have found out, it can also be the second one.

Your setup seems to be pretty similar to mine (except for the versions and the exact partition numbers):
(1) Windows 7 on /dev/sda1
(2) Ubuntu 12.04.1 on /dev/sda5
(3) Linux Mint 13 on /dev/sda6

By using EasyBCD booting Linux Mint - second Linux installation - would work like this:
(1) Windows bootmgr chain boots the boot sector of /dev/sda5
(2) This brings up the Ubuntu 12.04 Grub boot menu
(3) From where Mint is selected and launched by the Ubuntu 12.04 Grub


Workarounds:


The easiest way out of this situation is by installing Grub2 into the MBR of /dev/sda and by making the Grub menu offer to launch all 3 OSes.
A simple
sudo update-grub should be sufficient to achieve the goal.
The more complicated way is by making the Windows bootmgr do this job.

It is more complicated, because Windows bootmgr cannot pass control to Linux Grub. Instead it has to chainload the boot sectors of /dev/sda5 or /dev/sda7.
bootmgr cannot address /dev/sda5 or /dev/sda7 because Windows does not understand ext4 filesystems. So we have to create copies of the 2 boot sectors of /dev/sda5 and /dev/sda7, put the copies as files on drive C:
Finally, we need to add the 2 boot options to the Windows boot menu manually telling bootmgr to chainload the 2 boot sectors. (EasyBCD cannot do so.)



This reads much more complicated than it really is.
Basically for each Linux distribution which you want to add to the Windows 7 boot menu you follow these steps carefully:
Howto boot Linux from Windows 7 Boot Manager (http://blog.norbert-klose.de/?p=103)
(Make sure you modify the given commands to match your environment or you may mess up your Windows boot menu.)

Kind regards,
Karl

oldfred
December 2nd, 2012, 04:58 PM
While a few report EasyBCD works, understand that with grub2 using blocklists you may have issues with grub.

Grub normally has code to search for the rest of grub in the partition with /boot where the rest of grub is. But when using blocklists it has to hard code the address on the drive where the code is. Then if the code moves from an update or even a fsck then grub is broken and will need a reinstall.

So it works, but be prepared to reinstall grub after major updates as you have a workaround to use EasyBCD.

james2b
December 3rd, 2012, 06:08 AM
Okay thank you for that. I can now boot my new 12.04 with the neo-grub option in the Easy BCD, which brings up the Ubuntu 12.04 grub2 menu. I also added in a chainload boot from the 10.4 to the 12.04, which I will attempt, and then try that force install if needed.

james2b
December 4th, 2012, 03:54 AM
Yes I can now chainload to the 12.04 grub, from the 10.04 grub 2, and does show the 12.04 boot options and my others too.

james2b
December 7th, 2012, 01:41 AM
I ran that boot info script tool, and here it is;


Boot Info Script 0.61 [1 April 2012]


============================= Boot Info Summary: ===============================

=> Windows is installed in the MBR of /dev/sda.
=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sdb and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks in partition 3 for /boot/grub.

sda1: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows Vista
Boot files: /NST/menu.lst /boot.ini /bootmgr /Boot/BCD
/Windows/System32/winload.exe /ntldr /NTDETECT.COM

sda2: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files: /boot.ini /ntldr /NTDETECT.COM

sda3: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /Windows/System32/winload.exe

sda4: __________________________________________________ ________________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ ________________________

File system: swap
Boot sector type: -
Boot sector info:

sda6: __________________________________________________ ________________________

File system: ext4
Boot sector type: Grub2 (v1.97-1.98)
Boot sector info: Grub2 (v1.97-1.98) is installed in the boot sector of
sda6 and looks at sector 367314739 of the same hard
drive for core.img. core.img is at this location and
looks in partition 6 for /boot/grub.
Operating System: Ubuntu 10.04.4 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda7: __________________________________________________ ________________________

File system: ext4
Boot sector type: Grub2 (v1.99)
Boot sector info: Grub2 (v1.99) is installed in the boot sector of sda7
and looks at sector 416062001 of the same hard drive
for core.img. core.img is at this location and looks
for (,msdos7)/boot/grub on this drive.
Operating System: Ubuntu 12.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda8: __________________________________________________ ________________________

File system: ext2
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sda9: __________________________________________________ ________________________

File system: ext2
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sda10: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sda11: __________________________________________________ _______________________

File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

oldfred
December 7th, 2012, 02:59 AM
As you can see the grub2 installed to the PBR - partition boot sectors look for core.img by sector. If that gets moved for any reason then you have to reinstall grub to the PBR so grub can then find the new core.img.

As long as you have a current working liveCD or flash drive of Ubuntu and a Windows repair CD or flash drive you should be ok.