Skip to content

Instantly share code, notes, and snippets.

@RobBlackwell
Forked from njam/arch-linux
Last active February 22, 2021 07:34
Show Gist options
  • Save RobBlackwell/0d0d44d67d44f74b656eb6bddd33e413 to your computer and use it in GitHub Desktop.
Save RobBlackwell/0d0d44d67d44f74b656eb6bddd33e413 to your computer and use it in GitHub Desktop.
Install Arch Linux on XPS 13 9360
# Arch installation on Dell XPS 13 (9360), October 2020
# Please also consult official documentation:
# https://wiki.archlinux.org/index.php/Installation_Guide
# https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)
# Boot from the usb.
# F12 to enter boot menu
# Set UK keymap
loadkeys uk
# Use a DA200 adapter to connect via ethernet to the internet or use iwctl for wifi
# test the connection
ping www.google.com
# Sync clock
timedatectl set-ntp true
# Create two partitions:
# 1 512MB EFI partition # Hex code ef00 called "boot"
# 2 100% Linux partiton (to be encrypted) # Hex code 8300 called "linux"
cgdisk /dev/nvme0n1
mkfs.vfat -F32 -n EFI /dev/nvme0n1p1
# Setup the encryption of the system
cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 luks
# Create LVM partitions
# This creates partitions for root and /home, no /swap.
pvcreate /dev/mapper/luks
vgcreate vg0 /dev/mapper/luks
lvcreate -n swap -L 16GB -C y vg0
lvcreate -n root -l +100%FREE vg0
mkfs.ext4 -L root /dev/mapper/vg0-root
# Mount the new system
# /mnt is the system to be installed
mount /dev/mapper/vg0-root /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
mkswap /dev/mapper/vg0-swap
swapon /dev/mapper/vg0-swap
# Install the base system plus a few packages
pacstrap /mnt base linux linux-firmware lvm2 intel-ucode networkmanager vim sudo
# Generate fstab
genfstab -L /mnt >> /mnt/etc/fstab
# Verify and adjust /mnt/etc/fstab
# Change relatime on all non-boot partitions to noatime (reduces wear if using an SSD)
# Enter the new system
arch-chroot /mnt
# Setup time
## ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
## hwclock --systohc
timedatectl set-timezone Europe/London
# Generate required locales
vi /etc/locale.gen # uncomment "en_GB.UTF-8 UTF-8" line
locale-gen
# Set locale
echo 'LANG=en_GB.UTF-8' > /etc/locale.conf
# Set keyboard layout
echo 'KEYMAP=uk' > /etc/vconsole.conf
# Set the hostname
echo '<hostname>' > /etc/hostname
# Add to hosts
# 127.0.0.1 localhost
# ::1 localhost
# 127.0.1.1 <hostname>.localdomain <hostname>
# Set password for root
passwd
# Add real user
useradd -m -g users -G wheel -s /bin/bash <username>
passwd <username>
# uncomment wheel in /etc/sudoers
visudo /etc/sudoers
# Configure mkinitcpio with modules needed for the initrd image
vim /etc/mkinitcpio.conf
# Add 'ext4' to MODULES # maybe dm_snapshot
# Change: HOOKS="base udev autodetect modconf block keyboard keymap encrypt lvm2 resume filesystems fsck"
#?
# Regenerate initrd image
mkinitcpio -p linux
# Setup systemd-boot
bootctl --path=/boot install
# Create bootloader entry
# Get luks-uuid with: `cryptsetup luksUUID /dev/nvme0n1p2`
---
/boot/loader/entries/arch.conf
---
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options cryptdevice=UUID=<uuid>:lvm:allow-discards root=/dev/mapper/vg0-root resume=/dev/mapper/vg0-swap rw intel_pstate=nohwp
---
# Set default bootloader entry
---
/boot/loader/loader.conf
---
default arch
---
# Exit and reboot
exit
reboot
#
systemctl start NetworkManager.service
systemctl enable NetworkManager.service
sudo pacman -Syu
sudo pacman -S gnome gnome-extra emacs git firefox sbcl julia stow
systemctl enable gdm.service
@cicacica
Copy link

cicacica commented Dec 3, 2020

Good job! I really appreciate it! I've been failing for two days trying to make arch works on a brand new laptop. You've saved my life!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment