Page 9 of 10 FirstFirst ... 78910 LastLast
Results 81 to 90 of 96

Thread: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

  1. #81

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    A clean-up post to answer some last questions.


    Quote Originally Posted by please_try_again View Post
    Good news! So you confirm that the following method works:

    1. shrinking the Windows partition under Windows (if needed)
    2. Booting a Linux live system with gparted and creating Linux partitions (if it fixes the protective MBR)
    3. Installing openSUSE (from DVD) in expert mode ("Create partition setup") and selecting the partitions (don't forget to mount the ESP in /boot/efi!)

    Yes, that worked fine.

    gparted created new partitions and automatically fixed the protective mbr.

    During the install, I only needed to "Edit Partition Setup" (instead of "Create") to select the desired install partitions and swap partition, and turn off the reformat of the win7 ESP partition. It was already picked to mount correctly in /boot/efi.

    As noted before, after the install I needed to hand-edit add the win7 boot entry to 40_custom and remake grub.cfg in order to boot win7.

    Overall the opensuse 12.2 install is clean, powerful and easy. It's easy to see the quality work that went into it.

    Quote Originally Posted by please_try_again View Post
    Which live CD and gparted version did you use?
    The linux live cd I used was "parted magic", version 2012_09_12. This is a quick boot-up with lots of tools, very well done.

    The gparted "About" says it is version 0.13.1-git. At command line startup it lists "libparted: 3.1". This version automatically corrected the bogus protective mbr partition table to the correct sectors for the disk when I created new partitions.

    The gdisk (gpt fdisk) was version 0.8.5. I added new partitions fine, but gdisk did not touch the bogus protective mbr.

    Quote Originally Posted by please_try_again View Post
    Did openSUSE 12.2 setup offer a multiple choice of boot managers, i.e lilo, elilo, grub, grub2 grub2-efi? Was "grub2" greyed out? IMO, it should be disabled to avoid confusion (and problems). I forgot to add in the few steps above that you have to install grub2-efi of course and not grub2.
    The opensuse 12.2 setup-install defaulted to pre-select the GRUB2-EFI bootloader type. It was changeable to all the other bootloader types, but this is what it sets up to do, which was correct and needed for this system. Remember that this was a uefi boot of the opensuse 12.2 install dvd, so it picked grub2-efi and was correct. It correctly wanted to mount the win7 ESP at /boot/efi, but it also wanted to reformat that win7 partition, which must not be allowed. It was straightforward to turn off the reformat of that existing partition, and then confirm you want to *not reformat* when warned later. I thought the warning was a nice touch, just to be sure.

    Lastly, some hardware info that these tests were run on...

    From hwinfo, smbios

    type 0 (bios), "AMI", "7.15", "07/02/2012"
    type 1 (system), "Hewlett-Packard", "h8-1360t", "1.00"
    type 2 (board), "PEGATRON CORPORATION", "2AD5", "1.03"

  2. #82

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    @wkolar, this is a great post! I'm not sure how to sort several excellent posts in this thread to make a tutorial out of them. But the whole thread answered a lot of questions.

    Quote Originally Posted by wkolar View Post
    During the install, I only needed to "Edit Partition Setup" (instead of "Create") to select the desired install partitions and swap partition, and turn off the reformat of the win7 ESP partition. It was already picked to mount correctly in /boot/efi.
    Yes, but see, it wanted to reformat the ESP. That's why I never trust "Edit Partition Setup". "Create Partition Setup" is the safest when you know what you are doing, because it is just empty by default. "Edit Partition Setup" is extremely dangerous. You're assuming that the setup is clever and will do what you expect. Be careful with this option! It might work ... or mess up everything. Glad it worked though (but you were careful).

    Quote Originally Posted by wkolar View Post
    As noted before, after the install I needed to hand-edit add the win7 boot entry to 40_custom and remake grub.cfg in order to boot win7.
    Not a big deal. To complete this tutorial, a Windows chainloader entry looks like this:

    Code:
    menuentry "Microsoft Windows x86_64 UEFI-GPT" {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain
        search --fs-uuid --no-floppy --set=root 5E17-7059
        chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }
    What you need to change from this example is the UUID (don't confuse with the GUID) of the ESP partition.
    The command blkid will tell you:

    Code:
    # blkid
    /dev/sda1: UUID="5E17-7059" TYPE="vfat" 
    /dev/sda3: UUID="74F618A1F61865A0" TYPE="ntfs" 
    /dev/sdb1: UUID="622E-560E" TYPE="vfat" 
    /dev/sdb2: UUID="60a1d899-b301-4ce6-86aa-a70885b616bb" TYPE="swap" 
    /dev/sdb3: LABEL="SUSE_ROOT" UUID="2e544d67-fed0-4c94-b056-311ea6d1b585" TYPE="ext4" 
    /dev/sdb4: LABEL="HOME" UUID="22a02611-fdef-48ea-8b44-d77ae09d46a7" TYPE="ext4"
    So does the script lspart (in my repo) with the option -U:

    Code:
    # lspart -U
    Dev  Boot Maj Min  Bsize/Start         Size    Fs                                    ID    Ver                                  Uuid   Model/Mount
    
    sda         8   0        512 B       111.79 GiB                                     gpt    ata                                     -   ADATA_SSD_S510_120GB
    sda1        8   1         2048       204800  vfat  C12A7328-F81F-11D2-BA4B-00A0C93EC93B  FAT32                             5E17-7059 
    sda2        8   2       206848       262144     -  E3C9E316-0B5C-4DB8-817D-F92DF00215AE      -                                     - 
    sda3        8   3       468992    233971712  ntfs  EBD0A0A2-B9E5-4433-87C0-68B6B72699C7      -                      74F618A1F61865A0 
    
    sdb         8  16        512 B       111.79 GiB                                     gpt    ata                                     -   ADATA_SSD_S510_120GB
    sdb1        8  17         2048       319488  vfat  C12A7328-F81F-11D2-BA4B-00A0C93EC93B  FAT32                             622E-560E   /boot/efi
    sdb2        8  18       321536      4208640  swap  0657FD6D-A4AB-43C4-84E5-0933C84B4F4F      2  60a1d899-b301-4ce6-86aa-a70885b616bb 
    sdb3        8  19      4530176     83892224  ext4  EBD0A0A2-B9E5-4433-87C0-68B6B72699C7    1.0  2e544d67-fed0-4c94-b056-311ea6d1b585   /export/nfs4, /
    sdb4        8  20     88422400    146018304  ext4  EBD0A0A2-B9E5-4433-87C0-68B6B72699C7    1.0  22a02611-fdef-48ea-8b44-d77ae09d46a7   /home, /export/nfs4/home
    Also notice from the example above that the GUID of the EFI system always starts with C12A7328. If you mount this partition, the Linux setup will identify it as ESP. But if you create 'any' fate32 partition, it won't work. You would have to explicitely specify that it is a EFI partition somewhere ... unless the setup decide that it is a ESP if you mount it in /boot/efi ... but I don't trust too clever setups. This example has Windows and Linux on separate disks (hence the two ESPs.) and as you can see, Grub doesn't care.


    Quote Originally Posted by wkolar View Post
    Overall the opensuse 12.2 install is clean, powerful and easy. It's easy to see the quality work that went into it.
    And the quality of the help you receive in the forum.

    Quote Originally Posted by wkolar View Post
    The linux live cd I used was "parted magic", version 2012_09_12. This is a quick boot-up with lots of tools, very well done.
    The gparted "About" says it is version 0.13.1-git. At command line startup it lists "libparted: 3.1". This version automatically corrected the bogus protective mbr partition table to the correct sectors for the disk when I created new partitions.
    OK.

    Quote Originally Posted by wkolar View Post
    The gdisk (gpt fdisk) was version 0.8.5. I added new partitions fine, but gdisk did not touch the bogus protective mbr.
    It should have worked though. Did you try this:

    Quote Originally Posted by arvidjaar View Post
    Code:
    gdisk /dev/sda
    x
    n
    w

    Quote Originally Posted by wkolar View Post
    The opensuse 12.2 setup-install defaulted to pre-select the GRUB2-EFI bootloader type. It was changeable to all the other bootloader types, but this is what it sets up to do, which was correct and needed for this system. Remember that this was a uefi boot of the opensuse 12.2 install dvd, so it picked grub2-efi and was correct.
    That was what I wondered. Thank you.


    Quote Originally Posted by wkolar View Post
    It correctly wanted to mount the win7 ESP at /boot/efi, but it also wanted to reformat that win7 partition, which must not be allowed. It was straightforward to turn off the reformat of that existing partition, and then confirm you want to *not reformat* when warned later.
    Definitely. But remember that "Create Partition Setup" doesn't mount nor format anything by default. IMO no suggestions is better than wrong suggestions. Again use "Edit Partition Setup" with care or don't use it at all!


    Good work, @wkolar, and thank you for taking the time to test this method!

  3. #83

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    @arvidjaar ... thank you, thank you very much for this real simple solution!!! It work fine, also for a Dual boot with Windows 8! But if i type fdisk -l /dev/sda , fdisk found 3 partition and gdisk tells me that had a hybrid mbr! So i think Suse installer destroyed the protected mbr!!!
    Thank all for their commitment in this thread

  4. #84

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    So... How about going the other way, adding a windows drive to the Opensuse 12.2 system.

    A couple weeks ago the hardware in my old system decided to melt down and needed to be replaced. So I bought a new HP. First thing I did was to remove the hard drive that came with the system. Then I installed my 12.1 drives in. I ran into some problems and decided to do a reinstall and when I formatted the system, Grub2 & EFI was installed on /dev/sda. Everything works the way I want and upgrades (e.g. KDE 4.9.2) have gone great. So now I want to install the windows drive and dual boot.

    I installed the drive and the system saw it as /dev/sdc and allowed me to mount it. I can't figure out how to dual boot it. The drive still has the gpt partition on it:
    Since /dev/sda1/bootefi/EFI did not have a microsoft entry I copied it from /dev/sdc1

    parted -l
    Code:
    Model: ATA Hitachi HDS72101 (scsi)
    Disk /dev/sdc: 1000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name                          Flags
     1      1049kB  106MB   105MB   fat32        EFI system partition          boot
     2      106MB   240MB   134MB                Microsoft reserved partition  msftres
     3      240MB   982GB   982GB   ntfs         Basic data partition
     4      982GB   1000GB  18.1GB  ntfs         Basic data partition
    grub.cfg has:
    Code:
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows 7 (loader) (on /dev/sdc3)' --class windows --class os $menuentry_id_option 'osprober-chain-5C287B0F287AE782' {
            insmod part_gpt
            insmod ntfs
            set root='hd2,gpt3'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt3 --hint-efi=hd2,gpt3 --hint-baremetal=ahci2,gpt3  5C287B0F287AE782
            else
              search --no-floppy --fs-uuid --set=root 5C287B0F287AE782
            fi
            chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###
    the error I get when I boot to windows relates to hd2 and gpt3 and then returns to the grub menu.

    When I run updategrub2:
    Code:
    grub2-efi-probe: error: failed to get canonical path of /boot/efi/EFI/windows/bootmgfw.efi.
    chainloading Windows ...
    Generating grub.cfg ...
    Found theme: /boot/grub2/themes/openSUSE/theme.txt
    Found background: /boot/grub2/themes/openSUSE/background.png
    Found linux image: /boot/vmlinuz-3.4.6-2.10-desktop
    Found initrd image: /boot/initrd-3.4.6-2.10-desktop
      No volume groups found
    Found Windows 7 (loader) on /dev/sdc3
    done
    After deleting the microsoft folder in EFI the error line goes away.

    Everything I have read assumes that you have windows installed first. I would really hate to re-install everything.

    BTW /dev/sda is:
    Code:
    Model: ATA WDC WD6400AAKS-6 (scsi)
    Disk /dev/sda: 640GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End    Size    File system     Name     Flags
     1      1049kB  115MB  114MB   fat16           primary
     2      115MB   107GB  107GB   ext4            primary
     3      107GB   110GB  2146MB  linux-swap(v1)  primary
     4      110GB   238GB  129GB   ext4            primary
     5      238GB   249GB  10.7GB  fat32           primary
     6      249GB   640GB  391GB   ext4            primary

  5. #85
    Join Date
    Sep 2012
    Posts
    5,132

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    Quote Originally Posted by TimeToPaws View Post
    Since /dev/sda1/bootefi/EFI did not have a microsoft entry I copied it from /dev/sdc1
    I doubt very much it will work

    Code:
    Model: ATA Hitachi HDS72101 (scsi)
    Disk /dev/sdc: 1000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    OK so if you indeed have Windows installation in UEFI mode the very first test is to try to boot it directly using UEFI firmware boot manager. All systems I have seen offered possibility to "boot from file" where you can select partition on drive and later traverse down to individual files. You will have to guess which partition it is, but as long as only one has bootmgfw.efi it is OK. Try start this file directly. If this does not work, there is no point in adding it to GRUB2 menu either and you will have to use Windows repair mode to try to repair bootloader.

    grub.cfg has:
    Code:
            chainloader +1
    That won't work, it is for legacy Windows boot manager.

    When I run updategrub2:
    Code:
    grub2-efi-probe: error: failed to get canonical path of /boot/efi/EFI/windows/bootmgfw.efi.
    You have to ask updategrub2 author.

    Everything I have read assumes that you have windows installed first. I would really hate to re-install everything.
    Then you should first ask on Windows forums how to make Windows bootable again after reshuffling your drives. If your Windows boots, it is trivial to add it to GRUB2.

  6. #86

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    Hi there!

    This thread is VERY useful!
    I want to thank to all participated to figure out what was causing the issues, i.e. to arvidjaar, please_try_again and wkolar, among others.

    I want to install Windows 8 and OpenSUSE 12.2 , both in UEFI mode.
    I have an Asus P8H77M-PRO motherboard, which is UEFI compatible, and I'll install everything from stratch to an older SATA 300 GB HDD. Including from first step to format the hdd to GPT partition.

    I have read the complete topic and it's very useful.

    I plan to do whole thing on tomorrow, and wanted to ask whether is there anything that should be tested?

    I'll test of course the followings:
    - Test whether Win8 still writes Protective MBR with 0xFFFFFFFF sector size.
    - Test whether gdisk can write back correct Protective MBR or not. Here wkolar stated that gdisk did not correct the PMBR, and then he used gparted. Maybe it's related to gdisk version or I don't know. But I have both SystemrescueCD and Parted Magic, and I'll see. gdisk with "n" option.
    - Test which boot manager will be offered by OpenSUSE installer.
    - It's not clear to me yet whether Win8 entry should be still added to OpenSUSE boot manager, or it's all handled by the internal UEFI itself? I.e. UEFI doesn't offer a selection screen when booting?
    - Also is not fully clear whether Win8 requires 2 or 3 special partition. This link says that ESP and MSR partitions are enough, but that link deals Win7. This another link shows that Win8 installer creates 3 special partition, first is Recovery Partition, then ESP and MSR. So I'll see with the Win8 installer.

    So the planned steps are following:
    1. Optional: Hard Disk cleaning, deleting MBR, somewhere in this topic I read it:
    Code:
    dd if=/dev/zero of=/dev/sda count=10
    2. Since only Windows can create MSR partition, the GPT format must be done from Windows anyway. This will be done from the Win8 installation disk in next step.

    3. Install Win8 in UEFI mode.

    4. Check Protective MBR and backup it:
    Code:
    fdisk -l /dev/sda
    parted -l
    gdisk -l /dev/sda
    Backup PMBR:
    Code:
    dd if=/dev/sda of=/somewhere/mbr.win bs=512 count=1
    Backup first 1 MB just in case:
    Code:
    dd if=/dev/sda of=/somewhere/dd_sda_2048.bin bs=512 count=2048
    Save GPT layout:
    Code:
    gdisk /dev/sda
    p
    b
    --> /somewhere/gdisk_gptbackup.gpt
    5. Write new and correct Protective MBR.
    Code:
    gdisk /dev/sda
    x
    o
    n
    w
    Checking with fdisk -l.
    If doesn't work then from gparted.

    6. Reboot into Win8 , but DO NOT into Recovery Mode. Also to check whether Win8 boots at all.

    7. Create new Linux partitions for OpenSUSE install, from SystemRescueCD or Parted Magic.

    8. Install OpenSUSE 12.2 in UEFI mode. Here we should take care that OpenSUSE installer do not create 2nd ESP partition. So existing ESP should be mounted to /boot/efi, and not allowing to format it.

    Also, to check which is the default boot manager, it should be grub2-efi.

    9. Boot into Win8 again whether it still works or not.

    10. At this point is not clear to me whether Win8 entry should be added to OpenSUSE boot manager? Or is it automatical or not needed at all?

    Regards
    batagy

  7. #87
    Join Date
    Sep 2012
    Posts
    5,132

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    Quote Originally Posted by batagy View Post
    10. At this point is not clear to me whether Win8 entry should be added to OpenSUSE boot manager? Or is it automatical or not needed at all?
    os-prober that comes with openSUSE 12.2 does not support ESP and will not add Windows to grub2 menu. Sometimes both UEFI and legacy bootloaders are present on Windows partition. In this case os-prober will find legacy Windows bootloader and adds it to menu, but it will (of course) fail to boot.

    IIRC PTA provided patched os-prober in his repository. It may handle ESP better. I tried to submit patches upstream but got zero feedback.
    Whether to use native UEFI menu (assuming your system does offer one ) or grub2 is entirely up to you. As far as I can tell functionality should be the same.

  8. #88

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    Quote Originally Posted by arvidjaar View Post
    os-prober that comes with openSUSE 12.2 does not support ESP and will not add Windows to grub2 menu. Sometimes both UEFI and legacy bootloaders are present on Windows partition. In this case os-prober will find legacy Windows bootloader and adds it to menu, but it will (of course) fail to boot.

    IIRC PTA provided patched os-prober in his repository. It may handle ESP better. I tried to submit patches upstream but got zero feedback.
    Thanks for the info.
    Quote Originally Posted by arvidjaar View Post
    Whether to use native UEFI menu (assuming your system does offer one ) or grub2 is entirely up to you. As far as I can tell functionality should be the same.
    Yeah!
    I have done the whole thing, I agree with you and it's tested!
    As you say, the default OpenSUSE 12.2 installer did not add the Win8 entry into the GRUB2 menu by itself.
    Adding it into the OpenSUSE Grub2 menu is not necessary, as long as someone can choose the boot from UEFI.

    My Mobo is Asus P8H77M-PRO, I have disabled the Legacy BIOS, enabled only UEFI.
    I didn't add the Win8 into GRUB2.
    What the system is doing, if I don't press any key, then it boots the OS what is the default UEFI boot entry. In UEFI, I can set either Windows Boot Manager or OpenSUSE to boot from.
    If Win8 is set as first boot priority, then it boots Win8 directly, no GRUB2 comes up.
    If OpenSUSE is set as first boot priority, then it boots OpenSUSE GRUB2 (menu not containing Win8 in my case).

    If I want to boot the other OS what is set, then at start, I can just press "DEL", then it goes into UEFI basic mode. Then I can choose the OS what I want, without overwrite the UEFI setting!

    So either adding Win8 to GRUB2, or boot with inbuilt UEFI, both works, both has some advantage.
    The inbuilt UEFI boot selection method's advantage that I don't need to select the OS and it's faster.

    PS: I documented everything, and I'll post it here.

  9. #89

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    Quote Originally Posted by batagy View Post
    If I want to boot the other OS what is set, then at start, I can just press "DEL", then it goes into UEFI basic mode. Then I can choose the OS what I want, without overwrite the UEFI setting!
    That's for sure. The UEFI shell has its own 'boot manager' embedded. If it's just about booting a system, you don't need to add any boot entry anywhere. We don't use Grub because we need it - on UEFI systems - but because we like it. It's like art.

    I don't know exactly what os-prober says in case of WIndows8, but having updateGrub2 adding a boot entry - if it doesn't do it already - would be easy to implement. As far as I remember, it already did it (at least fro Windows7) before we - @arvidjaar and I - added EFI support to os-prober.

    Quote Originally Posted by batagy View Post
    So either adding Win8 to GRUB2, or boot with inbuilt UEFI, both works, both has some advantage.
    The inbuilt UEFI boot selection method's advantage that I don't need to select the OS and it's faster.
    Yes. Another option is to use Linux interface to the UEFI shell: efibootmgr. It let you set the system to boot next, without changing the boot order permanently. But it let you rewrite the boot order too.

  10. #90

    Default Re: Trouble dual booting 12.2 and Windows 7 on EFI enabled system

    Quote Originally Posted by batagy View Post
    This thread is VERY useful!
    I agree. That's an excellent thread. Thank you for bringing it back to the top.

Page 9 of 10 FirstFirst ... 78910 LastLast

Posting Permissions

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