Author Topic: [How-To] UEFI guide: Dual Boot Manjaro & Windows  (Read 11320 times)

0 Members and 1 Guest are viewing this topic.

Offline CulinaxTopic starter

  • Support Team
  • ****
  • Posts: 1146
  • Kernel: Linux315-x64
  • Desktop: Awesome 3.5
  • Branch: Unstable
  • GPU Card: NVIDIA GeForce 710M - Intel (Optimus)
  • GPU driver: Free Driver
  • Skill: Intermediate
[How-To] UEFI guide: Dual Boot Manjaro & Windows
« on: 14. October 2013, 21:44:23 »
Because there isn't any guide on either the wiki/forums about how to dual boot Manjaro and Windows on an UEFI enabled system, I decided to write a quick how-to myself, explaining how I got it to work on my own system (using GRUB). With the emphasis on how I got it to work, this does not guarantee that it will work on your system as well. Every computer is different.

Step 1: Preparation
Boot into Windows. First you'll have to disable Fast Startup. Then you have to reboot into the UEFI setup. Things you must do here are:
- Disable secure boot (you might have to set a password to do this first)
- Keep UEFI enabled
- Make sure your CD/DVD/USB/... is listed above your hard disk so it can boot from it
Then you're ready to save these settings and boot the live CD/DVD/USB/... It's a good idea to use GParted now to shrink your Windows partition already. It might be even a better idea to already create the partitions for your to-be-installed Manjaro system. Make a note of the /dev/sdXY and what you want it to be (E.g. /dev/sda4 will be root, /dev/sda5 will be home, etc.), you'll need to remember it during the installation. (Note: You don't need to create a second EFI partition).

Step 2: Installation
In the live CD/DVD/USB/... open up a terminal and enter:
Code: [Select]
sudo setup. This will launch the CLI installer (as far as I know, the GUI doesn't support UEFI). Choose the testing installer which offers EFI support.

Step 2.1: Set date and time
Windows uses localtime by default, Linux uses UTC by default. So you either choose localtime here, or you go with UTC and apply a registry fix in order to make Windows use UTC by default.

Step 2.2: Disk(s) preparation
Step 2.2.1: Partition hard drives
It'll be necessary to manually partition your hard drives, because the auto-prepare will erase your whole disk. So choose #2 Partition Hard Drives. The installer will ask you if you want to use GPT, the answer should be "Yes". After you have selected the correct disk, cgdisk will pop up. First you should find the EFI System Partition (ESP), and write down its /dev/sdXY. Now if you have already partitioned your system, that's all there is to do. If not, then it's time to creat your partitions now (Note: you don't have to create a second EFI partition):
- Select "New"
- The first sector should be correct (just press return)
- Then it asks for size in sectors, but you can use megabytes and gigabytes as well if you precede the number with a +sign and end with M or G. It's easier then it sounds, examples: to have a 200MB partition you should enter this: +200M  | to have a 50GB partition you should enter this: +50G
- The hex code or gui should be correct (just press return)
- Enter a partition name, give names that make it easy to identify the partition, such as "Manjaro Root Partition" etc. Note that you can't use the same partition name twice.
Repeat this procedure for all your partitions. When you're finished, select write to apply the changes, then quit.

Step 2.2.2: Set filesystem Mount points
Now you'll need to grab your list with your /dev/sdXY stuff (or access your memory). First you'll have to select the partition to use as swap. Then root (/).
- Select a filesystem: Ext4 is considered most stable right now, but this is completely up to you
- Then it asks if you want to create it, better would be: do you want to format this partition. Choose "yes" (unless you know what you're doing)
- Now you'll have to enter a partition label. Similarly to the partition name in cgdisk, choose something that makes sense and makes it easy to identify it.
- Additional options: It's okay to leave this empty.
Then mount the other partitions just as you did with root. The only extra thing you'll have to do is entering a mount point (e.g. /home). Last but not least you'll have to select the EFI system partition. These are 3 simple but important steps:
- Mount point: /boot/efi
- Filesystem: VFAT
- Would you like to create a filesystem: NO
Now you're done, so press done. You'll get a last a time to review your partition scheme. Then it will ask for the device name scheme: PARTUUID is recommended.

Step 2.3: Install System
Wait...

Step 2.4: Configure System
Set root password, setup user, configure other things as you like.

Step 2.5: Install Bootloader
Go with UEFI x86_64, then GRUB(2) x86_64 UEFI. When it asks you to copy grubx64.efi to bootx64.efi, say yes. Now the installation is finished, but don't shutdown the live CD/DVD/USB/... yet.

Step 3: Post installation
The installer, for some reason, does not install grub correctly. To do this you will have to chroot into your newly installed sytem. Note: only follow the instructions under the subtitle "Identify and Prepare the Installed Partition(s)" except for the installation of mtools which is most likely not needed, the next subtitle "restore grub" is not relevant for this guide.
So now that you have successfully chrooted into your system, you'll have to install grub once again, correctly this time:
Code: [Select]
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug
sudo update-grub
Now that the last step of the installation is finished, we can exit the chrooted environment, unmount, and reboot.
Code: [Select]
exit
umount -R /mnt
reboot
If everything works all right, then you'll see GRUB after rebooting.

If you have any questions, notes, remarks, more helpful tips towards other people: please post them!
Manjaro Awesome WM Respin: Current version: 0.8.10
Belgian/Dutch Manjaro Linux users: unite! http://manjaro-nl.org/ | IRC: #manjaro-nl

Offline Darth_Yoshi

  • Neuling
  • *
  • Posts: 2
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #1 on: 17. October 2013, 19:54:41 »
This is a really nice guide, but what do you mean by we don't have to create a second EFI partition?

Offline CulinaxTopic starter

  • Support Team
  • ****
  • Posts: 1146
  • Kernel: Linux315-x64
  • Desktop: Awesome 3.5
  • Branch: Unstable
  • GPU Card: NVIDIA GeForce 710M - Intel (Optimus)
  • GPU driver: Free Driver
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #2 on: 17. October 2013, 20:57:19 »
This is a really nice guide, but what do you mean by we don't have to create a second EFI partition?

That was a mistake I made myself when trying to install Manjaro. The UEFI wiki article says to create another ESP, but Windows already creates one itself. The problem is that only the first ESP was run, the newly created one was just ignored. But when I installed GRUB on the original ESP of Windows instead of creating another (second) one, everything worked fine.

I have no idea if multiple ESPs are actually supported, but from the research I did it seems like it's not a good idea to do it because it most likely won't work.

Ofcourse it's highly recommended to back-up the original ESP before you install GRUB on it, just in case something goes wrong.
Manjaro Awesome WM Respin: Current version: 0.8.10
Belgian/Dutch Manjaro Linux users: unite! http://manjaro-nl.org/ | IRC: #manjaro-nl

Offline Darth_Yoshi

  • Neuling
  • *
  • Posts: 2
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #3 on: 18. October 2013, 04:59:45 »
Thank You :D
That cleared things up, I'll see if you do or don't have to have 2 boot partitions and if you can just use the Windows one.

Offline fassil

  • Sr. Mitglied
  • ****
  • Posts: 453
  • Kernel: Linux314 & 318
  • Desktop: E17/E19
  • Branch: stable/unstable
  • GPU Card: Nvidia ION/Intel
  • GPU driver: free
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #4 on: 18. October 2013, 10:35:07 »
Hi Culinax,

Every computer is different, but what's your own one ?  ;)

I just finalised a dual-boot 8/Manjaro "full EFI" on a Hp (Oem) & I totally agree with your how-to, except that instead of chroot to reinstall grub, I used rEFInd as boot-manager for choosing on which Os the boot goes on.

A +
"Are you enlightened ?"
Decompressing Linux... Parsing ELF ...Done.

Offline CulinaxTopic starter

  • Support Team
  • ****
  • Posts: 1146
  • Kernel: Linux315-x64
  • Desktop: Awesome 3.5
  • Branch: Unstable
  • GPU Card: NVIDIA GeForce 710M - Intel (Optimus)
  • GPU driver: Free Driver
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #5 on: 18. October 2013, 11:38:16 »
Hi Culinax,

Every computer is different, but what's your own one ?  ;)

I just finalised a dual-boot 8/Manjaro "full EFI" on a Hp (Oem) & I totally agree with your how-to, except that instead of chroot to reinstall grub, I used rEFInd as boot-manager for choosing on which Os the boot goes on.

A +

My laptop is an Acer Aspire V5 (or something like that).

I used GRUB2 because it seems to be the default option in Manjaro. Recently I read that GRUB2 is actually the worst choice for UEFI systems because it's not reliable enough. Therefore rEFInd would be a much better alternative. I'll read a bit about it, and see if I got the guts to try it on my own laptop. If it works then I'll add it to this guide.
Manjaro Awesome WM Respin: Current version: 0.8.10
Belgian/Dutch Manjaro Linux users: unite! http://manjaro-nl.org/ | IRC: #manjaro-nl

Offline ringo32

  • Core Team
  • *****
  • Posts: 8104
  • Community site Dutch Language : www.manjaro-nl.org
    • Manjaro Belgium + forum
  • Kernel: linux316 linux319
  • Desktop: I3-Xfce
  • Branch: unstable
  • GPU Card: Nvidia Geforce 8600 GT (acer 23inch)
  • GPU driver: free+nouveau-fw
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #6 on: 18. October 2013, 11:56:37 »
you can do first an try out in vbox :) is not real but can help some understanding before you work in days on issues :)

check !! [irc support @ freenode] #manjaro

