Skip to content

Instantly share code, notes, and snippets.

@UnconventionalMindset
Last active May 26, 2024 22:36
Show Gist options
  • Save UnconventionalMindset/f8191002944ce24b9e345984be7fa45a to your computer and use it in GitHub Desktop.
Save UnconventionalMindset/f8191002944ce24b9e345984be7fa45a to your computer and use it in GitHub Desktop.
Installation of Arch Linux on my Dell XPS laptop

Installation of Arch Linux on my Dell XPS 17 laptop

Pre-installation

  • Make sure EFI partition is of 550 MB
  • Microsoft Reserved Partition can be deleted
  • Turn encryption off when moving windows main partition
  • Keep the windows' bitlocker recovery key with you
  • Use AOMEI partition assistant to manage partitions on windows
  • Disable secure boot
  • Disable Intel RAID and select AHCI

Installation

loadkeys uk
iwctl
  • If iwctl is waiting to start:
ifconfig wlan0 down
  • Execute:
station wlan0 get-networks
station wlan0 connect <wifi-name>
ping www.archlinux.org
timedatectl set-ntp true
fdisk /dev/nvme0n1

n
<Enter>
<Enter>
+400G
<Enter>
w
<Enter>

cryptsetup luksFormat /dev/nvme0n1p1
cryptsetup luksOpen /dev/nvme0n1p1 cryptlvm
pvcreate /dev/mapper/cryptlvm
vgcreate Linux /dev/mapper/cryptlvm
lvcreate -L 8G Linux -n Swap
lvcreate -L 50G Linux -n Arch
lvcreate -l 100%FREE Linux -n Home
mkfs.ext4 /dev/Linux/Arch
mkfs.ext4 /dev/Linux/Home
mkswap /dev/Linux/Swap
mount /dev/Linux/Arch /mnt
mkdir /mnt/home
mount /dev/Linux/Home /mnt/home
swapon /dev/Linux/Swap
mkdir /mnt/{boot,efi}
mount /dev/nvme0n1p1 /mnt/efi
mkdir -p /mnt/efi/EFI/arch
mount --bind /mnt/efi/EFI/arch /mnt/boot
pacstrap /mnt base linux linux-firmware lvm2 grub zsh git efibootmgr os-prober sudo vi vim links netctl dhcpcd dialog networkmanager net-tools wpa_supplicant
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
vim /etc/fstab

- Add if not there already:
echo "/efi/EFI/arch	/boot	none	defaults,bind 0 0" >> /etc/fstab


ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime
hwclock --systohc
  • Uncomment en_US.UTF-8 , en_GB.UTF8 UTF8 and it_IT.UTF8 UTF8 from /etc/locale.gen
locale-gen
echo "LANG=en_GB.UTF-8" >> /etc/locale.conf
echo "KEYMAP=uk" >> /etc/vconsole.conf
echo "Arch-XPS" >> /etc/hostname
sudo vim /etc/mkinitcpio.conf
  • Add "encrypt" and "lvm2" in the HOOKS section.
  • Verify "udev" "keymap" are present in the HOOKS section
  • Add "nvidia" in the MODULES section if using Nvidia GPU
mkinitcpio -P
passwd

Setup Grub

crypto_luks_id=$(blkid | grep crypto_LUKS | sed -n 's/.*\sUUID="\(.\{36\}\)".*/\1/p')
grub_cmdline_linux="cryptdevice=UUID=${crypto_luks_id}:cryptlvm root=/dev/Linux/Arch"
sed -i "s#^GRUB_CMDLINE_LINUX=\".*\"#GRUB_CMDLINE_LINUX=\"$grub_cmdline_linux\"#" /etc/default/grub
sed -i 's/^GRUB_PRELOAD_MODULES="\(.*\)"/GRUB_PRELOAD_MODULES="\1 lvm"' /etc/default/grub

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=Grub
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
reboot

Post Installation

  • Change boot order
useradd -m -g users -G wheel -s /bin/zsh jac
visudo /etc/sudoers
  • uncomment wheel group
logout

Login as jac and then connect to wifi. Note: my password contains special characters which I had to escape with ''

sudo systemctl enable --now NetwrokManager
nmcli dev wifi connect <SSID> password <password>

Gnome:

sudo pacman -S gnome gnome-extra gnome-shell
sudo systemctl enable --now gdm

KDE:

sudo pacman -S plasma-meta plasma-wayland-session egl-wayland kde-applications-meta sddm
sudo systemctl enable --now sddm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment