Boot from USB Arch Linux drive
- How To Install Arch Linux FOSS
- How To Install Arch Linux With Disk Encryption
- Encrypting LVM On LUKS
- Device Encryption Key Files
This will setup the partitions for boot and root drives.
fdisk -l
fdisk /dev/sda
Run these commands in fdisk
to setup a new boot partition and format to FAT12
n / p / enter / enter / +512M / t / 1
Run these commands to setup the root drive which will take up the rest of the disk
n / p / enter / enter / enter
Finally use w
to write the partitions
pvcreate /dev/sda2
vgcreate vg /dev/sda2
lvcreate -L 8G vg -n swap
lvcreate -L 32G vg -n root
lvcreate -l 100%FREE vg -n home
mkswap /dev/mapper/vg-swap
mkfs.ext4 /dev/mapper/vg-home
mkfs.ext4 /dev/mapper/vg-root
mount /dev/mapper/vg-root /mnt
mkdir -p /mnt/boot/efi /mnt/home
mount /dev/mapper/vg-home /mnt/home
mount /dev/sda1 /mnt/boot/efi
This will update the mirrors and limit the mirrorlist to mirrors close to you
pacman -Syy
pacman -S reflector
reflector -c "US" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
This will install the base packages as well as generate the fstab
file. Notice that lvm2
is included in this which is important.
pacstrap /mnt base linux-zen linux-firmware vim sudo lvm2
genfstab -U /mnt >> /mnt/etc/fstab
Chroot into the /mnt
directory
arch-chroot /mnt
timedatectl set-timezone America/Chicago
Uncomment en_US.UTF-8
in /etc/locale.gen
then run
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
echo computer-name > /etc/hostname
touch /etc/hosts
Then add this to /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 myarch
passwd
Add user
useradd -m -g users -G wheel,games,power,optical,storage,scanner,lp,audio,video -s /bin/bash username
passwd username
Then uncomment the %wheel
group using visudo
Configure mkinitcpio
(vim /etc/mkinitcpio.conf
) and ensure the configuration has these lines added to it or matching lines
HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard fsck)
Generate mkinitcpio
mkinitcpio -p linux-zen
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg
pacman -S xorg xorg-server