You are not logged in.

#1 2014-11-06 20:00:28

toni
Member
Registered: 2011-10-15
Posts: 437

Enabling UEFI on an existing installation of archlinux

Hi,

I have an external USB HDD with below structure on which I have installed arch:

sdc1 -> Grub bios partition (2MB)
sdc2 -> \boot partition
sdc3 -> LVM for the rest of hdd

Also I use GPT.

Also I have Windows 8.1 that comes with my new laptop so I use dual boot.

In system BIOS, I have disabled secure boot, so I have two scenarios:

1) When I select UEFI mode from system BIOS, Windows 8.1 boots but not archlinux
2) When I select Legacy BIOS (CSM) mode from system BIOS, Windows 8.1 does not boot but archlinux does.

As far as I know the problem is that Windows 8.1 uses UEFI-GPT by default and my archlinux is currently set to BIOS-GPT so I would like to switch my archlinux from BIOS-GPT to UEFI-GPT. Is that possible? If so, Could you indicate me on how to proceed?

Offline

#2 2014-11-06 20:34:45

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: Enabling UEFI on an existing installation of archlinux

Assuming you're using a GPT partition table on the external USB HDD, I don't think you should have any problems by creating a EFI system partition on the external disk.

However, I'm not well versed with UEFI, so that's as much advice as I can give.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2014-11-06 21:12:25

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

Your /boot partition needs to be FAT(32)-formatted (512MiB is recommended).

You will need to use an Arch live .iso to boot up in EFI mode and then (arch-)chroot into your installation to install a bootloader/manager.

I would recommend using gummiboot as a boot manager.

Offline

#4 2014-11-06 21:40:57

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:

Your /boot partition needs to be FAT(32)-formatted (512MiB is recommended).

You will need to use an Arch live .iso to boot up in EFI mode and then (arch-)chroot into your installation to install a bootloader/manager.

I would recommend using gummiboot as a boot manager.


Can I do the following?

1) Remove my existing Grub bios partiton as it is no longer needed.
2) using gparted, create an EFI partition formated as FAT32 and set boot flag to it
3) Using an arch live cd, boot up in EFI mode, then do a (arch-)chroot into my current installation and re-installing again GRUB bootloader.

Offline

#5 2014-11-06 21:57:22

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

1) Yes, but why not keep it? I have both on mine and there is no interference.
2) Create an EFI system partition and format it as FAT (either 16 or 32). I would recommend using gdisk rather than gparted -- make sure the "partition type" is set as "EF00": this is what your firmware uses to identify it as the ESP. I don't use gparted (CLI FTW!), so I'm not sure about "boot flags"...
3) Yes, but gummiboot is much easier and uses EFISTUB to boot the kernel natively without needing a bootloader.

Offline

#6 2014-11-06 23:25:21

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:

1) Yes, but why not keep it? I have both on mine and there is no interference.
2) Create an EFI system partition and format it as FAT (either 16 or 32). I would recommend using gdisk rather than gparted -- make sure the "partition type" is set as "EF00": this is what your firmware uses to identify it as the ESP. I don't use gparted (CLI FTW!), so I'm not sure about "boot flags"...
3) Yes, but gummiboot is much easier and uses EFISTUB to boot the kernel natively without needing a bootloader.

Is it mandatory to boot up arch live cd in EFI mode? or can I boot up arch live cd in legacy BIOS mode (CSM)? and then perform arch-chroot.

Offline

#7 2014-11-07 10:49:28

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Enabling UEFI on an existing installation of archlinux

If you don't load arch live cd in EFI, then the appropriate firmware drivers will not be loaded and efibootmgr will not be able to create an EFI boot option for arch. I honestly don't think you'll be able to fix this without booting in EFI.

Offline

#8 2014-11-07 11:21:30

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: Enabling UEFI on an existing installation of archlinux

I've been meaning to do the same thing, but isn't reformating /boot as FAT32 (instead of current ext4) going to require a new installation? I never tried formating /boot without formating / (Or vice versa).

Offline

