arch linux install thinkpad x1 carbon 2024

this isn't a guide, just some reference notes. notes from installing archlinux on my thinkpad x1 carbon 5th gen, performed 2024-10-04.

please refer to the offical install guide on the wiki.

installer setup

14" 16:10 1200p panel, set the installer font big:

$ setfont latarcyrheb-sun32

UEFI mode enabled?

$ ls /sys/firmware/efi/efivars

connect to the network via wifi:

$ ip link
$ iwctl
[iwd]# device list
[iwd]# station [device] scan
[iwd]# station [device] get-networks
[iwd]# station [device] connect [network-name]
[iwd]# exit
$ ping hauntware.cc

ssh connect. if you want to continue the install from the comfort of a full system. set a password for root so you can login:

$ systemctl status sshd
$ passwd
$ ip a

from another machine (where i'm reading installation steps)

$ ssh root@[local-ip]
$ tmux

partitions & filesystems

encrypted btrfs ssd

identify the laptop disk device with lsblk create a partition table on it with gdisk or cfdisk.

2 partitions

  1. 512mb fat32 efi system partition (mandatory for uefi boot) mounted at /boot
  2. the remaining space a luks encrypted btrfs volume

because i do not dual boot

i'm creating 1 fat32 efi system partition of 512MB,

$ lsblk /dev/nvme0n1
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0    0 238.5G  0 disk

$ gdisk /dev/nvme0n1

Number  Start (sector)    End (sector)  Size       Code  Name
1            2048         1050623   512.0 MiB   EF00  EFI system partition
2         1050624       500117503   238.0 GiB   8300  Linux filesystem

encryption

$ cryptsetup benchmark
$ cryptsetup luksFormat /dev/nvme0n1p2 \
    --cipher aes-xts-plain64 \
    --hash sha512 \
    --key-size 512 \
    --iter-time 4000
$ cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
$ cryptsetup luksDump /dev/nvme0n1p2

filesystem, subvolume setup

$ mkfs.vfat -F32 -n EFI /dev/nvme0n1p1
$ mkfs.btrfs -L root /dev/mapper/cryptroot

$ mount -o noatime,ssd /dev/mapper/cryptroot /mnt
$ btrfs subvolume create /mnt/home
$ mkdir /mnt/boot
$ mount /dev/nvme0n1p1 /mnt/boot

at this point i stopped taking non-shell notes, you're on your own!

$ pacstrap /mnt base linux linux-firmware btrfs-progs base-devel intel-ucode networkmanager grub efibootmgr vim tmux

$ genfstab -L -p /mnt            
# /dev/mapper/cryptroot UUID=a49e6939-b1f6-4229-afd8-f31f5f9dfce2
LABEL=root              /               btrfs           rw,noatime,ssd,space_cache=v2,subvolid=5,subvol=/       0 0

# /dev/nvme0n1p1 UUID=45B2-1207
LABEL=EFI               /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro        0 2

$ genfstab -L -p /mnt >> /mnt/etc/fstab

$ arch-chroot /mnt /bin/bash

ln -s /usr/share/zoneinfo/Canada/Pacific /etc/localtime
hwclock --systohc --utc
echo tobacco > /etc/hostname

vim /etc/locale.gen
grep 'en_US' /etc/locale.gen
en_US.UTF-8 UTF-8
en_US ISO-8859-1
locale-gen

$ cat /etc/locale.conf
LANG=en_US.utf8
LANGUAGE=en_US
LC_ALL=C

echo FONT=latarcyrheb-sun32 >> /etc/vconsole.conf

$ blkid | grep /dev/nvme0n1p2
/dev/nvme0n1p2: UUID="39e5dbbb-db61-4c04-ad8f-800a47c3c9f0" TYPE="crypto_LUKS" PARTUUID="06352c53-716c-4c87-ab7e-18f08503cc7f"

$ grep 'GRUB_CMDLINE_LINUX=' /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=UUID=39e5dbbb-db61-4c04-ad8f-800a47c3c9f0:cryptroot"

vim /etc/mkinitcpio.conf
add 'encrypt' 
HOOKS="base udev autodetect modconf block encrypt filesystems keyboard fsck"
mkinitcpio -p linux

vim /etc/default/grub
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

grub-mkconfig -o /boot/grub/grub.cfg

passwd

exit
shutdown