Skip to content

Instantly share code, notes, and snippets.

@njam njam/arch-linux
Last active Sep 9, 2019

Embed
What would you like to do?
Install Arch Linux on XPS 13 9360
# Installation on Dell XPS
# Please also consult official documentation:
# https://wiki.archlinux.org/index.php/Installation_Guide
# https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)
# https://wiki.archlinux.org/index.php/Dell_XPS_15_(9550)
# Enter BIOS with F2 and configure:
# - "System Configuration" > "SATA Operation": "AHCI"
# - "Secure Boot" > "Secure Boot Enable": "Disabled"
# Enter boot menu with F12, and boot the Arch USB medium
# Set desired keymap
loadkeys de_CH-latin1
# Set large font
setfont latarcyrheb-sun32
# Connect to Internet
wifi-menu
# Sync clock
timedatectl set-ntp true
# Create two partitions:
# 1 1000MB EFI partition # Hex code ef00
# 2 100% Linux partiton (to be encrypted) # Hex code 8300
cgdisk /dev/nvme0n1
# Formatting and encyption
mkfs.fat -F32 /dev/nvme0n1p1
cryptsetup luksFormat --type=luks2 /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 luks
mkfs.btrfs -L luks /dev/mapper/luks
# Create btrfs subvolumes
mount -t btrfs /dev/mapper/luks /mnt
btrfs subvolume create /mnt/@root
btrfs subvolume create /mnt/@var
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@snapshots
# Mount btrfs subvolumes
umount /mnt
mount -o subvol=@root /dev/mapper/luks /mnt
mkdir /mnt/{var,home,.snapshots}
mount -o subvol=@var /dev/mapper/luks /mnt/var
mount -o subvol=@home /dev/mapper/luks /mnt/home
mount -o subvol=@snapshots /dev/mapper/luks /mnt/.snapshots
# Mount EFI partition
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
# Change pacman mirror priority, move closer mirror to the top
vim /etc/pacman.d/mirrorlist
# Install the base system plus a few packages
pacstrap /mnt base btrfs-progs zsh vim git sudo efibootmgr wpa_supplicant dialog iw
# Generate fstab
genfstab -L /mnt >> /mnt/etc/fstab
# Verify and adjust /mnt/etc/fstab
# For all btrfs filesystems consider:
# - Change "relatime" to "noatime" to reduce wear on SSD
# - Adding "discard" to enable continuous TRIM for SSD
# - Adding "autodefrag" to enable online defragmentation
# Enter the new system
arch-chroot /mnt
# Setup time
rm /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
hwclock --systohc
# Generate required locales
vim /etc/locale.gen # Uncomment desired locales, e.g. "en_US.UTF-8", "de_CH.UTF-8"
locale-gen
# Set desired locale
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
# Set desired keymap and font
echo 'KEYMAP=us' > /etc/vconsole.conf
echo 'FONT=latarcyrheb-sun32' >> /etc/vconsole.conf
# Set the hostname
echo '<hostname>' > /etc/hostname
# Add hostname to /etc/hosts:
---
/etc/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/zsh <username>
passwd <username>
echo '<username> ALL=(ALL) ALL' > /etc/sudoers.d/<username>
# Configure mkinitcpio with modules needed for the initrd image
vim /etc/mkinitcpio.conf
# Change: HOOKS=(base systemd autodetect modconf block keyboard sd-vconsole sd-encrypt filesystems)
# Regenerate initrd image
mkinitcpio -p linux
# Setup systemd-boot
bootctl --path=/boot install
# Enable Intel microcode updates
pacman -S intel-ucode
# 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 rw luks.uuid=<uuid> luks.name=<uuid>=luks root=/dev/mapper/luks rootflags=subvol=@root
---
# Set default bootloader entry
---
/boot/loader/loader.conf
---
default arch
---
# Exit and reboot
exit
reboot
# Disable the Nvidia GPU on the XPS 15
# Install intel graphics driver
sudo pacman -S xf86-video-intel
# Blacklist nvidia/nouveau drivers
---
/etc/modprobe.d/nvidia.conf
---
blacklist nvidia
blacklist nouveau
---
# Install acpi_call:
pacaur -S acpi_call-dkms linux-headers
# Follow the docu to "power down discrete GPU":
# https://wiki.archlinux.org/index.php/hybrid_graphics
sudo modprobe acpi_call
sudo /usr/share/acpi_call/examples/turn_off_gpu.sh 2>/dev/null | grep works
@julioarguello

This comment has been minimized.

Copy link

commented May 30, 2017

Hi @njam,

Thanks for sharing!

I'm about to re-stage my DELL XPS 9360 (I'm not really happy with current setup based on Ubuntu 16.04 and Unity does not really helps...)

I wonder if your guide is definitive or missed some things... I mean, if you had to start from scratch, would you follow this guide? Anything blocker to do in the post installation setup? (i.e. WiFi drivers)

BTW, which version of the Linux kernel are you running?

ThX in advance

@njam

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

@julioarguello sorry for the late reply. This guide is still fine and up-to-date afaik. Nevertheless I recommend reading the official docu in parallel.

@agzam

This comment has been minimized.

Copy link

commented Apr 9, 2018

I just bought XPS 13 9365. I will try to follow this guide and see if that works for me. Thank you for this

@ghost

This comment has been minimized.

Copy link

commented May 4, 2018

Hello, for my culture, why remove the fsck hook from the /etc/mkinitcpio.conf file please ?

Thanks!

EDIT: Ups, I'm stupid sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.