Skip to content

Instantly share code, notes, and snippets.

@Forinil
Last active July 24, 2022 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Forinil/97877db77758b2dc9053af36aff3790d to your computer and use it in GitHub Desktop.
Save Forinil/97877db77758b2dc9053af36aff3790d to your computer and use it in GitHub Desktop.

Installing Arch linux with EFI

  1. Change keyboard layout:

    • loadkeys pl
  2. Verify boot mode:

    • ls /sys/firmware/efi/efivars (If the directory exist your computer supports EFI)
  3. Ping some site on the Internet to verify connection:

    • ping archlinux.org
  4. Update system clock:

    • timedatectl set-ntp true
    • You can verify the status with timedatectl status
  5. Create EFI partition:

    • fdisk -l to find the designation for the HDD. (Most likely /dev/sda)
    • fdisk /dev/sda
      • g (to create a new partition table)
      • n (to create a new partition)
      • 1
      • enter
      • +500M
      • t
      • 1 (for EFI)
      • w
  6. Create /root partition:

    • fdisk /dev/sda
      • n
      • 2
      • enter
      • enter
      • w
  7. Create the filesystems:

    • mkfs.fat -F32 /dev/sda1
    • mkfs.ext4 /dev/sda2
  8. Mount the new root partition directories:

    • mount /dev/sda2 /mnt
  9. Install Arch linux base packages:

    • pacstrap -i /mnt base
  10. Generate the /etc/fstab file:

    • genfstab -U -p /mnt >> /mnt/etc/fstab
  11. Chroot into installed system:

    • arch-chroot /mnt
  12. Set the timezone:

    • ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
  13. Update the Hardware clock:

    • hwclock --systohc
  14. Install boot manager and other needed packages:

    • pacman -S grub efibootmgr dosfstools os-prober mtools linux-headers linux-lts linux-lts-headers linux-firmware nano rsync reflector
  15. Run reflector

    • cp /etc/pacman.d/mirrorlist{,.bak}
    • reflector -c "XX" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
  16. Set locale:

    • sed -i 's/#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen (uncomment en_US.UTF-8)
    • sed -i 's/#pl_PL.UTF-8/pl_PL.UTF-8/g' /etc/locale.gen (uncomment pl_PL.UTF-8)
    • locale-gen
  17. Set environment

    • echo "LANG=en_US.UTF-8" >> /etc/locale.conf
    • echo "KEYMAP=de-latin1" >> /etc/vconsole.conf
    • echo "arch-linux" >> /etc/hostname
  18. Create password for root user

    • passwd
  19. Create EFI boot directory:

    • mkdir /boot/EFI
    • mount /dev/sda1 /boot/EFI
  20. Install GRUB on EFI mode:

    • grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
  21. Set up locale for GRUB:

    • cp /usr/share/locale/pl/LC_MESSAGES/grub.mo /boot/grub/locale/pl.mo
  22. Write GRUB config:

    • grub-mkconfig -o /boot/grub/grub.cfg
  23. Create swap file:

    • fallocate -l 4G /swapfile
    • chmod 600 /swapfile
    • mkswap /swapfile
    • echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
  24. Exit, unmount and reboot:

    • exit
    • umount /mnt
    • reboot
  25. Create an unpriviledged user:

    • useradd --create-home --shell /bin/bash --user-group username
    • passwd username
    • gpasswd -a username adm
    • gpasswd -a username log
    • gpasswd -a username sys
    • gpasswd -a username systemd-journal
    • gpasswd -a username wheel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment