public
Last active

Arch Linux UEFI Setup

  • Download Gist
uefisetup.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
# **************** READ THIS FIRST ******************
#
# This is not a script for you to run. I repeat, do not download and run this!
#
# This is only a guide to show the required steps for successful UEFI + GRUB2 installation
# Many of the choices are examples or assumptions; don't blindly type shit into your machine
# until/unless you at least read the comments around each command
#
# These steps assume you've booted in UEFI mode by preparing your USB stick per these instructions:
# https://wiki.archlinux.org/index.php/UEFI#Archiso
#
# If you're using an actual CD burned from the official Arch ISO, just make sure you've booted it in UEFI mode
 
# Assuming /dev/sda is the target disk
parted /dev/sda # or gdisk or cgdisk or etc...
# Make a partition of type EF00 (EFI System Partition, or ESP)
# Might want to name it something useful like "efi"
# Make your other partition(s) as you see fit
 
# Create ESP filesystem
mkfs.vfat -F32 -n efi /dev/sda1 # -F## is not required on most firmwares; FAT12/16 usually work
 
# In this example, I'm using btrfs
mkfs.btrfs -KL root /dev/sda2
 
# Mount the needful -- note the btrfs-specific mount options
mount -o ssd,discard,noatime,compress=lzo /dev/sda2 /mnt
mkdir -p /mnt/boot # Or /mnt/boot/efi if you *only* want the grub binary on the ESP
mount -o noatime /dev/sda1 /mnt/boot # See above
 
# Networking stuff
# ...
 
# Install as per usual, but snag grub-efi
pacstrap /mnt base base-devel grub-efi-x86_64
 
# Facestab needfuls
genfstab -pU /mnt >> /mnt/etc/fstab
 
# Chroot, and gimme some bash plox
arch-chroot /mnt /bin/bash
 
# Do other installation needfuls
# ...
 
# Bootloader install
grub-install
 
# Can check/modify UEFI firmware entries
efibootmgr # -t 0 for timeout, -b xxxx -B xxxx to delete, etc
 
# Generate grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
 
# Exit chroot
exit
 
# Rebooten Sie!
reboot

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.