Refer to Official Archlinux Installation Guide for details.
- Verify boot mode, if it exits, you are booted in EFI mode.
# ls /sys/firmware/efi/efivars - Connect to Internet (e.g. WiFi)
# wifi-menu
# ping -c 3 www.google.com - Update the system clock
# timedatectl set-ntp true - Partition the disks (Example layout schemes)
UEFI+GPT:
# parted /dev/sda
(parted) mklabel gpt
(parted) mkpart ESP fat32 1MiB 513MiB//the recommended size is 512MiB
(parted) set 1 boot on
(parted) mkpart primary linux-swap 513MiB 4.5GiB//swap space
(parted) mkpart primary ext4 4.5GiB 100%
(parted align-check optimal N)// N=1,2,...
(parted) quit
BIOS+MBR:
# parted /dev/sda
(parted) mklabel msdos
(parted) mkpart primary linux-swap 1MiB 4GiB//swap space
(parted) mkpart primary ext4 4GiB 100%//root mount point
(parted) set 2 boot on
(parted align-check optimal N)// N=1,2,...
(parted) quit - Format the partitions
# mkswap /dev/sda1
# swapon /dev/sda1
# mkfs.ext4 /dev/sda2
For UEFI:
# mkfs.fat -F32 /dev/sdxY
If you getWARNING: Not enough clusters for a 32 bit FAT!, reduce cluster size with mkfs.fat -s2 -F32 ... or -s1; - Mount the file systems
mount /dev/sda2 /mnt
For UEFI:
mkdir /mnt/boot
mount /dev/sdxY /mnt/boot - Install Archlinux (zsh for later use of
useradd)
# pacstrap -i /mnt base base-devel vim zsh - Configuration
# genfstab -U /mnt > /mnt/etc/fstab
# arch-chroot /mnt
# vim /etc/locale.genuncomment the following:
en_US.UTF-8 UTF-8
zh_TW.UTF-8 UTF-8 (gcin needs LC_CTYPE=zh_TW.UTF-8, and gnome-terminal will have locale issues if this line is commented)
zh_TW BIG5
# locale-gen
# echo "LANG=en_US.UTF-8" > /etc/locale.conf
# ln -sf /usr/share/zoneinfo/<yourtimezone> /etc/localtime
# hwclock --systohc
# mkinitcpio -p linuxcreate /boot/initramfs-linux.img
# pacman -S grub os-prober efibootmgrFor MBR:
# grub-install --recheck /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
For UEFI:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg
# echo "<yourhostname>" > /etc/hostname
# vim /etc/hostsadd yourhostname
# pacman -S dialog wpa_supplicant iwso we can use wifi-menu at next boot
# passwdchange passwd for root
# useradd -m -s $(which zsh) -G wheel <username>Add your user account
# passwd <username>change passwd
# visudouncomment wheel, giving it root privilege
# exit
- Reboot
# umount -R /mnt && reboot
- Check if all devices have their kernel modules in use
# lspci -v - Run this automatic setup script. You can use
less setup.logto view what's installed.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/alex81527/archlinux-setup/master/arch-post-setup.sh)" | tee setup.log