Since I live in germany, I set my time zone and keyboard layout to it. This does not apply to the system language!
I am writing this guide while installing Arch in a virtual machine.
Therefore my hard disk is /dev/sda
and the hostname arch-vm
.
- Change the keyboard layout temporarily:
loadkeys de-latin1
- Update the system clock:
timedatectl set-ntp true
- Check where your disk lives:
fdisk -l
- For IDE controllers:
/dev/hda
,/dev/hdb
,/dev/hdc
- For SATA controllers:
/dev/sda
,/dev/sdb
,/dev/sdc
- For NVMe controllers:
/dev/nvme0
,/dev/nvme1
- For IDE controllers:
- Create new partitions on your target drive:
fdisk /dev/sda
- enter
g
to create a new GPT partition table - enter
n
for a new partition and set the last vector to:+512M
-> efi - enter
n
for a new partition and set the last vector to :+8192M
-> swap - enter
n
for a new partition and leave everything blank (default) -> root
- enter
- Change the partition types
- enter
t
followed by1
to select theefi
partition and enter1
to set theEFI System
type - enter
t
followed by2
to select theswap
partition and enter19
to set theLinux swap
type - enter
t
followed by3
to select theroot
partition and enter24
to set theLinux root (x86-64)
type
- enter
- Enter
w
to write the partitions and exitfdisk
- Format the EFI partition as fat32:
mkfs.vfat -n EFIBOOT /dev/sda1
- Format the Linux swap:
mkswap -L swap /dev/sda2
- Format the root filesystem as ext4:
mkfs.ext4 -L arch /dev/sda3
- Enable the Linux swap:
spwaon /dev/sda2
- Mount the root partition on
/mnt
:mount /dev/sda3 /mnt
- Create the boot mount point:
mkdir -p /mnt/boot
- Mount the boot partition:
mount /dev/sda1 /mnt/boot
- Install base packages:
pacstrap /mnt base-devel linux linux-firmware nano vim intel-ucode
- Generate a new fstab file:
genfstab -U /mnt >>/mnt/etc/fstab
- Optional verify the generated fstab:
cat /mnt/etc/fstab
- Optional verify the generated fstab:
- Enter chroot environment:
arch-chroot /mnt
- Update the timezone:
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
- Generate the
/etc/adjtime
file:hwclock --systohc
- Uncomment needed locales in
/etc/locale.gen
and generate locales:locale-gen && echo 'LANG=en_US.UTF-8' > /etc/locale.conf
- Change the default keyboard layout:
echo 'KEYMAP=de-latin1' > /etc/vconsole.conf
- Set the hostname (required for the next step):
echo 'arch-vm' > /etc/hostname
- Add the following code into
/etc/hosts
and changearch-vm
into your hostname
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch-vm.localdomain arch-vm
- Install necessary packages:
pacman -S grub efibootmgr linux-headers linux-lts linux-lts-headers networkmanager
- Enable the network manager, otherwise your internet connection won't work:
systemctl enable NetworkManager
- Update the root password:
passwd
- Create the directory efi directory for the bootloader:
mkdir -p /boot/efi
- Mount the efi partition:
mount /dev/sda1 /boot/efi
- Install grub:
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --recheck
- Generate the configuration for grub:
grub-mkconfig -o /boot/grub/grub.cfg
- Exit chroot environment:
exit
- Unmount everything and reboot:
unmount -a && reboot
tba