Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Last active March 13, 2018 08:53
Show Gist options
  • Save joseluisq/380458dc764a060066b381c4ff1c9942 to your computer and use it in GitHub Desktop.
Save joseluisq/380458dc764a060066b381c4ff1c9942 to your computer and use it in GitHub Desktop.
Arch Linux USB flash installation media.

Arch Linux EFI Install Guide

Arch Linux USB flash installation media.

Reference: USB_flash_installation_media

BIOS and UEFI bootable USB

  1. Download the Arch Linux ISO image, see https://www.archlinux.org/download/

  2. Identify the USB device:

df -h
  1. UEFI bootable USB:

Linux:

sudo dd bs=4M if=/home/joseluisq/Downloads/archlinux-2018.03.01-x86_64.iso of=/dev/sdb1 status=progress

Note: /dev/sdb1 is my connected USB device.

Windows:

https://rufus.akeo.ie/

Installation

Note: Before installation, You should have partitioned your hard drive. See https://wiki.archlinux.org/index.php/Partitioning

  1. Internet connection via WPA:
iw dev
iw dev wlan0 link
ip link set wlan0 up
wpa_supplicant -B -i interface -c <(wpa_passphrase MYSSID passphrase)
dhcpcd wlan0
  1. Formatting partitions
mkfs.fat -F32 /dev/sda1
mkswap /dev/sda2
swapon /dev/sda2
mkfs.ext4 /dev/sda3
  1. Mounting partitions
mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
  1. Configure pacman mirrorlist
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
sed -i "s/^#Server/Server/" /etc/pacman.d/mirrorlist.bak
rankmirrors -n 6 /etc/pacman.d/mirrorlist.bak > /etc/pacman.d/mirrorlist
  1. Install base system
pacstrap -i /mnt base base-devel
  1. Create fstab file
genfstab -U -p /mnt >> /mnt/etc/fstab
  1. Enter to system
arch-chroot /mnt
  1. Configure language and time
# Uncomment the system language
nano /etc/locale.gen
locale-gen
echo LANG=es_ES.UTF-8 > /etc/locale.conf
export LANG=es_ES.UTF-8
ln -s /usr/share/zoneinfo/Europe/Berlin > /etc/localtime
hwclock --systohc --utc
systemctl enable fstrim.timer
  1. Add a host name
echo quintana > /etc/hostname
  1. Enable pacman package repositories
nano /etc/pacman.conf

Go to the end of the file and add or update like:

- #[multilib]
- #Include = /etc/pacman.d/mirrorlist

+ [multilib]
+ Include = /etc/pacman.d/mirrorlist

+ [archlinuxfr]
+ SigLevel = Never
+ Server = http://repo.archlinux.fr/$arch

Update packages database

pacman -Sy
  1. Create users

Add root user password:

passwd

Add custom user:

useradd -m -g users -G wheel,storage,power -s /bin/bash username_here
passwd username_here

Enable sudo:

EDITOR=nano visudo

Add or edit the following lines:

- # %wheel ALL=(ALL) ALL
+ %wheel ALL=(ALL) ALL

+ Defaults rootpw
  1. Check if EFI variables are mouted
mount -t efivarfs efivarfs /sys/firmware/efi/efivars/
  1. Install bootloader
bootctl install
  1. Bootloader configuraton file
nano /boot/loader/entries/arch.conf

and add the following lines:

title Arch Linux
linux vmlinuz-linux
initrd /initramfs-linux.img
  1. Verify partitions
lsblk
  1. Append root partition as the booteable drive to Bootloader configuraton file
echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sda3) rw" >> /boot/loader/entries/arch.conf
  1. Intel configuration (for Intel processors only)
pacman -S intel-ucode

and add the following lines:

title Arch Linux
linux vmlinuz-linux
+ initrd /intel-ucode.img
initrd /initramfs-linux.img
  1. Active Network Manager
ip link
systemctl enable dhcpcd@YOUR_DIVICE_NAME.service
pacman -S networkmanager
systemctl enable NetworkManager.service
  1. WI-FI tools (optional)
pacman -S iw ip wpa_supplicant rfkill

refs:

  1. Finishing
exit
umount -R /mnt
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment