Random Notes‎ > ‎

Windows 7 & Linux UEFI Dual Boot

posted Dec 12, 2011, 9:27 AM by William Shallum   [ updated Oct 2, 2014, 1:15 AM ]
Windows 7 & Debian Squeeze UEFI Dual Boot configuration on Asus P8Z68-V PRO/GEN3. Written after the fact so steps may or may not work in this order.

  • Install windows first in UEFI mode (select UEFI:<cd device> in the boot menu). It seems a bit hard to tell the difference between a UEFI-booted windows and a BIOS-booted windows.
  • ESP may need to be enlarged from the default 100MB. I did this after the fact with parted magic:
    • note partition GUIDs and sizes
    • move ntfs partition to the right using gparted
    • backup MSR partition using dd
    • backup ESP using partition saving
    • delete MSR & ESP partition
    • recreate ESP partition with larger size
    • restore ESP contents
    • recreate MSR partition
    • restore MSR contents
    • restore partition GUIDs for MSR & ESP partition
  • Install debian. no BIOS boot partition necessary. don't install bootloader, drop to shell instead.
  • mount ESP on /boot/efi
  • create /boot/efi/EFI/grub directory
  • bind-mount /boot/efi/EFI/grub to /boot/grub so update-grub still works
  • add above mounts and bind mounts to /etc/fstab
  • Install grub-efi-amd64 from wheezy, not squeeze. Squeeze version doesn't properly pass initrd to the kernel, resulting in the error Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  • edit /etc/default/grub, add reboot=acpi to GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT otherwise reboot fails with something similar to this: https://bugs.archlinux.org/task/23067
  • rerun update-grub so it picks up the defaults?
  • announce the GRUB loader to the firmware: efibootmgr -c -l "\\EFI\\grub\\grub.efi" -L GRUB
  • also, might want to install gdisk from squeeze-backports 

Conclusion: 
In conclusion: use rEFIt to chainload both win7 and GRUB 2. The Debian ELILO package didn't really "just work" and needed some messing around with the directory structure (more than the bind mount for GRUB above). Also, the GRUB package seems to get more attention and the configuration generator is shared between different GRUB 2 versions (bios / EFI), so it should be well tested.

References:
Comments