#9 2014-11-07 20:14:23

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Buddlespit wrote:

If you don't load arch live cd in EFI, then the appropriate firmware drivers will not be loaded and efibootmgr will not be able to create an EFI boot option for arch. I honestly don't think you'll be able to fix this without booting in EFI.

Ok, thanks, so I will boot up archlinux in efi. Could you tell me how to boot up archlinux live cd in EFI mode? Which is the parameter/option I have to type when archlinux live cd boots up?
I have been searching for this information but with no luck.

Offline

#10 2014-11-07 20:19:50

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:

1) Yes, but why not keep it? I have both on mine and there is no interference.
2) Create an EFI system partition and format it as FAT (either 16 or 32). I would recommend using gdisk rather than gparted -- make sure the "partition type" is set as "EF00": this is what your firmware uses to identify it as the ESP. I don't use gparted (CLI FTW!), so I'm not sure about "boot flags"...
3) Yes, but gummiboot is much easier and uses EFISTUB to boot the kernel natively without needing a bootloader.

Regarding point 1, if I do not remove the existing bios partition when I create EFI one and I install gummiboot, the 2 partitions will coexist together so does it mean that I can boot up in CSM or EFI mode depending on what type of boot mode is set in BIOS system? I mean, if CSM is set in BIOS system, then it will boot using traditional CSM mode, otherwise, if UEFI is set in BIOS system, then it will boot using EFI mode. Am I right?

Offline

#11 2014-11-07 21:14:44

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

^ Yes.

I find it useful when trying out other live distro's that cannot boot in EFI-mode -- I always forget to change the firmware settings back when I reboot Arch...

Offline

#12 2014-11-07 21:19:25

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

toni wrote:
Buddlespit wrote:

If you don't load arch live cd in EFI, then the appropriate firmware drivers will not be loaded and efibootmgr will not be able to create an EFI boot option for arch. I honestly don't think you'll be able to fix this without booting in EFI.

Ok, thanks, so I will boot up archlinux in efi. Could you tell me how to boot up archlinux live cd in EFI mode? Which is the parameter/option I have to type when archlinux live cd boots up?
I have been searching for this information but with no luck.

If you have disabled CSM from your firmware, the .iso will boot up in EFI-mode automatically.

You can check by seeing if `efivar -l` returns a long list of EFI variables.
https://wiki.archlinux.org/index.php/EFI#UEFI_Variables

Last edited by Head_on_a_Stick (2014-11-07 21:20:41)

Offline

#13 2014-11-08 12:56:42

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:
toni wrote:
Buddlespit wrote:

If you don't load arch live cd in EFI, then the appropriate firmware drivers will not be loaded and efibootmgr will not be able to create an EFI boot option for arch. I honestly don't think you'll be able to fix this without booting in EFI.

Ok, thanks, so I will boot up archlinux in efi. Could you tell me how to boot up archlinux live cd in EFI mode? Which is the parameter/option I have to type when archlinux live cd boots up?
I have been searching for this information but with no luck.

If you have disabled CSM from your firmware, the .iso will boot up in EFI-mode automatically.

You can check by seeing if `efivar -l` returns a long list of EFI variables.
https://wiki.archlinux.org/index.php/EFI#UEFI_Variables

thanks, very much. I have formatted my USB stick using Rufus and add archlinux iso to it.
I have successfully booted into archlinux live cd in UEFI mode.

Offline

#14 2014-11-08 13:13:44

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Hi, all!

I have performed below steps in order to get archlinux booting using UEFI but without success:

1) I have created an EFI partition formatted as FAT32 at the end of the disk of about 1GB using gparted software. Also using gparted I have set flags to boot and esp for this new partition.
2) I have created an UEFI USB boot device using rufus software and I have added archlinux live cd
3) I reboot my system and it boots up from the USB where there is archlinux live cd iso. I archlinux main menu, I select first option, that with UEFI support
4) Once in archlinux prompt I ensure I have booted in UEFI mode by typeing "efivar -l". Ok, no problem I am in UEFI mode.
6) I create a folder: mkdir mnt
7) I mount my partitions in it, for example, my root (LVM logical volume in /dev/sdx3) in /mnt, my home (LVM logical volume in /dev/sdx3) in /mnt/home, my var (LVM logical volume in /dev/sdx3) in /mnt/var and my EFI system partition /dev/sdx4 in /mnt/boot (see additional information at the end of this post)
8) I perform a chroot by typing: arch-chroot /mnt
9) Before installing gummiboot, I copy below files from my old \boot partition (I have not removed GRUB bootloader that still remains here):

    vmlinuz-linux
    initramfs-linux-fallback.img
    initramfs-liinux.img

   to my current \boot partition where my new EFI partition is. These files is needed to be in \boot partition before instaling gummiboot as it is said here: https://wiki.archlinux.org/index.php/Gummiboot


10) Then I install gummiboot using: pacman -S gummiboot
    - gummiboot is installed correctly, no errors shown -

    Its output is:
    Copied /usr/lib/gummiboot/gummibootx64.efi to /boot/EFI/gummiboot/gummibootx64.efi
    Created EFI boot entry "Linux Boot Manager"
    :: Run 'usr/bin/gummiboot install' to make gummiboot your default boot loader

11) So as advised in the previous step I execute:
      usr/bin/gummiboot install'

      and its output is:
     Created /boot/EFI/Boot
     Created /boot/loader/entries
     Copied /usr/lib/gummiboot/gummibootx64.efi to /boot/EFI/gummiboot/gummibootx64.efi
     Copied /usr/lib/gummiboot/gummibootx64.efi to /boot/EFI/Boot/Bootx64.EFI
     Created EFI Boot entry "Linux Boot Manager"

12) I mount /boot partition permanently to /etc/fstab (boot partition points to my new EFI System partition created in step 1.
    I add the following line in /etc/fstab:

   DED6-7DD2 /boot vfat rw,relatime,data=ordered 0 2

13) exit arch-chroot by typing exit
14) I unmount all the partitions that were mounted in step 7
15) I restart my laptop

My laptop boots up and I can see it is accessing to my external usb hdd because it is blinking but a black screen is shown all the time and after some time, my laptops reboots again and boots up Windows 8.1.

Any ideas?

Additional Information:

My external USB HDD partitions are:
- /dev/sdx1   2M        Bios Boot <------ this is my old GRUB Bios partiton as indicated at the beginning of this post - I have not removed -
- /dev/sdx2   1G        Microsoft basic data <---- this is my old \boot partition as indicated at the beginning of this post - I have not removed -
- /dev/sdx3  296.1G  Linux LVM
- /dev/sdx4   1G        EFI System

Last edited by toni (2014-11-08 16:21:51)

Offline

#15 2014-11-08 17:57:58

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

Have you created a menu entry for Arch:
https://wiki.archlinux.org/index.php/Gu … ot_entries
Also, have a look a /boot/loader/loader.conf for the default menu entry & timeout.

Offline

#16 2014-11-08 21:09:46

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:

Have you created a menu entry for Arch:
https://wiki.archlinux.org/index.php/Gu … ot_entries
Also, have a look a /boot/loader/loader.conf for the default menu entry & timeout.

Below is my gummiboot configuration.

File /boot/loader/loader.conf has the following content:

timeout 3
default 64f986c181c745629a2a95072bba9422-*

What is the number in default referring to?

I had not created any menu entry for arch in /boot/loader/entries

Now I have added one called 64f986c181c745629a2a95072bba9422-archlinux.conf in  /boot/loader/entries with below content:

title        Arch Linux
linux      /vmlinuz-linux
initrd      /initramfs-linux.img
options  root=UUID=b43132f0-7cee-4d3a-a634-40f3ce4f133f rw

Using blkid command I obtain all the information of my devices:

blkid

My root UUID according above command is:

UUID = b43132f0-7cee-4d3a-a634-40f3ce4f133f

also I have tried:

