This note is recorded when I install Arch Linux.
Pre-installation #
Download Image #
Visit the Download Page, download the ISO file and write down the MD5 checksum.
Verify md5 checksum #
Calculate MD5 checksum of ISO file.
md5sum archlinux-_version_.x86_64.txt
# 0e9943a96f8298abb0db5e64f76ad0be archlinux-2022.08.05-x86_64.isoConfirm that the md5 checksum I wrote down is the same as the md5 checksum I calculated.
Create Live USB #
Create live USB according to USB flash installation medium.
Disable Secure Boot #
Arch Linux installation images do not support Secure Boot.
Disable Secure Boot in Bios.
Installation #
Boot the live environment #
Boot the live environment with Live USB.
Verify the boot mode #
To verify the boot mode, list the efivars directory.
Proceed in UEFI mode, so make sure that the efivars directory exists under /sys/firmware/efi:
ls /sys/firmware/efi
# config_table efivars fw_platform_size fw_vendor runtime runtime-map systabPartition the disks #
-
Check install device:
Terminal lsblk | grep -v 'rom\|loop\|airoot' # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT # sda 8:0 0 8G 0 disk -
Create partitions The partition layout is as follows.
Partition Size Format Mount point /dev/sda1512M vfat /mnt/boot//dev/sda2Remainder of the device btrfs /mntTerminal sgdisk -Z /dev/sda sgdisk -o /dev/sda sgdisk -n 1:0:+512M -t 1:ef00 /dev/sda sgdisk -n 2:0: -t 2:8300 /dev/sda -
Format partitions Format partitions as vfat and btrfs:
Terminal mkfs.vfat -F32 /dev/sda1 mkfs.btrfs /dev/sda2 -
Mount the file systems Mount the root volume to
/mnt:Terminal mount /dev/sda2 /mnt mkdir /mnt/boot mount /dev/sda1 /mnt/boot
Install essential packages and packages I use #
- For Server
Terminal pacstrap -K /mnt base base-devel linux linux-headers linux-firmware btrfs-progs vim - For Desktop Environment
Terminal pacstrap -K /mnt base base-devel linux linux-headers linux-firmware btrfs-progs vim networkmanager
Configure the system #
Fstab #
Generate an fstab file:
genfstab -U /mnt >> /mnt/etc/fstabChroot #
Change root into the new system:
arch-chroot /mntTimezone #
Set the time zone to Tokyo:
ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtimeAdjust hwclock:
hwclock --systohcLocalization #
-
Edit
/etc/locale.genand uncommenten_US.UTF-8 UTF-8andja_JP.UTF-8 UTF-8. -
Generate the locales by running:
Terminal locale-gen -
Set the LANG variable in
/etc/locale.conf:Terminal echo LANG=en_US.UTF-8 > /etc/locale.conf
Hostname #
Set hostname:
echo "exsample hostname" > /etc/hostnameInitramfs #
Creatie a new initramfs:
mkinitcpio -PRoot password #
Set the root password:
passwdBoot loader #
I use systemd-boot.
-
add systemd-boot.
Terminal bootctl install -
configure systemd-boot. Edit
/boot/loader/loader.confas follows:/boot/loader/loader.conf default arch.conf timeout 4 console-mode max editor no -
Check the PARTUUID of /dev/sda2 and add it to
/boot/loader/entries/arch.conf:/boot/loader/entries/arch.conf blkid -o export /dev/sda2 | grep ^PARTUUID >> /boot/loader/entries/arch.conf -
Add boot entry. Edit
/boot/loader/entries/arch.confas follows:/boot/loader/entries/arch.conf title Arch Linux linux /vmlinuz-linux initrd /initramfs-linux.img options root=PARTUUID="PARTUUID of /dev/sda2" rw -
Enable micro code update. Install ucode.
Terminal # For intel CPU pacman -S intel-ucode # For amd CPU pacman -S amd-ucodeEdit
/boot/loader/entries/arch.confas follows.- For intel CPU
/boot/loader/entries/arch.conf title Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options root=PARTUUID="PARTUUID of /dev/sda2" rw - For amd CPU
/boot/loader/entries/arch.conf title Arch Linux linux /vmlinuz-linux initrd /amd-ucode.img initrd /initramfs-linux.img options root=PARTUUID="PARTUUID of /dev/sda2" rw
- For intel CPU
Reboot #
Reboot:
exit
umount -R /mnt
reboot