Based on:
- I assume that
/dev/nvme0n1
is the system's disk, and/dev/sda
is USB drive. - RAM is 32G
-
Download arch iso image from https://www.archlinux.org/ and copy to a USB drive.
# dd if=arch.iso of=/dev/sdb
-
Boot up and pressing the F2 key
Under 'System Configuration', change the SATA Mode from the default "RAID" to "AHCI". This will allow Linux to detect the NVME SSD. Under 'Secure Boot', disable secure boot to allow Linux to boot. Under 'POST Behaviour', change "Fastboot" to "Thorough". This prevents intermittent boot failures. Save & Reboot
-
Connect to internet. Useful commands:
# iwctl --passphrase <passphrase> station wlan0 connect <SSID>
-
Partitioning
# gdisk /dev/nvme0n1 # o # n # 1 # 4096 # +512M # ef00 # n # 2 # <Enter> # <Enter> # 8e00 # w # y
Format Partitions:
# mkfs.fat -F32 /dev/nvme0n1p1
-
Setup encryption
# cryptsetup -c aes-xts-plain64 -y --use-random luksFormat /dev/nvme0n1p2 # cryptsetup luksOpen /dev/nvme0n1p2 luks
-
Create LVM Partitions This creates one partions for root, modify if /home or other partitions should be on separate partitions
# pvcreate /dev/mapper/luks # vgcreate vg0 /dev/mapper/luks # lvcreate --size 8G vg0 --name swap # lvcreate -l +100%FREE vg0 --name root
-
Format LVM partitions
# mkfs.ext4 /dev/vg0/root # mkswap /dev/vg0/swap
-
Mount the new system
# mount /dev/vg0/root /mnt # mkdir /mnt/boot # mount /dev/nvme0n1p1 /mnt/boot # swapon /dev/vg0/swap
-
Install the base system
# pacstrap -i /mnt base base-devel linux linux-firmware lvm2 openssh git vim intel-ucode lm_sensors networkmanager
-
Generate
/etc/fstab
. This file can be used to define how disk partitions, various other block devices, or remote filesystems should be mounted into the filesystem.# genfstab -pU /mnt >> /mnt/etc/fstab
(Optional) For making /tmp a ramdisk, add following line to /mnt/etc/fstab:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
-
Enter the new system
# arch-chroot /mnt /bin/bash
-
Set TimeZone
See available timezones: # ls /usr/share/zoneinfo/ Set timezone: # ln -s /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
-
Set Locale
# vim /etc/locale.gen (uncomment en_US.UTF-8 UTF-8) # locale-gen # echo LANG=en_US.UTF-8 > /etc/locale.conf # export LANG=en_US.UTF-8
-
Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.
# hwclock --systohc --utc
-
Set hostname
# echo myhostname >/etc/hostname
Add it to /etc/hosts:
127.0.1.1 myhostname.localdomain myhostname
-
Create User
# useradd -m -g users -G wheel chrislee # passwd chrislee # visudo uncomment %wheel ALL=(ALL) ALL
-
Configure mkinitcpio with modules needed for the initrd image
# vim /etc/mkinitcpio.conf MODULES=(ext4 nvidia nvidia_modeset nvidia_uvm nvidia_drm xhci_pci wd719x aic94xx) HOOKS=(base systemd autodetect keyboard modconf block sd-encrypt sd-lvm2 filesystems fsck) COMPRESSION="lz4"
Regenerate initrd image
# mkinitcpio -p linux
-
Setup systemd-boot
# bootctl --path=/boot install # mkdir -p /boot/loader # vim /boot/loader/loader.conf default arch.conf timeout 2 editor 0 # blkid -s UUID -o value /dev/nvme0n1p2
# mkdir -p /boot/loader/entries/ # vim /boot/loader/entries/arch.conf title Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options rd.luks.name=<UUID>=cryptlvm root=/dev/vg0/root resume=/dev/vg0/swap rd.luks.options=discard mem_sleep_default=deep acpi_rev_override=5 nvidia-drm.modeset=1 quiet splash rw # bootctl --path=/boot update # mkdir -p /etc/pacman.d/hooks/ # vim /etc/pacman.d/hooks/systemd-boot.hook [Trigger] Type = Package Operation = Upgrade Target = systemd [Action] Description = Updating systemd-boot When = PostTransaction Exec = /usr/bin/bootctl update
-
Enabled some services
# systemctl enable fstrim.timer # systemctl enable NetworkManager
-
Exit new system and unmount all partitions
# exit # umount -R /mnt # swapoff -a
-
Reboot into the new system. Don't forget to remove the CD/USB.
# reboot
-
System is installed now. If you want to install Gnome desktop, perform following steps.
-
Setup WiFi
# nmtui
-
Download base/gnome installer script
# curl https://raw.githubusercontent.com/exah-io/arch-linux/master/2_gnome.sh -o 2_gnome.sh # chmod +x 2_gnome.sh # ./2_gnome.sh
-
Install OLED brigtness control
# git clone https://github.com/udifuchs/icc-brightness # make Test with watch # ./icc-brightness watch Install # sudo make install Reboot
-
Install fish
# yay -S fish # curl -L https://get.oh-my.fish | fish # sudo pacman -S fzf # omf install https://github.com/jethrokuan/fzf # omf install bobthefish # chsh -s /usr/local/bin/fish # git clone https://github.com/powerline/fonts.git --depth=1 # cd fonts # ./install.sh # cd .. # rm -rf fonts # gnome-terminal -e fish