Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Another Windows 7, UEFI, Grub Debacle

  1. #1
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Another Windows 7, UEFI, Grub Debacle

    Just set up my new system, which has UEFI enabled in the BIOS (and no obvious way to disable). I put two drives in there and would like to dual boot Windows 7 and Kubuntu as I did before. However, I can't get Grub2 to see Windows 7. I've spent the day reading forum posts, Launch Pad bug reports, and whatnot, and while I'm close, I can't quite get this to work. I can boot into each system from BIOS if I force it. Not very elegant and useful, though! I know I must be missing something really obvious, but I just can't see it. I know oldfred has been hacking away at this for some time now, hopefully he at least has a fix!

    I'm attaching the results of the latest version of bootinfoscript for reference. However, the basic architecture is:

    Code:
    /sda1 = /boot
    /sda2 = swap
    /sda3 = /
    /sda4 = /home
    
    /sdb1 = EFI
    /sdb2 = Windows Reserved
    /sdb3 = Windows
    After reading a ton of posts, seems like the most obvious is to point grub to the bootmgfw.efi on the EFI partition of that drive. So, I edited /etc/grub.d/40_custom like so:

    Code:
    menuentry "Windows 7" {
        search --fs-uuid --no-floppy --set=root 1261-7FB0
        chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }
    However, when I run grub-update, I don't specifically see that entry in the list, and when I reboot and try to select the entry, I get a partition not found error. I'm sure that I have the correct UUID for that partition, although I did try using both (hd1,1) and (hd1,gpt1) without any success.

    I did try going the other way as well (i.e. use the Windows 7 bootloader to add linux) with EasyBCD, but that doesn't seem to work either, and it looks like there is no real solution that I can see on the support forums (they basically say that even the most recent beta version is not supporting UEFI/GPT at this time).

    I would forever be indebted to anyone who can point out what I'm doing wrong and help me get a reasonable boot management solution. If there's any info I left out that would be helpful, just ask!
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    I don't use UEFI, but I was under the impression you are not using grub2 any more. You use the built-in UEFI bootloader.

    Did you install ubuntu in EFI mode too? You have to be careful whether you boot the cd in the standard bios mode, or efi mode. It seems it will not install in efi unless you boot it in efi.

    Look in bios in the boot devices and make the cd-rom (uefi) before the cd-rom (standard). It seems you will have both options on uefi boards.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  3. #3
    Join Date
    Mar 2011
    Location
    New Zealand
    Beans
    440
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    So installing grub the usual way on one harddisk doesn't work?
    Run the following, with X being the your Ubuntu drive:
    Code:
    sudo grub-install /dev/sdX
    Maybe something screwed up in your fstab.
    EDIT: Like Darkod says it probably a UEFI thing, (I'm a semi-noob )
    Last edited by jonnyboysmithy; July 22nd, 2012 at 09:13 PM.

  4. #4
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    I really do not know if you can chain from a BIOS/MBR to efi partition. Most suggest having entire system boot with BIOS mode or entire system boot with UEFI mode. I know when booting from gpt drive with BIOS I had to have the insmod part_msdos to get it to work with the Windows XP in a MBR(msdos) drive. So I think you have to tell it that the drive is gpt and fat. Some of the mod files are built in, but do not hurt to add, others have to be added to get grub2 to work.

    But I have seen these three different chain entries. I think you have to specify the {root} when it is a different drive.

    Chainload entry:
    https://bugs.launchpad.net/ubuntu/+s...b2/+bug/807801
    http://ubuntuforums.org/showthread.php?t=1934773
    menuentry "Windows 7 UEFI" {
    insmod part_gpt
    insmod fat
    insmod search_fs_uuid
    insmod chain
    set root='(hd1,gpt1)'
    search --fs-uuid --no-floppy --set=root 1261-7FB0
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }

    menuentry "Windows 7 UEFI" {
    search --file --no-floppy --set=root /efi/Microsoft/Boot/bootmgfw.efi
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }

    http://www.insanelymac.com/forum/lof...ex.php/t186440
    menuentry "Windows 7 UEFI" {
    search --file --no-floppy --set=root /efi/Microsoft/Boot/bootmgfw.efi
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }
    Last edited by oldfred; July 22nd, 2012 at 11:17 PM.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  5. #5
    Join Date
    May 2012
    Beans
    289
    Distro
    Ubuntu Development Release

    Re: Another Windows 7, UEFI, Grub Debacle

    See also: UEFIBooting

  6. #6
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    Quote Originally Posted by darkod View Post
    I don't use UEFI, but I was under the impression you are not using grub2 any more. You use the built-in UEFI bootloader.

    Did you install ubuntu in EFI mode too? You have to be careful whether you boot the cd in the standard bios mode, or efi mode. It seems it will not install in efi unless you boot it in efi.

    Look in bios in the boot devices and make the cd-rom (uefi) before the cd-rom (standard). It seems you will have both options on uefi boards.
    Hmmm...that's interesting. I didn't install Ubuntu UEFI because I didn't realize there was a different way to install it at the time and at that time didn't understand the distinction. I'm guessing that if I reinstall Ubuntu, selecting UEFI in the BIOS boot menu, then I might be able to either get the Windows boot loader or Grub to cooperate? It might be to what oldfred was saying and that I'm mixing and matching here.

    I could certainly give that a try.

  7. #7
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    Quote Originally Posted by oldfred View Post
    I really do not know if you can chain from a BIOS/MBR to efi partition. Most suggest having entire system boot with BIOS mode or entire system boot with UEFI mode. I know when booting from gpt drive with BIOS I had to have the insmod part_msdos to get it to work with the Windows XP in a MBR(msdos) drive. So I think you have to tell it that the drive is gpt and fat. Some of the mod files are built in, but do not hurt to add, others have to be added to get grub2 to work.

    But I have seen these three different chain entries. I think you have to specify the {root} when it is a different drive.

    Chainload entry:
    https://bugs.launchpad.net/ubuntu/+s...b2/+bug/807801
    http://ubuntuforums.org/showthread.php?t=1934773
    menuentry "Windows 7 UEFI" {
    insmod part_gpt
    insmod fat
    insmod search_fs_uuid
    insmod chain
    set root='(hd1,gpt1)'
    search --fs-uuid --no-floppy --set=root 1261-7FB0
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }

    menuentry "Windows 7 UEFI" {
    search --file --no-floppy --set=root /efi/Microsoft/Boot/bootmgfw.efi
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }

    http://www.insanelymac.com/forum/lof...ex.php/t186440
    menuentry "Windows 7 UEFI" {
    search --file --no-floppy --set=root /efi/Microsoft/Boot/bootmgfw.efi
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }
    Thanks for the tips Fred. I think I see what's the problem here, and as you say I think I'm mixing and matching bootloader protocols here. I did try the three iterations of grub entries for Windows, and they all failed.

    I did just retry the first selection you have since it has more mod files than one of my attempts. I get a different error in that case, I get an "invalid signature" error. I can't seem to figure out what that means, although I suspect it's saying that I have a syntax error with the drive location or something to that effect.

    I'm sort of thinking now after reading all this that I need to reinstall Kubuntu as UEFI.

  8. #8
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    Some more links on useful info:
    Grub2 efi info ArchLinux - Arch but grub2 is grub2 with maybe minor differences by distribution
    https://wiki.archlinux.org/index.php...r_UEFI_systems

    https://wiki.archlinux.org/index.php...ware_Interface
    https://wiki.archlinux.org/index.php/UEFI
    https://wiki.archlinux.org/index.php/GPT
    https://wiki.archlinux.org/index.php/Grub2

    If you're using UEFI mode to boot, you don't need a BIOS Boot Partition with gpt partitions (only for BIOS), but you do need an EFI System Partition (ESP). This is entirely different; it should be a 200-300 MiB FAT32 partition that's flagged as an ESP and must be the first partition. In libparted-based tools, you'd give it a "boot" flag (which is entirely unrelated to the MBR boot/active flag, although libparted makes them look the same). In gdisk, you'd give it a type code of EF00.
    An EFI System Partition EF00 (~100 to -256MiB, FAT32) for UEFI, a BIOS Boot Partition EF02 (~1MiB, no filesystem) for BIOS, and whatever partitions you want for Linux. You must set the partition type codes correctly, but how you do this depends on the utility you use to create them. Also, you should be sure to create a GUID Partition Table (GPT) on the disk, not a Master Boot Record (MBR) partition table. In BIOS mode, Ubuntu's installer defaults to creating MBR partitions, at least on sub-1TB disks, so you may need to use another utility to do the partitioning. You do not need both but it does not hurt as both are small, and then you can configure easily to boot with either UEFI or BIOS. You can boot via bios AND efi (after setting up your efi boot entry using efibootmgr or via efi shell and running the efi binary)

    Most that have gotten UEFI to work with Ubuntu have partitioned in advance.

    For the Total space you want for Ubuntu:
    Ubuntu's standard install is just / (root) & swap, but it is better to add another partition for /home:
    If gpt(not MBR) partitioning include these first - all partitions with gpt are primary
    250 MB efi FAT32
    1 MB bios_grub no format
    Ubuntu partitions - smaller root only where hard drive space is limited
    1. 10-25 GB Mountpoint / primary or logical beginning ext4(or ext3)
    2. all but 2 GB Mountpoint /home logical beginning ext4(or ext3)
    3. 2 GB Mountpoint swap logical

    Depending on how much memory you have you may not absolutely need swap but having some is still recommended. I do not hibernate (boots fast enough for me) but if hibernating then you need swap equal to RAM in GiB not GB. And if dual booting with windows a shared NTFS partition is also recommended. But you usually cannot create that as part of the install, just leave some space. Or partition in advance (recommended).
    One advantage of partitioning in advance is that the installer will use the swap space to speed up the install. Thanks Herman for the tip.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  9. #9
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    Thanks for all the help and advice. This makes total sense to me. I'll partition ahead of time as you propose, and then I guess run gdisk to get up the GPT (I don't remember an obvious way to do this from KDE's flavor of gparted). The only question I have is that I remember reading something about leaving a small amount of unpartitioned space at the end of the drive for a secondary GPT table. Is that something you're familiar with?

    I do like to hibernate the system (although this one should boot a lot faster than the last one, so maybe that's moot), so I'll probably put a fairly large swap space in there. Also, I have an external drive that I usually use as my main storage space / xfer stuff between Linux and Windows drive. So, I won't include a NTFS partition on there.

    I'm going to have to read up on EFI shell and efibootmanager as I'm not at all sure how to appropriately run those. I do see a launch EFI shell option in BIOS, but it throws an error when I try to run it.

  10. #10
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Another Windows 7, UEFI, Grub Debacle

    You can also download a gparted liveCD.

    http://partedmagic.com/
    http://gparted.sourceforge.net/faq.php


    When you partition with gpt it automatically creates the backup partition table at the end of the drive. I did not have to do anything special.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •