Skip to content

Instantly share code, notes, and snippets.

@volosincu
Last active December 5, 2024 06:03
Show Gist options
  • Save volosincu/70396b370667f0d2c6b847c29c6b1f18 to your computer and use it in GitHub Desktop.
Save volosincu/70396b370667f0d2c6b847c29c6b1f18 to your computer and use it in GitHub Desktop.
Arch linux UEFI installation guide

Arch Linux UEFI installation guide

1) Partitioning

a) create partitions using a tool like gdisk, cfdisk .... (more about partitioning )

b) after partifioning we must build the filesystems on the devices (format partitions) using mkfs

   
       mkfs.vfat -F 32 /dev/sdX1  // format efi-boot partition as FAT 32 
       mkfs.ext4 /dev/sdX2  
       mkfs.ext4 /dev/sdX3
       mkswap /dev/sdX4
   

$ lsblk -f lists information about all available or the specified block devices with info about filesystems

  *lsblk won't show the PARTITION-TYPE but we must be sure we used the corect code when creating the partitions

the partitions look something like that after 1.a and 1.b :

                   SIZE   MOUNT-POINT   PARTITION-TYPE   FILESYSTEM
      
       sdX1      512M   /boot         ef00             vfat
       sdX2      30G    /root         8300             ext4
       sdX3      900G   /home         8300             ext4
       sdX4      12G     swap         8200             swap
      

2) Mount partitions


   
       $ mount /dev/sda2 /mnt
   $ mkdir -p /mnt/boot/efi
   $ mount -t vfat /dev/sda1 /mnt/boot/efi
    
   $ mkdir /mnt/home
   $ mount /dev/sda3 /mnt/home
    
   $ swapon /dev/sda4

3) Installation

... now let's begin the system installation

*configure mirrorlist to use the fastest local mirror

$ cp /mnt/etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist.back 
$ sed -i 's/^#Server/Server/' /mnt/etc/pacman.d/mirrorlist.back 
$ rankmirrors -n 17 /mnt/etc/pacman.d/mirrorlist.back > /mnt/etc/pacman.d/mirrorlist 
$ pacstrap -i /mnt base base-devel 

4) Configuration

$ genfstab -U -p /mnt >> /mnt/etc/fstab  // define in fstab how disk partitions should be mounted into the filesystem
$ arch-chroot /mnt /bin/bash  // change root
$ pacman -S bash-completion 
$ vi locale.gen 
  ro_RO.UTF-8  #uncomment your language 
$ locale-gen 
$ echo LANG=ro_RO.UTF-8 > /etc/locale.conf
$ export LANG=ro_RO.UTF-8 
$ ln -s /usr/share/zoneinfo/Europe/Bucharest > /etc/localtime 
$ hwclock --systohc --utc 
$ systemctl enable dhcpcd.service  // get an ip address(check here for wireless networks)

5) Configure Boot

configure uefi grub

$ pacman -S grub efibootmgr 
$ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch-grub --root-directory=/ /dev/sdX2 --recheck --debug  
$ grub-mkconfig -o /boot/grub/grub.cfg 

6) Reboot

$ exit  // to exit the chroot 
umount partitions
   
       $ umount /dev/sdX3     //home mountpoint
       $ umount /dev/sdX1     //boot/efi mountpoint
       $ umount /dev/sdX2     //root mountpoint 
       $ swapoff /dev/sda4
   
$ reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment