-
Partition the disk
$ fdisk /dev/sda
-
Create EFI partition (skip for legacy)
g (creates GPT)
n
1
enter
+300M
t
1 (for EFI)
- Create boot partition
n
2
enter
+400M
- Create LVM partition
n
3
enter
enter
t
3
31 (for LVM)
- Write changes
w
- Format partions
- EFI partition:
$ mkfs.fat -F32 /dev/sda1
(skip for legacy) - Boot partition:
$ mkfs.ext2 /dev/sda2
- Set up encryption (optional)
$ cryptsetup luksFormat /dev/sda3
$ cryptsetup open --type luks /dev/sda3 lvm
- Set up LVM
$ pvcreate --dataalignment 1m /dev/mapper/lvm
$ vgcreate vg0 /dev/mapper/lvm
$ lvcreate -L 30GB vg0 -n lv_root
$ lvcreate -L 250GB vg0 -n lv_home
$ modprobe dm_mod
$ vgscan
$ vgchange -ay
- Format LVM volumes
$ mkfs.ext4 /dev/vg0/lv_root
$ mkfs.ext4 /dev/vg0/lv_home
- Mount volumes
$ mount /dev/vg0/lv_root /mnt
$ mkdir /mnt/boot
$ mkdir /mnt/home
$ mount /dev/sda2 /mnt/boot
$ mount /dev/vg0/lv_home /mnt/home
- Setup the filesystem
$ pacstrap -i /mnt base
- Generate fstab
$ genfstab -U -p /mnt >> /mnt/etc/fstab
- Chroot into the filesystem
$ arch-chroot /mnt
- Install packages
$ pacman -S grub efibootmgr dosfstools os-prober mtools linux-headers linux-lts linux-lts-headers
(skip efibootmgr for legacy)
- Edit
/etc/mkinitcpio.conf
- Add
encrypt lvm2
betweenblock
andfilesystems
atHOOKS
- Generate the ramdisk environment
$ mkinitcpio -p linux
$ mkinitcpio -p linux-lts
- Setup the locale
- Uncomment the locale in
/etc/locale.gen
$ locale-gen
- Configure GRUB
- Edit
/etc/default/grub
- Add
cryptdevice=/dev/sda3:vg0
to the beginning ofGRUB_CMDLINE_LINUX_DEFAULT
- Mount the EFI partition
$ mkdir /boot/EFI
$ mount /dev/sda1 /boot/EFI
- Install GRUB
$ grub-install --target x86_64-efi --bootloader-id grub_uefi --recheck
- (
$ grub-install --bootloader-id grub_legacy --recheck
for legacy)
- Set the GRUB locale
$ cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
- Generate the GRUB config
$ grub-mkconfig -o /boot/grub/grub.cfg
- Create a swap file
$ fallocate -l 2G /swapfile
$ chmod 600 /swapfile
$ mkswap /swapfile
$ echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
- Set a root password
$ passwd
- Exit the install media
$ exit
$ umount -a
$ reboot
- Set a locale
$ localectl set-locale LANG="en_US.UTF-8"
- Enable TRIM for SSDs
- Edit
/etc/fstab
- Add the
discard
flag to all partitions on SSDs
- Setup networking
- For wired connections:
$ dhcpcd
- For wireless connections:
$ cp /etc/netctl/examples/wireless-wpa /etc/netctl/<network name>
- Edit
/etc/netctl/<network name>
$ netctl start <network name>
- Enable multilib repositories in pacman
- Edit
/etc/pacman.conf
- Uncomment the
Include
below[multilib]
- Install essential packages
$ pacman -Sy networkmanager network-manager-applet wireless_tools wpa_supplicant wpa_actiond dialog
-
Enable the networkmanager service:
$ systemctl enable NetworkManager
-
Install sudo and Zsh
$ pacman -S sudo zsh
- Enable the wheel group
- Uncomment
%wheel
in/etc/visudo
- Create a user account
$ useradd -m -G wheel -s /bin/zsh penguin
- Set a password for the user account
$ passwd penguin
- Set a hostname
$ hostnamectl set-hostname penguin-pc
- Install the X window server
$ pacman -S xf86-input-libinput xorg-server xorg-xinit xorg-apps mesa
- Install a video driver
$ pacman -S ...
- Intel:
xf86-video-intel lib32-intel-dri lib32-mesa lib32-libgl
- NVIDIA:
nvidia lib32-nvidia-libgl
or see https://wiki.archlinux.org/index.php/NVIDIA - VirtualBox:
virtualbox-guest-utils
- Install a desktop environment
$ pacman -S i3