The official installation guide contains a more verbose description.
- Download the
.isoimage from https://www.archlinux.org/ - Verify the signature
- Backup your data!
- Copy the
.isoto a USB-drive - Reboot and enter the boot menu
- Disable secure boot
- Boot from the USB-drive
This guide uses
/dev/nvmeXn1as an example for the respective hard disk or/dev/nvmeXn1p{1,2,3}for the partitions of the hard disk.
| NVMe (M2) | SATA |
|---|---|
/dev/nvmeXn1 |
/dev/sdX |
/dev/nvmeXn1p{1,2,3} |
/dev/sdX{1,2,3} |
-
Set your keymap (german in my case):
loadkeys de-latin1 -
If a WIFI connection is needed, establish it with
iwctl -
Create and format partitions
WARNING: the following step will delete all data on the selected hard disk. Make sure that you have created a backup.
cgdisk /dev/nvmeXn1- Delete all existing partitions using the navigation menu or by pressing D
- Create the EFI partition (N)
- Use the default value for the first sector (Enter)
- Type
+100Mfor the size in sectors and press Enter - Use the hex code
ef00to set the EFI flags and press Enter - Use the default value for the partition label (Enter)
- Create the boot partition (N)
- Use the default value for the first sector (Enter)
- Type
+250Mfor the size in sectors and press Enter - Use the default hex code
8300and press Enter - Use the default value for the partition label (Enter)
- Create the root partition (N)
- Use the default value for the first sector (Enter)
- Type
100%for the size in sectors and press Enter - Use the default hex code
8300and press Enter - Use the default value for the partition label (Enter)
- Write all changes by pressing W and quit
cgdisk
-
Format the EFI and boot partitions
- EFI:
mkfs.vfat -F32 /dev/nvmeXn1p1 - Boot:
mkfs.ext2 /dev/nvmeXn1p2
- EFI:
-
Setup the encryption of the system
cryptsetup -c aes-xts-plain64 -y --use-random luksFormat /dev/nvmeXn1p3
cryptsetup luksOpen /dev/nvmeXn1p3 luks- Create encrypted partitions
This creates one partions for root, modify if /home or other partitions should be on separate partitions
pvcreate /dev/mapper/luks
vgcreate vg0 /dev/mapper/luks
lvcreate --size 16G vg0 --name swap
lvcreate -l +100%FREE vg0 --name root- Create filesystems on encrypted partitions
mkfs.ext4 /dev/mapper/vg0-root
mkswap /dev/mapper/vg0-swap- Mount the new system
mount /dev/mapper/vg0-root /mnt # /mnt is the installed system
swapon /dev/mapper/vg0-swap
mkdir /mnt/boot
mount /dev/nvmeXn1p2 /mnt/boot
mkdir /mnt/boot/efi
mount /dev/nvmeXn1p1 /mnt/boot/efi
- Install the system also includes stuff needed for starting wifi when first booting into the newly installed system
For Intel and AMD processors, microcode is still required. Append
intel-ucodeoramd-ucodeto thepacstrapcommand.You may want to add
dialog,wireless_tools,iw,crdaandwpa_supplicantto thepacstrapcommand if you need a WIFI connection
pacstrap /mnt base base-devel dhcpcd efibootmgr git gptfdisk grub-efi-x86_64 lvm2 linux linux-firmware zsh vim- Initialize fstab:
genfstab /mnt >> /mnt/etc/fstab - Optional: make
/tmpa ramdisk by adding the following line in/mnt/etc/fstab
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
- Change
relatimeon all non-boot partitions tonoatimein/mnt/etc/fstab(reduces wear if using an SSD) - Enter the new system:
arch-chroot /mnt /bin/bash - Setup system clock
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc --utc- Set the hostname echo MYHOSTNAME > /etc/hostname (obv. replace
MYHOSTNAMEwith your intended hostname) - Update the hosts file:
vim /etc/hosts
If the system has a permanent IP address, it should be used instead of
127.0.1.1- Arch Wiki.
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost
::1 localhost
127.0.0.1 arch arch-
Open
/etc/locale.genwithvimand generate the locales usinglocale-gen- Search for
en_US.UTF-8 UTFand remove the#character - Repeat this for all wanted locale
- Run
echo LANGUAGE=en_US.UTF-8 >> /etc/locale.conf - Optional
viminto/etc/vconsole.confand addKEYMAP=layout
- Search for
-
Set password for the
rootuser:passwd
I had problems with
viusingvisudo, so I created a symlink as hacky workaround:ln -s /usr/bin/vim /usr/bin/vi
-
Setup the user account
- Create a new user and add them to the wheel group:
useradd -m -g users -G wheel -s /bin/zsh MYUSERNAME - Set a password:
passwd MYUSERNAME - Create a new user group with the same name:
groupadd MYUSERNAME - Add the user to the new group:
usermod -a -G MYUSERNAME MYUSERNAME - Run
visudoand find## Uncomment to allow members of group wheel to execute any commandfollowed by# %wheel ALL=(ALL) ALL. Remove the#and space characters, save and quit.
- Create a new user and add them to the wheel group:
-
Configure mkinitcpio with modules needed for the initrd image:
vim /etc/mkinitcpio.conf- Add
ext4to MODULES - For PCI passthrough via OVMF add
vfio_pci vfio vfio_iommu_type1 vfio_virqfdbehindext4 - Add
keymap encrypt lvm2 resumebetweenblockandfilesystems - Regenerate initrd image:
mkinitcpio -p linux
- Add
-
Install the GRUB bootloader:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux --removable --recheck --debug -
Modify the default GRUB config:
vim /etc/default/grub- Remove the
#character in front ofGRUB_ENABLE_CRYPTODISK=y - Set
GRUB_CMDLINE_LINUXtocryptdevice=/dev/nvmeXn1p3:luks root=/dev/mapper/vg0-root resume=/dev/mapper/vg0-swap - For PCI passthrough via OVMF append
intel_iommu=onoramd_iommu=ontoGRUB_CMDLINE_LINUX_DEFAULT - Re-generate GRUb config:
grub-mkconfig -o /boot/grub/grub.cfg
- Remove the
-
Open
/etc/pacman.confwithvimand uncomment this line:ParallelDownloads = 5
You may also want to enable
multilibin/etc/pacman.conf
- If you are using a LAN connection, you should now enable the dhcpcd service:
systemctl enable dhcpcd.service- Exit new system and go into the cd shell:
exit - Unmount all partitions:
umount -R /mnt && swapoff -a - Reboot into the new system, don't forget to remove the CD/USB:
reboot