Tuesday, 5 February 2013

Installing Ubuntu 12.04

As an Asus Laptop fan from the early days, I rewarded myself recently with the new Asus UX51VZ-XH71 as soon as it was out here in Canada.

This laptop comes with Windows 8 Pro out of the box and I want to setup dual boot since my spouse is more comfortable overall with Windows. (She can use Ubuntu but not convinced yet, have to work harder on that...)

To make a short story, the laptop comes pre-configured with a "fake" RAID 0 array and Windows 8 EFI boot, so the idea here is to find a way to install Ubuntu on the same raid array without blowing Windows 8 installation and recovery partition...
Go !

1) Boot into Windows 8, go to Manage/Disk Manager and remove partition associated with D: which takes half of the total space and is empty... and which is therefore a good candidate for installing Ubuntu on it !

2) Download Ubuntu 12.04.1 LTS Alternate iso here : http://releases.ubuntu.com/precise/ubuntu-12.04.1-alternate-amd64.iso (required to detect the "fake" RAID 0 array)

3) Follow instructions here : https://help.ubuntu.com/community/Installation/FromUSBStick to build a bootable USB stick

Note : First I used Universal USB installer in Windows to create it but then I ran into this bug : https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1041911
My advice here to to build the stick from another Ubuntu machine using dd in command line or "Startup Disk Creator" in Applications/System

4) Boot on the USB stick (to change boot priorities or to select an UEFI device to boot from, hit F2 at boot). At some point the installation will ask if you want to load RAID drivers, say YES and the installer will be able to read partitions on the array. I personally used the option "use the largest contiguous space" when the installer asked me on which partition to install. Next. Next. Ubuntu is installed.

5) When you will reboot, you should now have a GRUB menu that pops up with both Ubuntu & Windows 8 entries.  At this point Ubuntu entries work, Windows 8 don't !
And the only way to boot Windows 8 for now is to hit F2 at startup and select "Windows Boot Manager" in the list of UEFI devices.

6) Don't panic, we are going to fix this. os-prober actually generates bad entries in the Grub menu and we need to tweak this for UEFI support as well.

7) Boot up Ubuntu. Open a terminal and run :

sudo apt-get install grub2

sudo vi /etc/default/grub and add GRUB_DISABLE_OS_PROBER=true at the end

8) Search for the magic String !
This command :

sudo grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

will output a String like XXXX-XXXX, copy it and then create a custom menu entry for Windows 8 with sudo vi /etc/grub.d/40_custom like this :

menuentry "Microsoft Windows_8" {
    search --fs-uuid --no-floppy --set=root XXXX-XXXX
    chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

9) Run sudo update-grub2 so that the menu entries gets regenerated

10) Reboot and enjoy !

P.S. : Thanks to smaug____ from the notebookreview.com forums for figuring most of this out (for Fedora) based on this thread : http://forums.fedoraforum.org/showthread.php?t=287725

4 comments:

  1. Hello
    I love your guide, keep up the work!

    I am new owner of ux51vz and I feel quite excited. The only thing I did not understand is: how can I manage the raid0 thing?
    You talked about a "fake" raid0.. what do you mean?

    Intel normally makes you access from boot or from Rapid Storage tool to the raid0 configuration.. but from what I saw on the official guide there should be some options that here are missing! In other words, there is no way to change the raid0 config.. at least not from here.

    Anyway, do you know what the 16GB partition (second raid0 in the array) is meant for?

    Do you know if it is possible to break and eventually redo the whole raid0 thing? I really don't like chains like this :D

    ReplyDelete
  2. Hi Dario, thanks for your comment.
    Regarding fakeraid, I invite you to read this page for more background :
    https://help.ubuntu.com/community/FakeRaidHowto

    The 16GB partition you are referring to is most probably the recovery partition for Windows 8.

    I believe you can break the fakeraid from the BIOS (backup what you need before of course) and reinstall a Software RAID in case you don't intend to use the laptop in a dual boot environment.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  3. Thank you for your answer. I read the page carefully. What I could understand is that basically FakeRaid is a SoftRaid managed from BIOS, so:
    - if I want to dual boot win and linux, keep fakeraid and install them on same partition (which is the win partition)
    - if you want ubuntu ONLY, break raid, install ubuntu and recreate softraid from it
    did I get to the right conclusion? :D


    Anyway, in UX51VZ the partition configuration is:

    RAID0SYS:
    300MB | 100MB | 50MBresv | WIN | 20GB

    RAID0RECV:
    16GB

    Since I have reinstalled Win8 without breaking the raid, I preferred to do a "restore media" and therefore delete the recovery part, which I found out was the 20GB one.
    Now the 16GB result to be invisible from Win8 and completely unallocated instead. After a bit of research I found out that it is blank space reserved by Intel to overcame the problem of ssd degradation in time (simply, locations that will never be used, so you could unlock them in the future).

    But then, it is still unclear to me.. is this common in raid systems?

    ReplyDelete