If the keyboard is not American layout, load the target keyboard layout by running the following command:
loadkeys br-abnt2Make sure you are connected to internet and your PC has a configured IP.
ip addr show
# or
wifi-menuCheck connection using ping google.com.
It's also possible to connect to the Arch intall using SSH running:
systemctl start sshd
passwdThen, open a new SSH connection.
Run following to get fastest mirrors:
pacman -Sy reflector
reflector --verbose --latest 15 --sort rate --save /etc/pacman.d/mirrorlist
# or
reflector -c Brazil --save /etc/pacman.d/mirrorlist
pacman -Syyyfdisk -l
cfdisk /dev/nvme0n1If your hardware supports UEFI, select gpt. Otherwise select dos.
Create the following partitions:
| Partition | Location | Size | Type |
|---|---|---|---|
| Boot | /dev/nvme0n1p1 | 512M | EFI System |
| / | /dev/nvme0n1p2 | 25G | Linux Filesystem |
| /home | /dev/nvme0n1p3 | * | Linux Filesystem |
Check if the partitions were created:
fdisk -l /dev/nvme0n1They can also be sda instead of nvme0n1 depending on your hardware.
Run the following commands to format the partitions:
mkfs.vfat -F32 -n EFI /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3And then mount them:
mount /dev/nvme0n1p2 /mnt
mkdir -p /mnt/boot/EFI
mount /dev/nvme0n1p1 /mnt/boot
mkdir /mnt/home
mount /dev/nvme0n1p3 /mnt/home
ls /mntCheck if they are correctly mounted using:
findmntBefore setup the partitions, load the following modules:
modprobe -a dm-mod dm-cryptThen format the your storage.
fdisk -l
cfdisk /dev/nvme0n1If your hardware supports UEFI, select gpt. Otherwise select dos.
Create the following partitions:
| Partition | Location | Size | Type |
|---|---|---|---|
| EFI | /dev/nvme0n1p1 | 300M | EFI System |
| /boot | /dev/nvme0n1p2 | 400M | Linux Filesystem |
| / | /dev/nvme0n1p3 | * | Linux LVM |
Check if the partitions were created:
fdisk -l /dev/nvme0n1They can also be sda instead of nvme0n1 depending on your hardware.
Run the following commands to format the partitions:
mkfs.vfat -F32 -n EFI /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p2
# crypto
cryptsetup luksFormat /dev/nvme0n1p3
cryptsetup open --type luks /dev/nvme0n1p3 lvm
# set up lvm:
pvcreate --dataalignment 1m /dev/mapper/lvm
vgcreate storage /dev/mapper/lvm
lvcreate -L 25GB storage -n lv_root
lvcreate -l 100%FREE storage -n lv_home
modprobe dm_mod
vgscan
vgchange -ay
# format
mkfs.ext4 /dev/storage/lv_root
mkfs.ext4 /dev/storage/lv_home
mount /dev/storage/lv_root /mnt
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/nvme0n1p2 /mnt/boot
mount /dev/storage/lv_home /mnt/home
mkdir /mnt/boot/EFI
mount /dev/nvme0n1p1 /mnt/boot/EFIRun vls command to make sure is everything good.
Run the following commands to install the base:
pacstrap /mnt base base-develRun the following command to generate the fstab file.
genfstab -U -p /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstabMake sure your fstab file has all previously created partitions.
arch-chroot /mntRun:
pacman -S grub efibootmgr dosfstools openssh mtools linux-headers Edit /etc/mkinitcpio.conf and add encrypt lvm2 in between block and filesystems in HOOKS. Then:
mkinitcpio -p linuxEdit /etc/default/grub, add cryptdevice=/dev/nvme0n1p3:storage to GRUB_CMDLINE_LINUX_DEFAULT.
Run the following command:
ln -s /usr/share/zoneinfo/America/Sao_Paulo /etc/timezone
hwclock --systohc --utcUncomment en_US.UTF-8 in /etc/locale.gen, then run:
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo KEYMAP=us-acentos > /etc/vconsole.confDefine your root user password:
passwdAnd run the following command to create your user:
useradd -m -G wheel -s /bin/bash lucasnlm
ls /home/Use the following command to set the user password if needed:
passwd lucasnlmInstall some useful programs, including sudo and add that user to sudoers:
pacman -S dosfstools os-prober mtools network-manager-applet \
networkmanager wpa_supplicant wireless_tools dialog sudo
nano /etc/sudoersAdd lucasnlm ALL=(ALL) ALL in the and of sudoers file.
Run the following commands to define your hostname:
echo lucasnlm > /etc/hostname
cat /etc/hostnameEdit and add following to /etc/hosts:
nano /etc/hosts
# Add
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 lucasnlm.localdomain lucasnlm
Run the following commands:
pacman -S linux-zen linux-zen-headers
mkinitcpio -p linux-zen
uname -rRun the following commands to setup Grub using UEFI:
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --bootloader-id=Arch --recheck
grub-mkconfig -o /boot/grub/grub.cfg
mkdir /boot/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.moMake sure EFI folder is inside /boot and not /boot/EFI/EFI. If that happen, move the inner EFI to /boot.
To create a swap file, run the following codes:
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab