Linux & Windows EFI Dualboot: dealing with hard-coded EFI entries

Hoy toca una entrada friki. Ya van dos pc bastante nuevecitos (David y Tato) que sufren de un problema: Windows+EFI.
Queriendo dos sistemas operativos, en uno o varios discos (todos tablas GPT) etc, y con EFI, windows puede ser un quebradero de cabeza.
Los fabricantes ponen links hard-coded para lanzar SIEMPRE el windows que traían por defecto. Esto complica todo. Aquí hay un tutorial que me ha servido con ambos pc

Taken and updated from:

On Windows:

  1. Mount EFI partition: 

    mountvol S: /S
  2. Move the windows EFI file which is hard-coded loaded S:
    cd \EFI\Microsoft\Boot\
    move bootmgfw.efi bootmgfw_back.efi
  3. Update EFI entry bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw_back.efi
    bcdedit /set {bootmgr} description "Fuck Windows"

    At this point you should get a confirmatory message of the correctly performed operations.

On Linux (Tried on Ubuntu 14.04 x64).
We would assume that you have the FAT32 EFI partition mounted on /boot 

  1. remove \boot\efi\Microsoft\Boot\bootmgfw.efi and \EFI\Boot\bootx64.efi
    sudo rm \boot\efi\Microsoft\Boot\bootmgfw.efi and \EFI\Boot\bootx64.efi
  2. Remove (if any) OS boot manager (in HP, other manufactures have other names) entry.
    # first of all
    man efibootmgr
    sudo efibootmgr

    #would give us something like
    #BootCurrent: 0000
    #Timeout: 1 seconds
    #BootOrder: 0000,0006,0005,0001,0002,0003
    #Boot0000* OS boot manager
    #Boot0001* UEFI:CD/DVD Drive
    #Boot0002* UEFI:Removable Device
    #Boot0003* UEFI:Network Device
    #Boot0005* Hard Drive
    #Boot0006* ubuntu
    #Boot0007* Windows 7
    #remove OS boot manager
    sudo efibootmgr -b 0000 -B
    #select your preferred OS entry order
    sudo efibootmgr -o 0006,0007,0001
  3. Now, you need to add a custom entry on grub: 
    1. First of all, find UUID of the drive:
      grub-probe --target=fs_uuid /boot/efi/efi/Microsoft/Boot/bootmgfw_back.efi
    2. Add the entry to grub.
      # edit /etc/grub.d/40_custom
      sudo gedit /etc/grub.d/40_custom
      # add this
      menuentry "Windows x86_64 UEFI-GPT" {
          search --fs-uuid --no-floppy --set=root UUID
         chainloader (${root})/efi/Microsoft/Boot/bootmgfw_back.efi
  4. Update grub

    sudo update-grub
  5. Done! 


Foto (de Heidelberg para variar) y canción. Fin de acto.

Jim Hall Trio, Deep in a Dream


Entradas populares