- Joined
- May 15, 2006
I've been spending the last few hours taking my first steps in the wonderful world of UEFI booting. I recently built my system due to instability issues and went with pretty high end hardware. I'm currently using a Gigabyte Z77 UD5H, 3570k, 32gb RAM, Intel 180gb SSD and a 570 GTX all packed in a Lian Li 1020B. So far, the hardware has been great. So great, in fact, that I decided that my 2500k didn't deserve to live. But that isn't really related to this.
For the past few days, my poor Thinkpad T61 and Firefox have been under the strain of 70+ tabs (think molasses in a South Dakota winter), some of which are normal load (OCF) and most were research into UEFI. I quickly learned that there was no single walkthrough or guide that explained exactly what needs to be done. These fragments made it difficult to understand exactly what UEFI does and what I need to do to make it work with Linux. I pictured it somewhat of a maze. There were multiple paths and the answer was not always clear, so I had to pick one way and see if it was a dead end and retrace my steps, hoping that I hadn't fallen into a pit and trashed my progress thus far. Surprisingly, it went nearly to plan.
Initially, it was my plan to wipe my SSD of Windows completely, start with a blank drive and install Arch. This would give me the basis for a walk-through that I could post here. I fully intend to follow through with this, but I need to solve this before I can continue! So, here are the exact steps and notes I have for the install, completely unedited.
DO NOT USE THESE INSTRUCTIONS
DO NOT USE THESE INSTRUCTIONS
To make the above short, there are three actual partitions.
1) UEFI
2) /boot
3) LVM (swap, /root)
Arch was installed like normal, but "aborted" before the bootloader was installed because it wasn't required. Grub2 was installed at that point to the UEFI partition. Upon reboot, there was no entry for the operating system. You can see the missing option in the BIOS:
Ok, so earlier in my notes, you see that I expected something like this in advance, so I created a bootable UEFI shell on my flash drive. I booted to that and listed out the partitions. As expected, Arch isn't there:
I added Arch to the boot list with the following command:
It confirms finding the file and adding it to the list. I double confirmed by outputting the current list of the current boot items and Arch is listed first:
Upon restarting out of the shell, I press F12 to use the device selection screen so I can manually pick the device. "Arch Linux" is listed, as expected -- perfect! Select it and let's go!
Oh baby, look at that sexy command line with all those ASCII values. Mmmm.
Ok, just to make sure I'm being thorough and a good tester, let's restart the system to see what----WHAT. WHAT IS THIS. WHERE DID IT GO.
I frantically mash the F12 button at startup to see my precious "Arch Linux" entry missing. What right does the motherboard think it has to simply delete my operating system bootloader? I put my flash drive in again, add the entry, restart, boot the operating system, restart -- same thing. I thought about it for a few seconds and figured that maybe the removal of the flash drive is causing it to reset as the settings could be saved on that. Nope, even if I keep the flash drive in, it dumps the settings on reboot. Looking further into how UEFI works, it looks like it is supposed to keep track of hard drive changes so you don't have to. This seems to be doing the exact opposite of that.
UEFI is the true destroyer of dragons. You don't need knights for this. Help?
For the past few days, my poor Thinkpad T61 and Firefox have been under the strain of 70+ tabs (think molasses in a South Dakota winter), some of which are normal load (OCF) and most were research into UEFI. I quickly learned that there was no single walkthrough or guide that explained exactly what needs to be done. These fragments made it difficult to understand exactly what UEFI does and what I need to do to make it work with Linux. I pictured it somewhat of a maze. There were multiple paths and the answer was not always clear, so I had to pick one way and see if it was a dead end and retrace my steps, hoping that I hadn't fallen into a pit and trashed my progress thus far. Surprisingly, it went nearly to plan.
Initially, it was my plan to wipe my SSD of Windows completely, start with a blank drive and install Arch. This would give me the basis for a walk-through that I could post here. I fully intend to follow through with this, but I need to solve this before I can continue! So, here are the exact steps and notes I have for the install, completely unedited.
DO NOT USE THESE INSTRUCTIONS
Assuming completely blank hard drive
Download the shell for uefi
https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#UEFI_Shell_download_links
Rename to shellx64.efi
Reboot into liveCD
Create the GPT partition and the UEFI partition
parted /dev/sda
(parted) mklabel gpt
(parted) mkpart fat32 1049kB 250MB
(parted) mkpart ext4 250MB 500MB
(parted) mkpart ext4 500MB 100%
(parted) toggle 1 boot
(parted) toggle 3 lvm
(parted) quit
Create the fat32 partition
mkfs.vfat -F 32 /dev/sda1
Create folders and mount the partition
mkdir /boot/efi
mount /dev/sda1 /boot/efi
cd /boot/efi
Copy your UEFI shell code to the new partition, yours will probably be different - my flash drive was automounted because of how I installed the bootable disk. I could not get this to work on my Gigabyte UD5H.
cp /bootmnt/shellx64.efi /boot/efi/
While I was at it, I installed the UEFI shell code to my flash drive, but I had some work to do first.
mount -o remount,rw /bootmnt
cd /bootmnt
mkdir -p ./efi/boot
cp x64_2.0.efi ./efi/boot/bootx64.efi
Install arch like normal. Do not install the bootloader. Exit the install to the command line. We need to get Grub2 install, so some preperation is required.
cp /etc/resolv.conf /mnt/etc/resolv.conf
mount -o bind /dev /mnt/dev
mount -t proc /proc /mnt/proc/
mount -t sysfs /sys /mnt/sys/
chroot /mnt bash
pacman-db-upgrade
pacman -Syy
pacman -S grub2-efi-x86_64 efibootmgr
grub-install --directory=/usr/lib/grub/x86_64-efi --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot --recheck --debug
Download the shell for uefi
https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#UEFI_Shell_download_links
Rename to shellx64.efi
Reboot into liveCD
Create the GPT partition and the UEFI partition
parted /dev/sda
(parted) mklabel gpt
(parted) mkpart fat32 1049kB 250MB
(parted) mkpart ext4 250MB 500MB
(parted) mkpart ext4 500MB 100%
(parted) toggle 1 boot
(parted) toggle 3 lvm
(parted) quit
Create the fat32 partition
mkfs.vfat -F 32 /dev/sda1
Create folders and mount the partition
mkdir /boot/efi
mount /dev/sda1 /boot/efi
cd /boot/efi
Copy your UEFI shell code to the new partition, yours will probably be different - my flash drive was automounted because of how I installed the bootable disk. I could not get this to work on my Gigabyte UD5H.
cp /bootmnt/shellx64.efi /boot/efi/
While I was at it, I installed the UEFI shell code to my flash drive, but I had some work to do first.
mount -o remount,rw /bootmnt
cd /bootmnt
mkdir -p ./efi/boot
cp x64_2.0.efi ./efi/boot/bootx64.efi
Install arch like normal. Do not install the bootloader. Exit the install to the command line. We need to get Grub2 install, so some preperation is required.
cp /etc/resolv.conf /mnt/etc/resolv.conf
mount -o bind /dev /mnt/dev
mount -t proc /proc /mnt/proc/
mount -t sysfs /sys /mnt/sys/
chroot /mnt bash
pacman-db-upgrade
pacman -Syy
pacman -S grub2-efi-x86_64 efibootmgr
grub-install --directory=/usr/lib/grub/x86_64-efi --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot --recheck --debug
To make the above short, there are three actual partitions.
1) UEFI
2) /boot
3) LVM (swap, /root)
Arch was installed like normal, but "aborted" before the bootloader was installed because it wasn't required. Grub2 was installed at that point to the UEFI partition. Upon reboot, there was no entry for the operating system. You can see the missing option in the BIOS:
Ok, so earlier in my notes, you see that I expected something like this in advance, so I created a bootable UEFI shell on my flash drive. I booted to that and listed out the partitions. As expected, Arch isn't there:
I added Arch to the boot list with the following command:
Code:
bcfg boot add 0 fs1:\EFI\arch_grub\grubx64.efi "Arch Linux (GRUB2)"
Upon restarting out of the shell, I press F12 to use the device selection screen so I can manually pick the device. "Arch Linux" is listed, as expected -- perfect! Select it and let's go!
Oh baby, look at that sexy command line with all those ASCII values. Mmmm.
Ok, just to make sure I'm being thorough and a good tester, let's restart the system to see what----WHAT. WHAT IS THIS. WHERE DID IT GO.
I frantically mash the F12 button at startup to see my precious "Arch Linux" entry missing. What right does the motherboard think it has to simply delete my operating system bootloader? I put my flash drive in again, add the entry, restart, boot the operating system, restart -- same thing. I thought about it for a few seconds and figured that maybe the removal of the flash drive is causing it to reset as the settings could be saved on that. Nope, even if I keep the flash drive in, it dumps the settings on reboot. Looking further into how UEFI works, it looks like it is supposed to keep track of hard drive changes so you don't have to. This seems to be doing the exact opposite of that.
UEFI is the true destroyer of dragons. You don't need knights for this. Help?
Last edited: