EFI dualboot Ubuntu 14.04 and Windows 10 on Sony Vaio S

FROM: http://sygard.no/2012/09/efi-dualboot-ubuntu-12-04-and-windows-8-in-raid0-on-sony-vaio-s/

Recently I got my hands on a Sony Vaio S with the following specs:

  • Model: SVS151190X
  • Specs: link

The machine has two 480GB SSD disks which can be configured in RAID0 using a built-in software raid-controller.

I wanted to run a dualboot setup with Windows 10 for gaming and Ubuntu Linux for everything else.

I tried and successfully installed and booted Ubuntu using BIOS Legacy mode, but failed repeatedly using EFI. After a couple of days of fooling around, I found a EFI setup which worked – WHY? Because I want to.

I’m writing this mainly because I am guaranteed to forget the procedure until the next time I try to do this. If it helps others stuck with the same problem it is just a bonus!

The main reason for not wanting to install Ubuntu and Windows to separate drives is because of this:

tormsl@eir:~$ dd if=/dev/zero of=testfile bs=1M count=20000
20000+0 records in
20000+0 records out
20971520000 bytes (21 GB) copied, 34.0132 s, 617 MB/s

I’ve just wrote this down as a list of steps, please comment on this post if there’s something wrong or you are having issues following the steps.

    • Enable RAID setup in BIOS and enter the configuration mode by pressing CTRL-I
    • Create RAID0 using both SSDs
    • Boot ubuntu live x64 and create new GPT partition table on /dev/sda using gparted or similar (not fdisk)
    • Install Windows by selecting the entire empty raid set
    • Boot ubuntu live x64 and shrink the main ntfs volume used to install windows (/dev/sda6)
    • Make sure Windows boots correctly
    • Install Ubuntu 14.04 x64 using the alternate install media
    • Create two new partitions (but do not change anything)
/dev/sda6	linux-swap
/dev/sda7	ext4
    • Install Ubuntu like normal and when asked, install Grub to “/dev/sda″
    • After the install, your machine will not be able to boot as the installation of grub has destroyed the Windows EFI boot files
    • You now need to boot the Windows 10 install DVD which starts the install process. Cancel this process by clicking the X in the first installation window. As the Windows installer closes, it should leave you at the previously installed Windows login screen. Log into windows and start the “Automatic Repair” utility as describedhere.
    • Make sure Windows boots correctly without the CD-ROM after the automatic repair process
    • Boot ubuntu live x64. We are now going to make the EFI boot process load Grub instead of the Windows bootloader.
    • After the boot, install grub-efi and grub-efi-amd64 using apt-get
    • Mount the partition of where you installed Ubuntu in the previous step to /mnt and mount the EFI partition to /mnt/boot/efi
    • sda7, in this case, is my ubuntu root partition, dsa4 is EFI partition
sudo mount /dev/sda7 /mnt
sudo mount /dev/sda4 /mnt/boot/efi
    • Install grub
sudo grub-install --root=/mnt /dev/sda
    • You should now be able to find the grub .efi binary in /mnt/boot/efi/EFI/ubuntu/grubx64.efi
    • We now need to rename the windows .efi bootfiles and replace these with the grub one.
  • If this is your first time installing the Grub or you have just repaired the Startup Windows, do the following 2 steps (to save the Windows boot manager in the other place)
sudo mv /mnt/boot/efi/EFI/Boot/bootx64.efi /mnt/boot/efi/EFI/Boot/bootx64.efi.old 
sudo mv /mnt/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /mnt/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi.old

Then overwrite the windows boot with grub boot:

sudo cp /mnt/boot/efi/EFI/ubuntu/grubx64.efi /mnt/boot/efi/EFI/Boot/bootx64.efi
sudo cp /mnt/boot/efi/EFI/ubuntu/grubx64.efi /mnt/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
    • Unmount and reboot the machine without the ubuntu-live CDROM/USB-stick. Grub should now be the primary bootloader and you should be able to boot into ubuntu.
    • In ubuntu, we need to activate the Windows 8 menu entry in Grub.
    • Edit /etc/default/grub and comment the two lines containing the word HIDDEN
    • Now, we need to find the fs_uuid of the EFI partition in order to chainload the Windows bootloader. Run the command below which will give you the fs_uuid
sudo grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi.old
    • Open the file /etc/grub.d/40_custom
sudo gedit /etc/grub.d/40_custom
    • and paste the following: (keep in mind that the <fs_uuid from previous step> is something like 24E1-54M6)
menuentry "Windows 8" {
	search --fs-uuid --no-floppy --set=root <fs_uuid from previous step>
	chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi.old
  • Run update-grub and reboot the machine.
  • You should now be able to boot into Windows using Grub.


If you loose grub after the Windows update:

Start Windows as normal.

Run cmd as Admin

list disk
select disk 0
list partition
select partition 4 (if Partition 4 is your EFI partition: 260 MB(in VAIO system))
assign letter=z

Then open a new cmd:  run the following steps (this is to overwrite the windows boot manager with the new grub file)

cd /d Z:
copy Z:\EFI\ubuntu\grubx64.efi Z:\EFI\Boot\bootx64.efi
copy Z:\EFI\ubuntu\grubx64.efi Z:\EFI\Microsoft\Boot\bootmgfw.efi



Published by

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s