Arch Linux install メモ

時々インストールすることがあるのですが細かいところをよく忘れるので、自分用にメモ。

インストール

インストールガイド - ArchWiki

インストールの準備

起動モードの確認

UEFIブートをしたいので、USB起動後有効になっているか確認

# ls /sys/firmware/efi/efivars

パーティション

パーティショニング - ArchWiki

# gdisk /dev/sdX
番号 サイズ パーティションタイプ
1 512M EFI (ef00)
2 残りすべて Linux filesystem (8300)

パーティションのフォーマット

# mkfs.fat -F32 /dev/sda1
# mkfs.ext4 /dev/sda2

パーティションのマウント

# mount /dev/sda2 /mnt
# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot

インターネットの接続確認

# ping github.com -c3

システムクロックの更新

# timedatectl set-ntp true

インストール

ミラーの選択

/etc/pacman.d/mirrorlist を編集

ベースシステムのインストール

# pacstrap /mnt base base-devel vim

システムの設定

fstab

# genfstab -U /mnt >> /mnt/etc/fstab

chroot

# arch-chroot /mnt

timezone

# ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
# hwclock --systohc --utc

ロケール

/etc/locale.gen を編集

# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf

ホストネーム

# echo myhostname > /etc/hostname

/etc/hosts を編集

127.0.0.1    localhost.localdomain   localhost
::1     localhost.localdomain   localhost
127.0.1.1   myhostname.localdomain  myhostname

Initramfs

# mkinitcpio -p linux

passwd

ブートローダ

ブートローダー - ArchWiki

systemd-boot - ArchWiki

# bootctl --path=/boot install
# pacman -S intel-ucode

/boot/loader/loader.conf を編集。

default arch
timeout 4
editor 0

/boot/loader/entries/arch.conf を編集。PARTUUID には blkid -s PARTUUID -o value /dev/sda2 を実行して取得できる値を使う。

title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=[PARTUUID] rw

再起動

(chroot)# exit
# umount -R /mnt
# reboot