Skip to content

Instantly share code, notes, and snippets.

@obsoke
Created December 16, 2018 22:27
Show Gist options
  • Select an option

  • Save obsoke/dddc6367ad7587126b6afc75f85a5f6b to your computer and use it in GitHub Desktop.

Select an option

Save obsoke/dddc6367ad7587126b6afc75f85a5f6b to your computer and use it in GitHub Desktop.
Installing Arch Linux on a Dell Precision 5530
  1. Burn the Arch Linux ISO onto a USB stick
  2. Boot the laptop with the boot media in it; hit F2 to enter the setup menu and then hit F12 to get to the one-time boot screen. Select the boot media containing the Arch Linux image.
  3. Connect to the internet: wifi-menu
  4. Update the system clock: timedatectl set-ntp true
  5. Partition the disk:
    1. Use lsblk to get the name of the hard drive we wish to partition.
    2. Use fdisk: fdisk /dev/<deviceName>. Don’t specify the partition.
    3. Ensure that the type of hard drive scheme(?) is GPT with p to print the current partition information.
    4. Delete the existing partitions with d.
    5. Create the EFI partition:
      1. n for new partition.
      2. Enter for default value for partition number.
      3. Enter for default value for first sector.
      4. +550M to make the partition size 550MB.
      5. Hit t to change partition type. Since there is only one partitoin, no partition selection is needed.
      6. 1 to select EFI System Partition.
      7. p to verify current state of partitions.
    6. Create the root partition:
      1. n for new partition.
      2. Enter for default value for partition number.
      3. Enter for default value for first sector.
      4. Enter to use the rest of the hard drive as partition space.
    7. w to write partitions and exit fdisk.
  6. Encrypt the root partition with dm-crypt: cryptsetup luksFormat --tppe luks2 /dev/<partitonName>
  7. Open the luks container: crytsetup open /dev/<partitionName> <name>. <name> will give the device a name at /dev/mapper/<name>. I’ll call it root.
  8. Create the filesystems:
    1. mkfs.ext4 /dev/mapper/<name>
    2. mkfs.fat -F32 /dev/<bootPartition>
  9. Mount the partitions:
    1. mount /dev/mapper/root /mnt
    2. mkdir /mnt/boot
    3. mount /dev/<bootPartition> /mnt/boot
  10. Install Arch Linux: pacstrap /mnt base base-devel
  11. Generate an fstab: genfstab -U /mnt >> /mnt/etc/fstab
  12. Change root into system: arch-chroot /mnt
  13. Set time zone:
    1. ln -sf /usr/share/zoneinfo/Canada/Eastern /etc/localtime
    2. hwclock --systohc
  14. Set locale:
    1. vi /etc/locale.gen, uncomment en_US.UTF-8 UTF-8
    2. locale-gen
    3. vi /etc/locale.conf, set value to **LANG=en_US.UTF-8*.
  15. Set hostname: echo <hostname> > /etc/hostname.
  16. Install network-related tools: pacman -S wpa_supplicant iw dialog.
  17. vi /etc/mkinitcpio.conf and make some additons to **HOOKS**: encrypt and keyboard:
    1. After autodetect, add keyboard.
    2. After block, add encrypt
  18. Set root password: passwd
  19. Create user account: useradd -m -G wheel <username>
  20. Use visudo to enable all members of the **wheel** group to use sudo.
  21. Install Intel microcode updates: pacman -S intel-ucode.
  22. Install & setup GRUB:
    1. pacman -S grub efibootmgr
    2. grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
    3. vi /etc/default/grub, add the following to the **GRUB_CMDLINE_LINUX** argument: GRUB_CMDLINE_LINUX="cryptdevice=/dev/nvme0n1p2:root root=/dev/mapper/root"
    4. grub-mkconfig -o /boot/grub/grub.cfg
    5. mkinitcpio -p linux
  23. Exit the chroot: exit.
  24. Unmount all partitions: umount -R /mnt
  25. reboot!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment