PDA

View Full Version : [SOLVED] Windows 8 + Kubuntu dual boot error



duncanmc
September 13th, 2012, 01:45 PM
Hi
I bought a new HP dektop computer with two hdds. First, I installed windows 8 to first hdd and then kubuntu 12.04 to the second disk. After installing kubuntu, I could not boot from windows. Boot menu does not show Windows 8 in the list.
I tried Boot Repair, but it could not solve the dual booting problem. Boot Repair's Bootinfo summary is at http://paste.ubuntu.com/1202508/ . Could you please help me to solve it?

Thanks
Duncan

YannBuntu
September 13th, 2012, 07:35 PM
Hello

2 possible problems:
1) your Ubuntu partition ends too far from the start of the disk
2) your Ubuntu is not on the same disk as the EFI partition

First, please use Gparted to reduce your Ubuntu partition (sdb1) from 222GB to 100GB (reduce it from the right-side, so that it still starts at the beginning of the disk).
Then reboot and tell me if better.

If not, use Boot-Repair's Recommended Repair and tell me the new URL.

duncanmc
September 14th, 2012, 10:04 AM
I decreased the size to 100Gb. Linux is on the second disc and it has only one ext4 linux partiton and one swap partition. I wanted to use first drive's (windows) efi partition for dual boot, but we can change it if necessary.

I run the boot repair. Result is at http://paste.ubuntu.com/1204335/

I restarted the computer. My bios showed Windows's boot manager as the only UEFI boot option. I clicked on it and GNU GRUB (v 1.99-21) appeared. It has 5 options
1)Ubuntu ...
2)Ubuntu ... (recovery mode)
3)Windows bootmgfw.efi.bkp, generated by Boot-Repair
4)Windows memtest.efi, generated by Boot-Repair
5)Boot bootx64.efi.bkp, generated by Boot-Repair

I tried options 3,4 and 5 to load windows, but they do not work. They say:

error: no such device: 50E9-5388
error: file not found

When I click on option 1, ubuntu loads without any problems.

I have not installed anything to ubuntu, so I can reinstall ubuntu if necessary. However, I would like to rescue windows as it is because I have installed lots of programs to there.

YannBuntu
September 14th, 2012, 01:16 PM
My bios showed Windows's boot manager as the only UEFI boot option.

ok.
Now please:
1) run Boot-Repair, click "Advanced options"
2) tick the "Restore EFI backups" option
3) untick the "Backup and rename EFI files" option if necessary
4) click apply.
5) Tell us the new URL that will appear
6) Reboot and indicate if the "Windows's boot manager" boots Windows or not

oldfred
September 14th, 2012, 05:49 PM
Many tools will not scan partition tables when you have errors, so you need to fix that first. Since sda is gpt you need to use gpt tools to repair it.
repair gpt:
http://www.rodsbooks.com/gdisk/repairing.html

Your Kubuntu install in sdb is in BIOS/MBR mode. It may just be better to reinstall in UEFI mode which will reformat sdb to gpt from MBR. Which ever way you boot liveCD or USB installer, is the way it installs.

One other user who did get Ubuntu & Windows to dual boot.
UEFI dual boot two drives
http://ubuntuforums.org/showthread.php?t=2031836

WARNING for Windows 8 Dual-Booters
http://ubuntuforums.org/showthread.php?t=1953674
It defaults shutdown to a hybrid hibernation/off state for fast boot
But then files may be corrupted similar to Windows 7 Hibernation:
http://superuser.com/questions/144720/missing-files-when-windows-7-returns-from-hibernate-w-dual-boot

YannBuntu
September 14th, 2012, 06:42 PM
Your Kubuntu install in sdb is in BIOS/MBR mode.

This was true in Post#1, but he already correctly converted Kubuntu in EFI mode (see Post#3).

Now the only problem is that the Windows entry in GRUB is not working.

Not only the BIOS/mbr entries created by GRUB (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1024383), but also the Windows EFI custom entries generated by Boot-Repair.

oldfred
September 14th, 2012, 08:09 PM
I still see Kubuntu in MBR(mdos) partitioning.

When I first used gpt and had XP in MBR, I had to add the insmod for msdos - insmod part_msdos to get my chain entry to work.

So if booting from MBR and chaining to a gpt partitioned drive a insmod part_gpt may be required? I think it still would be easier to have both drives as gpt.

YannBuntu
September 14th, 2012, 08:41 PM
I still see Kubuntu in MBR(mdos) partitioning.

GRUB is present in the MBR because it was installed there initially by Ubiquity. (post#1)
But the BIOS does not use it as it boots the HDD in EFI mode.

How Boot-Repair converted Kubuntu to EFI mode:
In post#3, Kubuntu was converted to EFI mode (Boot-Repair added /boot/efi in fstab and installed grub-efi). You can check it in post#3 as /efi/ubuntu/grubx64.efi appeared and fstab has /boot/efi.
The "Backup and rename EFI file" option of B-R also renamed /efi/Boot/bootx64.efi into /efi/Boot/bootx64.efi.bkp , then copied /efi/ubuntu/grubx64.efi into /efi/Boot/bootx64.efi .
At this point, the WindowsEFI file is /efi/Boot/bootx64.efi.bkp , and the KubuntuEFI file is located at both /efi/Boot/bootx64.efi and /efi/ubuntu/grubx64.efi .
B-R also added customized entry in grub.d for the Windows entry (/efi/Boot/bootx64.efi.bkp).

In post#3, duncanmc confirmed that only one EFI entry appears in the BIOS (indeed it points to /efi/Boot/bootx64.efi), and confirmed that this entry boots Ubuntu. This is normal, and this proves that Kubuntu is now correctly setup in EFI mode.

Expected result:
1) the customized Windows entry (/efi/Boot/bootx64.efi.bkp ) should start Windows,
2) AND the BIOS should propose a 2nd EFI entry (to /efi/ubuntu/grubx64.efi)
This is what happened in the other EFI systems I followed up.

Problem with duncanmc's PC:
neither 1) nor 2) happened

What I proposed in post#4:
I asked him (in post#4) to use the "Restore EFI backup" option of B-R. This option will restore the Windows EFI file /efi/Boot/bootx64.efi.bkp to its original location (/efi/Boot/bootx64.efi), so that the UEFI entry in BIOS will boot to the WindowsEFI file (/efi/Boot/bootx64.efi) like originally.






I think it still would be easier to have both drives as gpt.

That's a possibility to explore. Maybe that would solve the problem described above.

duncanmc
September 18th, 2012, 04:06 AM
I run boot repair. The result is at http://paste.ubuntu.com/1212210/

I rebooted the computer. My bios showed two UIEF boot options: 1) ubuntu 2) windows boot manager. I chose windows boot manager. For a moment, windows 8's logo (blue windows) appeared, but the computer restarted itself in less than a second. Again I tried to boot from windows boot manager. Again windows logo appeared. It wrote something like "Automatic repairing" under the logo, but the computer restarted again after a few seconds. Then it showed windows logo while booting and rebooted. Computer entered an endless loop of rebooting.

oldfred
September 18th, 2012, 04:44 AM
I still think you have to fix this first as I posted before post #5.


/dev/sda1 ends after the last sector of /dev/sda

duncanmc
September 19th, 2012, 07:03 AM
I tried gpt fdisk, but it could find errors. I also tried option v. The output is at http://paste.ubuntu.com/1214238/ .

Then I tried testdisk. Its output is at http://paste.ubuntu.com/1214239/

How can I fix it?

oldfred
September 19th, 2012, 02:21 PM
The issue seems to be just the protective MBR which in gpt is not really used. The protective MBR creates one MBR entry for the entire drive just so older tools see the MBR table and know it is fully used.
But as long as that error exists I think you may have issues.


If you just to a write from gdisk it may also update protective MBR? Or it may take a minor adjustment to one parttition and then a write to get it to update?

I would use gdisk to backup partition table first. From the repairing gpt page:

http://www.rodsbooks.com/gdisk/repairing.html

On gdisk's main menu, you'll find the b option, which saves partition data to a disk file. You can also use sgdisk for this task, as in sgdisk -b sda-backup.gpt /dev/sda to save a backup of /dev/sda to the file sda-backup.gpt. Using either method, the data saved is the protective MBR, the main header, the backup header, and one copy of the partition table.

duncanmc
September 19th, 2012, 05:49 PM
What if I apply the windows command "fdisk /mbr" ? Does it fix it?

oldfred
September 19th, 2012, 07:38 PM
Windows fixmbr command writes a new MBR (boot code), not a partition table. With UEFI you are not using MBR, so I do not know if Windows updated the fixMBR command to really fix UEFI entry or not.

duncanmc
September 20th, 2012, 09:38 AM
it seems like partitions were damaged. I formated both drives and installed windows and kubuntu from scratch. They are working now.

YannBuntu
September 20th, 2012, 10:30 AM
For our information, please could you indicate your new Boot-Info (https://help.ubuntu.com/community/Boot-Info) URL, so that we can compare?

duncanmc
September 20th, 2012, 05:32 PM
http://paste.ubuntu.com/1217057/

YannBuntu
September 20th, 2012, 07:25 PM
thanks
For information, the initial problem was only that your BIOS was setup in Legacy mode, that's why your Windows couldn't boot.