Offline fassil

  • Sr. Mitglied
  • ****
  • Posts: 453
  • Kernel: Linux314 & 318
  • Desktop: E17/E19
  • Branch: stable/unstable
  • GPU Card: Nvidia ION/Intel
  • GPU driver: free
  • Skill: Intermediate
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #7 on: 18. October 2013, 14:08:35 »
Yep, it works & it's the only one I know wich do the job...(a kind of GAG !)

I tried Easybcd, doesn't work in "full EFI", bcdedit, not documented enough, gummiboot, doesn't want to install on EFI sys...

rEFInd with efibootmgr & a little touch of bcdedit in the "elevated terminal without mdp"  :o works fine. There's only a mistaken not simple command line about efibootmgr in the ArchWiki, where Y is the number of the $esp partition, 2 on the f.....g Oem partitioning I used to put Manja inside  ;).

A +
« Last Edit: 18. October 2013, 17:36:18 by fassil »
"Are you enlightened ?"
Decompressing Linux... Parsing ELF ...Done.

Offline lewyssmith

  • Neuling
  • *
  • Posts: 17
  • Kernel: None yet
  • Desktop: None yet
  • Branch: None yet
  • GPU Card: AMD/Radeon HD7310
  • GPU driver: None yet
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #8 on: 19. November 2013, 12:59:56 »
There seems to be a lot of misunderstanding about EFI among some of the responses. The principle is quite neat: The (GPT) disc has a dedicated "EFI System Partion" = ESP, formatted FAT32, with a top-level directory \EFI\. On a system delivered with Win8, and conventionally anyway, this is partition 1 or 2. Each installed OS has its own directory within. It is structured:

\EFI
 \Boot
  bootx64.efi
 \Microsoft
   \Boot\
   bootmgfw.efi
   bootmgr.efi
 \linuxdist\
  bootloader.efi
e.g.
 \manjaro_grub\
  grubx64.efi

although directories may have many more files & sub-directories. But this is only half the story, for the EFI NVRAM has a list of installed OS's numbered nnnn which contains their name and the path to their bootloader; and a BootOrder list refering to them (which can be overriden for one boot only by NextBoot). \EFI\ is manipulated as for a normal mounted filesystem - conventionally but not compulsorily on /boot/efi/ or /boot/EFI/ in Linux; NVRAM is manipulated with the efibootmgr command - you may have to do 'modprobe efivars' before using it. Do
 efibootmgr -v
and all is revealed, largely self-explanatory.

The file \EFI\Boot\bootx64.efi is the default bootloader, nearest equivalent to the old MBR, and will be preset to Microsoft's bootmgfw.efi. The EFI rules say, I believe, that on startup without intervention it *should* try in order:
- BootNext
- BootOrder list
- \EFI\Boot\bootx64.efi
but much depends on the individual EFI BIOS, some at least of which boot \EFI\Microsoft\Boot\bootmgfw.efi come what may.

Even before this, EFI computers should have a key to press (very quickly; mine is F12) at startup to show an EFI boot menu. This may include bootable hardware - the disc should load the default bootloader \EFI\Boot\bootx64.efi - and *an entry for each OS in their BootOrder*. These should go directly to the OS's bootloader as defined in its NVRAM entry, typically \EFI\distribution\grubx64.efi .

So there is a lot of flexibility. Much depends on the behaviour of your EFI BIOS, and how much you want to multi-boot, and who will control it. Multiple Linux's via Grub have a tendancy to always want to take control of the computer, competing with each other. My advice from years of multi-booting several Linux's is to use an independant boot manager. On my MBR box, with DOS in its first partition, the NT bootloader (no Windows!) has served me well. On EFI I recommend rEFInd, but Gummiboot may do as well. I have 4 1/2 Linux's installed & working alongside Win8, which I had a lot of trouble stopping loading automatically.

Linux installs should normally limit themselves to installing their own stuff in \EFI\distribution\  , usually grubx64.efi ; but that relies on booting them by one of the methods noted. It is just about OK if they put their bootloader as \EFI\Boot\bootx64.efi - after backing up what was there before - if it is just Win8 + 1 Linux. But rEFInd (or Gummiboot?) wins hands down; it finds dynamically available OS's *which do not even need to put themselves in NVRAM* - but in \EFI\ certainly yes.It does not even need its config file, although one can be useful.

Hope this all helps, and perhaps the How-To might absorb some of my rants.

Lewis

Offline aralmim

  • Jr. Mitglied
  • **
  • Posts: 89
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #9 on: 22. November 2014, 10:49:03 »
I installed everything like in the guide but no luck
« Last Edit: 22. November 2014, 12:48:41 by aralmim »

Offline aralmim

  • Jr. Mitglied
  • **
  • Posts: 89
Re: [How-To] UEFI guide: Dual Boot Manjaro & Windows
« Reply #10 on: 22. November 2014, 12:46:59 »
Hi, can you help me with this problem ? You will find in the attachment.
It showed after I installed the system in to a efi laptop.