PDA

View Full Version : [ubuntu] Dual booting Grub2 problem



Silvio_Abela
March 12th, 2014, 10:19 AM
Hello,

This is my first post in this forum. I am a new Ubuntu user (in my almost middle age) :).

I have been looking all over the web for a solution but have been finding some really conflicting advice due to the nature of my installation, I think. My problem is this: I have an AsRock Z77 Pro-4 mainboard that has a UEFI Bios and two SATA controllers. One from Intel which has two SATA3 and four SATA2 (all support RAID) and one ASmedia controller with two SATA3 (no RAID). I have a 128GB SSD with Windows 7 x64 on the ASmedia controller, two Seagate 3TB SATA on RAID 1 (Intel Rapid Storage Technology) and my Ubuntu 12.04 LTS x64 on a 160GB drive on a SATA 2 port which is connected to an eSATA port on the front of my case. The port is set in bios as eSATA as the mobo gives that option.

I previously used Ubuntu in a virtual machine but lately I decided to have it on a real HDD to have more speed and better use of resources. When trying to install Ubuntu to dual boot I used the following tutorial "Dual-boot Windows 7 and Ubuntu 12.04 on a PC with a UEFI board, SSD and HDD (http://www.linuxbsdos.com/2012/10/10/dual-boot-windows-7-and-ubuntu-12-04-on-a-pc-with-uefi-board-ssd-and-hdd/)". This tutorial suggested to install Ubuntu on its HDD after unplugging all other drives from the system. I configured my drive using the suggested partitions and after re-booting to make sure everything worked, I plugged in all other HDD and booted up. Grub loader came on and although I could boot into Ubuntu, the Windows option did not work and the follwing error was shown:

Error: no such device EE0883C3088388F3
Error: no such partition

I tried looking into the Grub edit commands and found that the Windows partition is pointing to "sdg1". The following is part of the grub.cfg:


menuentry "Windows 7 (loader) (on /dev/sdg1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd2,msdos1)'
search --no-floppy --fs-uuid --set=root EE0883C3088388F3
chainloader +1


What I would like to ask is this:

If I change the entry /dev/sdg1 to read /dev/sdh1 which is the first part ition on my Windows SSD (100MB) will the Grub Windows menu entry work? I think I would also need to change the set root='(hd2,msdos1)' entry as well. I still need to find the correct "hd" number as I understand that Grub names the drives differently.
Will it be better to try and somehow repair Grub, and if so, which is the best place to repair it from, Live CD or terminal while booted normally? (a few hints on this will be much appreciated as this is where I previously found some conflicting advice.
Then my last problem would be to make Windows boot by default, but that has not been researched yet :)


Any help, information or pointers to valid tutorials is most welcome. Thank you.

tfrue
March 12th, 2014, 01:49 PM
Dual booting with a UEFI BIOS is tricky, you have to be careful to boot to Ubuntu with the UEFI options, otherwise when you live boot Ubuntu to install, you are booting into a GPT disk as MBR and that's when you start overwriting the GPT partition with MBR partitions.

Before we begin troubleshooting, I would like to see your boot-info URL so we can determine what's going on. So follow the instructions on this web site to produce a boot-info URL, please. Don't do the recommended repair just yet, but follow the instructions only for the boot-info URL, thanks.
https://help.ubuntu.com/community/Boot-Repair

Here is a post that you will want to check out to see if you can find what problem you have been having and follow the instructions provided.
http://ubuntuforums.org/showthread.php?t=2147295

Silvio_Abela
March 12th, 2014, 03:32 PM
Hi,

Thanks for the quick reply. This is the url generated by Boo-info: http://paste.ubuntu.com/7079517/.

The thing I cannot remember is whether I booted using UEFI or normally. I think the latter but had most of the Intel stuff, the secure boot etc. all switched off on the Uefi Bios.


Thanks again.

oldfred
March 12th, 2014, 03:34 PM
Some have issues with Asrock and asmedia ports.
UEFI, Windows on SSD, Ubuntu on HD ASRock Z77 Pro4 motherboard
http://www.linuxbsdos.com/2012/10/10/dual-boot-windows-7-and-ubuntu-12-04-on-a-pc-with-uefi-board-ssd-and-hdd/
ASRock UEFI bios + Ubuntu Server = operating system not found Install to flash drive
http://ubuntuforums.org/showthread.php?t=2153123

There also seem to be issues

So to people with an Asrock Z77 Extreme4 motherboard: if you install Ubuntu, make sure the drives you are installing from and to are not connected to the Asmedia SATA ports!

Silvio_Abela
March 12th, 2014, 07:07 PM
Some have issues with Asrock and asmedia ports.
UEFI, Windows on SSD, Ubuntu on HD ASRock Z77 Pro4 motherboard
http://www.linuxbsdos.com/2012/10/10/dual-boot-windows-7-and-ubuntu-12-04-on-a-pc-with-uefi-board-ssd-and-hdd/