title        Arch Linux
linux      /vmlinuz-linux
initrd      /initramfs-linux.img
options  root=/dev/mapper/VolGroup00-lvolroot rw

but it is not working.  No gummiboot menu is shown even if during boot I press space bar sad Screen remains all the time black and then after a few seconds machines is rebooted and booted up into windows 8.1

Notes:
I have indicated /vmlinuz-linux in linux parameter as vmlinuz-linux is in /boot. Also I have checked vmlinuz-linux without '/' with no success
I have indicated /initramfs-linux.img in initrd parameter as initramfs-linux.img is in /boot. Also I have checked initramfs-linux.img without '/' with no success

My external USB HDD has below layout:

/dev/sdx1 -----> BIOS boot
/dev/sdx2 -----> Microsoft basic data
/dev/sdx3 -----> Linux LVM
/dev/sdx4 -----> EFI system

And my /dev/sdx3 which is a Linux LVM partition contains below logical volumes:

  ---> VolGroup00-lvolswap
  ---> VolGroup00-lvolhome
  ---> VolGroup00-lvolroot <----- This is my root
  ---> VolGroup00-lvolvar

Am I right? What am I doing wrong?

Additional information:
Once chrooting (arch-chroot), If I type below command:

zgrep CONFIG_EFI /proc/config.gz

Its output is:

CONFIG_EFI_PARTITION=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y
# CONFIG_EFI_VARS is not set
CONFIG_EFI_RUNTIME_MAP=y
CONFIG_EFI_RUNTIME_WRAPPERS=y
CONFIG_EFIVAR_FS=y

Also I have mounted efivars in /etc/fstab and my /boot partition ( ESP partition -EFI system-) by adding to it below lines:

efivarfs    /sys/firmware/efi/efivars    efivarfs    defaults    0 0
UUID=DED6-7DD2    /boot    vfat    rw,relatime,data=ordered    0 2

According to blkid command my UUID and PARTUUID for my /boot partition, that is ESP partition (EFI system),  are:

UUID = DED6-7DD2
PARTUUID = 1af51a36-df2b-48ce-b0df-727d1dacdf30

Last edited by toni (2014-11-09 14:31:26)

Offline

#17 2014-11-09 18:28:44

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

As far as LVM goes, I don't use it and I haven't a clue sorry.

FWIW it works fine with a non-LVM system if you craete an arch.conf file with the content of your first attempt (& change that alphanumeric string for "arch").
Everything else looks fine, it's just a question of finding the syntax to communicate the correct location of your root filesystem in the LVM block to gummiboot...

Offline

#18 2014-11-09 18:41:09

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:

As far as LVM goes, I don't use it and I haven't a clue sorry.

FWIW it works fine with a non-LVM system if you craete an arch.conf file with the content of your first attempt (& change that alphanumeric string for "arch").
Everything else looks fine, it's just a question of finding the syntax to communicate the correct location of your root filesystem in the LVM block to gummiboot...

I have just changed that weird alphanumeric string to arch. Now gummiboot configuration file in /boot/loader/entries is called arch.conf
Also file /boot/loader/loader.conf is pointing to the correct arch.conf file using: default arch

But it does not work, the same behaviour, black screen, no gummiboot menu even if I press space bar. As you have said, it seems a problem for gummiboot to locate the correct location of my root filesystem. Using /dev/mapper/VolGroup00-lvlroot or its UUID is not working.

I am not sure if gummiboot supports LVM..... in its wiki it is not said nothing about it.....

Offline

#19 2014-11-09 18:45:03

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Enabling UEFI on an existing installation of archlinux

Please continue this query in the other thread you have created for it.

https://bbs.archlinux.org/viewtopic.php?id=189642

Offline

#20 2014-11-09 18:58:22

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Enabling UEFI on an existing installation of archlinux

Head_on_a_Stick wrote:

Please continue this query in the other thread you have created for it.

https://bbs.archlinux.org/viewtopic.php?id=189642

Ok, as it is an issue related to gummiboot when booting, I will continue posting there.

Offline

Board footer

Powered by FluxBB