Last active
August 3, 2018 15:01
-
-
Save s-urbaniak/c21b5df56621c7204be8da2b5ae663d1 to your computer and use it in GitHub Desktop.
Arch XPS13 installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
# for subsequent operations, only use partition no. 3: | |
# | |
# cgdisk /dev/nvme0n1 | |
# 1. <skip> | |
# 2. <skip> | |
# 3. Microsoft basic data - Basic data partition - type 0700 | |
# ... | |
# change to: | |
# 3. Linux filesystem - Basic data partition - 8300 | |
# note: when uninstalling linux, you can do a factory image restore to restore windows | |
# mkfs.fat -F32 /dev/nvme0n1p1 (optional, only if you want to override the uefi partition | |
# Setup the encryption of the system | |
cryptsetup luksFormat /dev/nvme0n1p3 | |
cryptsetup convert --type luks2 /dev/nvme0n1p3 | |
cryptsetup --allow-discards --persistent open /dev/nvme0n1p3 luks | |
# Create LVM partitions | |
# This creates partitions for root and /home, no /swap. | |
pvcreate /dev/mapper/luks | |
vgcreate vg0 /dev/mapper/luks | |
lvcreate -l +100%FREE vg0 --name root | |
mkfs.ext4 /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 | |
# Install the base system plus a few packages | |
pacstrap /mnt base zsh vim git sudo efibootmgr wpa_supplicant dialog iw | |
# 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 -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime | |
hwclock --systohc | |
# Generate required locales | |
vi /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 to hosts | |
echo '127.0.1.1 <hostname>.localdomain <hostname>' >> /etc/hosts | |
# 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 | |
vi /etc/mkinitcpio.conf | |
# Add 'ext4 dm_snapshot' to MODULES | |
# Change: HOOKS="base systemd autodetect modconf block keyboard sd-vconsole sd-encrypt sd-lvm2 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 luks.uuid=<uuid> luks.name=<uuid>=luks root=/dev/mapper/vg0-root rw rd.luks.options=discard | |
--- | |
# Set default bootloader entry | |
--- | |
/boot/loader/loader.conf | |
--- | |
default arch | |
--- | |
# Exit and reboot | |
exit | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment