This article is adapted from shorinkiwata/archlinuxinstall, preserving the original tutorial's operational detail while anonymizing it and correcting risk-related guidance. Package names, extensions, drivers, and interfaces may change with rolling updates. All commands below are examples for reading and were neither executed nor verified during this task.
Prerequisites and Precautions#
This article follows the UEFI + Btrfs + GRUB installation path. Back up your data first, verify the disk and partitions, and distinguish a new ESP from an existing dual-boot ESP. Writing a partition table with cfdisk or formatting with mkfs.* can delete data. Run these operations only on targets explicitly approved for recreation, and do not format Windows' existing ESP. Every /dev/*_partition or /dev/EXAMPLE_DISK must be replaced with a target verified on the actual machine; these are not device names ready to run as written.
The swapfile size 4g is only an example. Hibernation requires the target swap space to hold the actual hibernation image, with the resume location configured correctly. A Btrfs subvolume containing an active swapfile cannot have ordinary snapshots taken; a separate @swap helps isolate this restriction.
Installing the System#
Manual Installation
References: A Concise Guide to Arch Linux Installation Guide - Arch Linux Chinese Wiki
Check Networking
ip link 查看网络接口
ip a 查看网络连接信息
ping archlinux.org 确认网络正常
Connect to Wi-Fi with iwctl
iwctl
station wlan0 connect <WIFI_SSID>
exit
Synchronize the Clock
timedatectl set-ntp true
Partition the Disk
lsblk -p 查看当前分区情况
fdisk -l 小写字母l,查看详细分区信息
cfdisk /dev/EXAMPLE_DISK # 替换为已核对且允许重新分区的目标磁盘
For a new ESP, start by planning for 1 GiB with the EFI System type; allocate the remaining space as Linux filesystem partitions as needed. If an ESP already exists for dual boot, inspect it first and do not recreate or format it.
Format the Partitions
Check mount points and partition numbers: formatting deletes the partition's data. Mount an existing dual-boot ESP without formatting it.
lsblk -p 查看分区情况
- Format the EFI Boot Partition
mkfs.fat -F 32 /dev/efi_system_partition # 仅新建且允许擦除的 ESP
- Format the Btrfs Root Partition
mkfs.btrfs /dev/root_partition
Btrfs Subvolumes
- Mount
mount -t btrfs -o compress=zstd /dev/root_partition /mnt
- Create Subvolumes
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@swap
- Verify
btrfs subvolume list -p /mnt
- Unmount
umount /mnt
Mount
mount -t btrfs -o subvol=/@,compress=zstd /dev/root_partition /mnt #根目录
mount --mkdir -t btrfs -o subvol=/@home,compress=zstd /dev/root_partition /mnt/home #/home目录
mount --mkdir -t btrfs -o subvol=/@swap,compress=zstd /dev/root_partition /mnt/swap #/swap目录
mount --mkdir /dev/efi_partition /mnt/boot #/boot目录
mount --mkdir /dev/winefi_partition /mnt/winboot #windows的启动分区,为双系统引导做准备
df -h 复查挂载情况
Install the System
可选:下载速度慢的话
vim /etc/pacman.d/mirrorlist
拿出手机,浏览器搜索 archlinux中国镜像源,找一个镜像源添加
- Update the Keys
pacman -Syu archlinux-keyring
- Install the System
pacstrap -K /mnt base base-devel linux linux-firmware btrfs-progs
-K 在目标中初始化空的 pacman 密钥环(隐含 -G)
base-devel是编译其他软件的时候用的
linux是内核,可以更换
linux-firmware是固件
btrfs-progs是btrfs文件系统的管理工具
- Install Essential Utilities
pacstrap /mnt networkmanager vim sudo amd-ucode
networkmanager 是联网用的
vim 是文本编辑器
sudo 和权限管理有关
amd-ucode 是微码,用来修复和优化cpu
Configure Swap; Reference: Swap - ArchWiki
Create the Swapfile
btrfs filesystem mkswapfile --size 4g --uuid clear /mnt/swap/swapfile
Enable Swap
swapon /mnt/swap/swapfile
Generate the fstab File
genfstab -U /mnt > /mnt/etc/fstab
change root
arch-chroot /mnt
Hostname
Write a hostname of your choice into /etc/hostname, for example workstation, to avoid embedding a personal device name in public configuration.
Set the Time and Time Zone
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
Localization Settings
vim /etc/locale.gen
取消en_US.UTF-8 UTF-8的注释
locale-gen
vim /etc/locale.conf
写入 LANG=en_US.UTF-8
Set the root Password
passwd
Install the Bootloader
pacman -S grub efibootmgr os-prober
efibootmgr 管理uefi启动项
os-prober 用来搜索win11
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=ARCH
- Edit the GRUB Source Configuration
vim /etc/default/grub
可按排障需要去掉 quiet 或调整 loglevel;不要把关闭 watchdog 和硬件模块黑名单当作安装必需参数。
手动写入或者取消GRUB_DISABLE_OS_PROBER=false的注释
- Generate the Configuration File
grub-mkconfig -o /boot/grub/grub.cfg
Complete the Installation
exit # 退出 arch-chroot
umount -R /mnt # 确认无忙碌挂载
reboot
Start Networking
systemctl enable --now NetworkManager
Connect to Wi-Fi
nmcli dev wifi connect <WIFI_SSID> password <WIFI_PASSWORD>
Optional Terminal Demonstration Tool
pacman -S fastfetch lolcat cmatrix
Scripted Installation
Check the Network Connection
- Use ip a to Inspect Network Connections
- Ping a Website to Check Connectivity
- Connect to Wi-Fi
iwctl #开启wifi连接
station wlan0 connect wifi名
在跳出的条目内输入密码
exit退出iwctl
- Ping a Website to Check Connectivity
Update archinstall
- Update archlinux-keyring
pacman -Syu archlinux-keyring
- Update archinstall
pacman -S archinstall
- Run archinstall to Start the Installation Script (Use the Arrow Keys to Move, Enter to Select, Tab to Toggle Checkboxes, and / to Search)
Configure Mirrors
- For mirror, select your region or country, or leave the selection automatic. Enable the 32-bit repository (multilib) under optional repositories: gaming or running Windows programs requires 32-bit support.
Disk Configuration
Boot Partition
The wiki recommends 1GB, so enter 1024MB, choose fat32, and set the mount point to /boot.
Swap Space
Swap space does not have to equal RAM; if hibernation is required, plan around the actual image size and reliable resume testing. Swap relates to virtual memory and hibernation. Choose either a swap partition or a swapfile: the former is simpler to configure, while the latter is slightly more complex but more flexible. Swap partition: create a disk partition the same size as RAM and choose the swap type. Swapfile: allocate all remaining space to one partition, choose btrfs, enable compress (transparent compression, which can save disk space), and add subvolumes.
- @ maps to /
- @home maps to /home
- @swap maps to /swap. For creating the swapfile, see Swap - ArchWiki
btrfs filesystem mkswapfile --size 4g --uuid clear /swap/swapfile
swapon /swap/swapfile
vim /etc/fstab
写入
/swap/swapfile none swap defaults 0 0
Other Settings
- Choose grub for bootloader: mainstream distributions use it, configuration is straightforward, and there are many online posts to consult when troubleshooting.
- Set the root Password
- Create a Regular User and Grant Administrator Privileges
- profile can preinstall a desktop environment; choose one if needed. After selecting a desktop, you can also select a graphics driver to install.
- Choose the kernel for your hardware and workload; validate power consumption, responsiveness, and driver compatibility for both linux and linux-zen.
- For network configuration, choose the third option, networkmanager, because mainstream desktop environments integrate with it by default.
- Under additional packages, select vim and os-prober; for the zen kernel, also select linux-zen-headers.
- Set the Time Zone
Official Verification Resources#
ArchWiki: EFI system partition.
References & further reading
- Original Tutorial: shorinkiwata/archlinuxinstall ↗
- ArchWiki: Installation Guide ↗
- ArchWiki: EFI System Partition ↗
- ArchWiki: Btrfs ↗
- ArchWiki: GRUB ↗
- pacstrap(8) ↗
Adapted from technical notes. Examples use generic names.
Continue along a reading path
Arch Linux
- 01Arch Linux philosophy and installation planning
- 02Kernel management, systemd-boot, and UKIs
- 03Pacman hooks, the AUR, and build security
- 04Btrfs subvolume layouts and Snapper snapshots
- 05Hardening with LUKS2, Secure Boot, and TPM2
- 06Performance choices and an everyday maintenance checklist
- 07Common Pacman commands and how to remember their flags
- 08Diagnosing slow Pacman downloads and choosing mirrors
- 09informant: Arch news and Pacman hooks
- 10Arch Linux with Btrfs: manual installation and archinstall
- 11Configuring GNOME, input methods, and snapshots
- 12GNOME laptop management and desktop customization
- 13KVM, GPU passthrough, and gaming on Arch Linux
- 14Swap, kernels, and troubleshooting on an Arch desktop