This post aims to record the installation procedure of ArchLinux on my notebook, Thinkpad X1 Carbon (x1c) 2018, i.e., 6th generation.
Preparition
- Download the installation image from the nearest mirror.
Burn the image into a USB stick.
dd if=/path/to/image/ of=/dev/sdb status=progress bs=10M- The notebook has Windows 10 installed with
快速启动enabled. Therefore, it needs to be disabled before the installation. Uncheck the option of控制面板 -> 硬件和声音 -> 电源选项 -> 选择电源按钮的功能 -> 更改当前不可用的设置 -> 启用快速启动(推荐).
Installation
Boot
- Power on the notebook.
- Press
EnterandF1to enter the BIOS configuration. - Disable the
Security -> Secure Boot. - Enable
Config -> Thunderbolt BIOS Assist Mode. This will significantly reduce the power consumption of CPU wakeups1. - Insert the prepared USB and press
F10to save the change and reboot the notebook. - Press
EnterandF12to temporarily boot from the prepared USB stick.
Partition
For UEFI booting, a dedicated EFI system partition (ESP) is mandatory. EFI bootloaders, applications and drivers can be stored in an ESP and lauched by the UEFI firmware at the boot stage. In other words, it is completely independent of OS. Considering the potential support of dual-boot in the futher, I prepare a 1 GB partition for ESP. Accordingly, I created a primary partition (/dev/nvme0n1p1) of partion type EFI System. Taking fdisk for instance, the type can be selected by alias uefi.
In addition, I created two ext4 partitions for / and /home respectively.
Format the partitions
mkfs.fat -F 32 /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3Mount the partitions
mount /dev/nvme0n1p2 /mnt
mount --mkdir /dev/nvme0n1p1 /mnt/boot
mount --mkdir /dev/nvme0n1p3 /mnt/homeConnect to the Internet
iwctl --passphrase PASSWORD station wlan0 connect-hidden SSIDSelect the nearest mirror
Edit /etc/pacman.d/mirrorlist as below.
Server = http://mirrors.aliyun.com/archlinux/$repo/os/$archInstall the base system
pacstrap /mnt baseGenerate file system table
genfstab -U /mnt >> /mnt/etc/fstabThe /etc/fstab looks
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p2 LABEL=OS
UUID=a2d1afa4-4a38-4849-a4e7-ab5a5c4dba8d / ext4 rw,relatime 0 1
# /dev/nvme0n1p1 LABEL=ESP
UUID=019D-1686 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p3 LABEL=DATA
UUID=386c4fbc-f1fd-4147-98bb-547867e762f5 /home ext4 rw,relatime 0 2Chroot into the newly installed system
arch-chroot -S /mntHost name
Create file /etc/hostname.
notebookTime zone
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohcLocale
Edit /etc/locale.gen and uncomment the following lines.
...
en_US.UTF-8 UTF-8
...
zh_CN.UTF-8 UTF-8
...Generate and set locales.
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.confKernel and microcode
pacman -S linux linux-firmware intel-ucodeInitramfs
mkinitcpio -PCPU frequency scaling
pacman -S cpupower
systemctl enable cpupowerNetwork
pacman -S networkmanager
systemctl enable NetworkManagerBootloader
I adopt systemd-boot as the UEFI boot manager, shipped with systemd.
Installation
bootctl installConfiguration
/boot/loader/loader.confdefault arch.conf timeout 3/boot/loader/entries/arch.conftitle Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options root=UUID=a2d1afa4-4a38-4849-a4e7-ab5a5c4dba8d rw/boot/loader/entries/arch-fallback.conftitle Arch Linux (fallback) linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux-fallback.img options root=UUID=a2d1afa4-4a38-4849-a4e7-ab5a5c4dba8d rw
Password for root
passwdUnmount and reboot
exit
umount -R /mnt
reboot