The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    [tutorial] VAIO EFI dual+ boot tutorial

    Discussion in 'VAIO / Sony' started by gabcas, Oct 18, 2012.

  1. gabcas

    gabcas Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    This is a tutorial on how to dual boot Windows + Linux + *any* EFI capable os on the 2012 Sony VAIO line (and possible any other similarly restricted laptops).

    this tutorial is needed because on the Sony VAIO S and probably many other laptops the UEFI Firmware is hard-coded to look for windows bootloaders and ignore all others.
    this will NOT disable secure-boot on laptops on which it is enabled

    This tutorial is based on FEDORA with grub2 and has not been tested on any other distributions or bootloader !!
    ( I will update when I get the chance to play with Ubuntu )
    As per usual I am not responsible for any damage done to your laptop or any loss of personal information.
    REQUIERS
    • a usb stick with at least 100mb (I know that's virtually nothing now a days)
    • windows must already be running on UEFI
    • a somewhat descent knowledge of linux
    • comfortable using the terminal
    Step 1: make a grub usb stick

    Format the usb stick to fat 32
    Copy the contents of ftp://mirror.csclub.uwaterloo.ca/fedora/linux/releases/test/18-Alpha/Fedora/x86_64/os/EFI or any other fedora mirror
    to /EFI on your usb stick by running this on the root of your usb stick
    ** we MUST use fedora 18 because the bootloader shipped with <17 is grub legacy and it will complicate the process **
    Code:
    wget -r -nH --cut-dirs=8 ftp://mirror.csclub.uwaterloo.ca/fedora/linux/releases/test/18-Alpha/Fedora/x86_64/os/EFI/
    /test/18-Alpha/ will eventually change to /test/18-Beta/ then just /18/

    Now uninstall all grub related components
    If you are asked to uninstall grubby DO NOT DO IT, it is required by the kernel and will remove the kernel if you try to do so.
    Code:
    sudo yum remove grub{,2}{.*,-*}
    Now re-install grub2-tools
    Code:
    sudo yum install grub2-tools
    Update the conf file on the usb stick
    Code:
    sudo grub2-mkconfig -o /YOUR_USB_MOUNT_POINT/EFI/BOOT/grub.cfg
    At this point you should be able to reboot and use grub off the usb stick to boot into linux, if this dosn't work ask for help here.
    Step 2: backup windows boot loaders

    Go to /boot/efi/EFI

    Rename the Microsoft folder to Microsoft .bak
    and the boot folder to bak_boot (if the folder name starts with boot it is likely to cause problems)
    Clear the efi nvram with
    Code:
     sudo  efibootmgr -O
    Now reboot with the usb stick unplugged, you should see "No Operating System Found"
    if windows starts you did not rename everything you needed to and you need to do this step again
    Step 3: Install Grub

    Plug in the usb stick and use it to boot into Linux
    Delete any old grub config files
    Code:
    sudo rm -rf /boot/grub*
    Install grub2-efi
    Code:
    sudo yum install grub2-efi
    Rename /boot/efi/EFI/fedora to /boot/efi/EFI/boot
    Code:
    sudo mv /boot/efi/EFI/fedora /boot/efi/EFI/boot
    Since this isn't grub's default location we can tell the os where it is by
    Code:
    sudo ln -s /boot/efi/EFI/boot/grub.cfg /etc/grub2-efi.cfg
    Update the cfg file
    Code:
    sudo grub2-mkconfig -o /boot/efi/EFI/boot/grub.cfg
    At this point you should be able to boot into linux from grub without the usb stick.
    Step 4: Re-add Windows

    In /boot/efi/EFI

    rename Microsoft.bak/ back to Microsoft/
    rename Microsoft/Boot/bootmfg.efi to Microsoft/Boot/bootmrg.efi.bak
    now move ./Microsoft/Boot/bootmrgfw.efi to ./Win7.efi
    Code:
    sudo mv /boot/efi/EFI/Microsoft/Boot/bootmgrfw.efi /boot/efi/EFI/Win7.efi 
    Chainload windows from grub
    add a menu entry consisting of
    Code:
    menuentry "Microsoft Windows 7" {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain
        search --fs-uuid --no-floppy --set=root YOUR_OUTPUT_HERE
        chainloader /efi/Win7.efi
    }
    
    where YOUR_OUTPUT_HERE is the output of running the command
    Code:
    echo `grub2-probe --target=hints_string /boot/efi/EFI/Win7.efi` `grub2-probe --target=fs_uuid /boot/efi/EFI/Win7.efi`
    
    which sould be something like
    Code:
    --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 EAE5-4F3B
    
    Update the cfg file again
    Code:
    sudo grub2-mkconfig -o /boot/efi/EFI/boot/grub.cfg
    Step 5: Test

    Reboot your computer to ensure everything worked
    If it did jump with joy and thank me

    Setp 6: Troubleshoot
    If it didn't work try to find what you did wrong (READ every single line of the post and comments),
    then use google,
    if all else fails boot with the usb stick and post the output of
    Code:
    sudo find /boot/efi/
    Code:
    sudo grub2-mkconfig
    Code:
    echo `grub2-probe --target=hints_string /boot/efi/EFI/Win7.efi` `grub2-probe --target=fs_uuid /boot/efi/EFI/Win7.efi`
     
  2. rou

    rou Newbie

    Reputations:
    0
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    5
    Thanks !

    It worked well for me on my VAIO SVS 1311C5E.

    I had to copy the BOOTX64.efi file from the EFI/BOOT of the usb stick to /boot/efi/EFI/Boot to make it work before step 5.

    I'm also still wondering why grub gets stuck on the windows 7 choice when you don't remove the /boot/grub2 folder...