# Installation
How to install Arch Linux on a EFI system.
## Disk Setup
Query all attached disks using:
fdisk -l
Then partition the correct one (usually /dev/sda):
cfdisk /dev/sda
Use an EFI layout
The base layout is:
1. A 300MB EFI partition => /dev/sda1
2. A xxxGB Linux FS partition => /dev/sda2
3. A {2x RAM} GB Swap partition => /dev/sda3
Write partitions to disk and quit. Following commands are needed to write a new filesystem into previously created partitions:
mkfs.fat -F32 /dev/sda1 # Prepare the EFI boot partition
mkfs.ext4 /dev/sda2 # Initialize the root partition
mkswap /dev/sda3 # Initialize the swap filesystem
swapon /dev/sda3 # Mount Swap on the currently alive system
In order to use swap on installation and generate an auto-mount on fstab the swap partition __must__ be mounted on the live system.
## Installation
Mount the Linux root:
mount /dev/sda2 /mnt
and install the system:
pacstrap /mnt base
Wait for it to download packages and enter chroot on the new system:
arch-chroot /mnt
## Configuration
Configure the hostname and the network name:
echo "archbox" > /etc/hostname
echo "127.0.0.1 localhost.localdomain localhost" >> /etc/hosts
echo "::1 localhost.localdomain localhost" >> /etc/hosts
echo "127.0.1.1 archbox.localdomain archbox" >> /etc/hosts
Edit the locale.get file to uncomment *en_US.UTF-8*, *en_US ISO-8859-1* and any other languages you may use:
nano /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
After that configure the clock:
ln -s /usr/share/zoneinfo/Region/City /etc/localtime
timedatectl set-ntp true
hwclock --systohc --utc
Change the root password and setup additional users:
passwd
pacman -S sudo
useradd -mg users -G wheel,storage,power -s /bin/bash your_new_user
passwd your_new_user
chage -d 0 your_new_user
Edit */etc/sudoers* ad make sure there is the line __%wheel ALL=(ALL) ALL__ is uncommented
Also, the DHCP daemon will __not__ start automatically after reboot, so enable it:
sudo systemctl enable dhcpcd
## Additional software
Make sure to also install linux header, so that dkms modules can automatically be compiled and deployed:
pacman -S linux-header
__VirtualBox:__ at the end install __virtualbox-guest-utils__ or __virtualbox-guest-utils-nox__ if not using a GUI.
## Bootloader
In this chapter *EFI GRUB* will be installed, so make sure that the system has been started with EFI:
ls /sys/firmware/efi/efivars
The output of this command __cannot__ be empty if the PC was started with EFI, if the PC is EFI compatible then proceed:
pacman -S grub efibootmgr dosfstools os-prober mtools
mkdir /boot/EFI
mount /dev/sda1 /boot/EFI #Mount FAT32 EFI partition
grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck # Install grub
grub-mkconfig -o /boot/grub/grub.cfg # write the GRUB configuration
Now the newly installed arch linux can be booted!
## Completed
Arch is now installed, unmount every disk and restart the system:
exit # Close arch-chroot
umount -a # Unmount every disk
telinit 6 # Restart