The tutorial is the same one I followed to install and after trying many times to install Ubuntu 12.04 with the Windows SSD and the RAID drives connected, I decided to unplug them (the short version of the same tutorial - and the easiest :)) and installed Ubuntu on a drive connected to one of the main Intel SATA ports, albeit a SATA 2 not SATA 3. I was also a looking on the bright side since the author of the tutorial used my same mainboard.

Now I can either let the PC boot on its own and it stops on the Grub screen but the Windows option does not work or else I use the F11 option and choose the SSD to boot into Windows. It is nothing much but a little annoyance, and one that keeps popping in my thoughts time to time. Maybe I have a case of OCD :P.

oldfred
March 12th, 2014, 07:21 PM
I am not sure how you boot Windows. But I think it is in BIOS boot mode.
But you also show an efi partition in gpt table.
Both MBR(msdos) and gpt partition tables are shown.
Windows only boots from gpt partitioned drives with UEFI.
Both Windows and Ubuntu only boot from MBR partitioned drives with BIOS.
Ubuntu will boot from gpt drives with UEFI or BIOS if correct supporting partitions are on drive.

You need to houseclean Windows drive sde, so it is seen correctly.
Did you have a UEFI install and then install Windows 7 from DVD? The DVD installer only installs in BIOS mode. You have to copy to flash drive and do some updates to get it to work in UEFI mode.
And if you install Windows 7 in BIOS mode it converts gpt drive to MBR, but does not do it correctly and leaves backup partition table. Then Linux tools see both MBR & gpt and do not know what you have or want.
Only if sure you are booting in BIOS mode with Windows remove gpt backup partition table with fixparts.

FixParts is the easiest way to remove the stray GPT data. GPT fdisk (gdisk or sgdisk) can do it, but the procedure's a bit more involved.
http://www.rodsbooks.com/fixparts/

Always best to have all systems installed in UEFI mode or all installed in UEFI mode, your choice.

And since Ubuntu will boot from a gpt drive with BIOS or UEFI, I suggest gpt on new systems and have both an efi partition (future use if currently BIOS) and the bios_grub partition if currently BIOS. Only on Windows boot drive keep MBR if booting in BIOS mode.

It can be difficult to add an efi partition later (should be first), if drive is full and you want to try UEFI booting. New hardware may work better with UEFI, but UEFI is new where BIOS has only been around for 35 years or since first PC. But then BIOS has a lot of kluges to make it still work.

Silvio_Abela
March 12th, 2014, 09:57 PM
I installed Windows from a flash drive but didn't know about the updates to make it install in UEFI mode to tell the truth. I thought that since the motherboard has UEFI then whatever is needed is installed in the new "format". I have researched this now and found a guide on how to do it. :( Now I wish I came here earlier.

Right now, the only way to boot into Windows is to select the boot option (F11) on the boot screen and then select the SSD which contains my Windows 7 install.

Have downloaded FixParts for Windows but am a little stumped. Can't seem to use the right format for what the program defines as "device_filename" although I tried both types suggested for Windows; which are #: or \\.\physicaldrive0 etc. Will try tomorrow from Ubuntu and see how I progress. Thanks for now.

Silvio_Abela
March 14th, 2014, 09:05 AM
I found the reason why!

After the suggestions I received here (thank you so much :o) I decided to re-install Ubuntu afresh. This is because of the conflicting things found regarding GTP, EFI and other things. Today I installed the OS at least four times to get it right. And finally I did.

My main mistake was to unplug my Windows SSD and the Raid 1 array to install Ubuntu by itself as I did not want Grub to interfere somehow with them as I have quite a lot of data and Windows takes so much time to configure according to personal tastes. Then I tried to install Ubuntu as EFI and managed after partitioning the HDD using Gparted. But then when I connected the SSD the computer went straight to Windows.

So then I plugged the SSD and re-installed as EFI but after installation finished I received errors for Windows: "invalid EFI filepath". So then I remembered that my Windows is not using EFI but MBR so I installed again. This worked but after plugging the Raid array Grub was not recognised since obviously the drive paths had changed.

Satisfied that Ubuntu would not interfere with Windows I connected the Raid array but left the Sata ports on AHCI, all Intel stuff in the mainboard set to Disabled and installed Ubuntu. After restarting, Grub menu options worked for both Ubuntu and Windows.

With this I would like to mark this query as solved but not before giving my sincere thanks to those who replied with help tips. Thank you for finding the time to help a middle-aged Ubuntu starter who took quite a lot of time to solve the issue but learnt quite a lot in the process as well.

oldfred
March 14th, 2014, 02:49 PM
Glad you got it working.

Since you have several drives and multiple installs, you may want to just run a new BootInfo report for yourself just to document install.
Do not run any auto fixes from Boot-Repair as with multiple drives it wants to install grub to all drives and with your RAID not sure if it would try to install to that also.
But you can use Boot-Repair in Advanced mode in the future if need be.

You may need to install RAID drivers as standard desktop does not include those.