This is based upon the LearnLinux.tv guide and this OdinsPlasmaRifle's gist
- /dev/sda1 will be our EFI partition
- /dev/sda2 will be an encryprted LVM ext4 filesystem
efibootmgr
efibootmgr -b <number> -B
iwctl device list
iwctl station <device> get-networks
iwctl station <device> connect <ssid>
ip addr show
vim /etc/pacman.d/mirrorlist
pacman -Syyy
fdisk -l
gdisk /dev/sda
- EFI : 500 MB, type EF00, sda1
- root : remainder of space, type 8E00, sda2
mkfs.fat -F32 /dev/sda1
cryptsetup luksFormat /dev/sda2
cryptsetup open --type=luks /dev/sda2 lvm
pvcreate --dataalignment 1m /dev/mapper/lvm
vgcreate volgroup0 /dev/mapper/lvm
lvcreate -l 100%FREE volgroup0 -n lv_root
modprobe dm_mod
vgscan
vgchange -ay
mkfs.ext4 /dev/volgroup0/lv_root
mount /dev/volgroup0/lv_root /mnt
mkdir /mnt/boot
mkdir /mnt/etc
genfstab -U -p /mnt > /mnt/etc/fstab
mount /dev/sda1 /mnt/boot
pacstrap -i /mnt base
arch-chroot /mnt
pacman -S linux-lts linux-lts-headers vim base-devel openssh networkmanager wpa_supplicant wireless_tools netctl lvm2
systemctl enable sshd
systemctl enable NetworkManager
vim /etc/mkinitcpio.conf
Locate the "HOOKS" line (52 in my case), move "keyboard" and add "encrypt lvm2", as follows
HOOKS=(base udev autodetect modconf block keyboard encrypt lvm2 filesystems fsck)
mkinitcpio -p linux-lts
vim /etc/locale.gen
Uncomment en_GB.UTF-8
locale-gen
vim /etc/hostname
Add the hostname, e.g. fred
vim /etc/hosts
Add the localhost entry, e.g. 127.0.1.1 fred.domain fred
passwd
useradd -m -g users -G wheel grumpychunks
passwd grumpychunks
pacman -S sudo
EDITOR=vim visudo
uncomment %wheel ALL=(ALL) ALL
pacman -S efibootmgr dosfstools mtools intel-ucode
bootctl --path=/boot install
vim /boot/loader/loader.conf
default arch.conf
timeout 4
console-mode auto
editor no
vim /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux-lts
initrd /intel-ucode.img
initrd /initramfs-linux-lts.img
options cryptdevice=UUID=<uuid>:cryptlvm root=/dev/volgroup0/lv_root quiet rw nomodeset
...whilst still editing in vim, we need to replace with the UUID of /dev/sda2, run the vim command
:read ! blkid /dev/sda2
Note that once the basic system is complete I found the system locked up within seconds of rebooting. I found that the addition of nomodeset
as a kernel option seemed to resolve this on the MacBook Pro. However, later in the installation process, I was unable to start xorg for my desktop environment because of this, but removing the kernel option didn't cause the system to lock up again. I've yet to understand the exact cause of this, but for now this work around should help.
mkinitcpio -p linux-lts
Check the three entries in /boot/loader/entries/arch.conf exist in the /boot directory
exit
umount -a
poweroff
Using poweroff
is preferable to reboot
, as this gives us opportunity to easily remove the installation media.
Connect to wifi using the following command. If run with root privileges, the connection will persist reboots.
sudo nmcli device wifi connect <ssid> password <password>
This is where the rest of the set up is hugely subjective, but I decided to go with a KDE Plasma desktop environment on this installation. The steps to achieve this are very simple
sudo pacman -S xorg plasma-meta kde-applications
sudo systemctl enable sddm
reboot
If things go wrong during the install, you've probably missed a step above, or the Arch installer has changed slightly. To begin investigation, you need to boot from the install media, then replay the following commands (from above) to get yourself back to a workable position to start investigating the problem.
iwctl station <device> get-networks
iwctl station <device> connect <ssid>
cryptsetup open --type=luks /dev/sda2 lvm
mount /dev/volgroup0/lv_root /mnt
mount /dev/sda1 /mnt/boot
arch-chroot /mnt
https://wiki.archlinux.org/index.php/Installation_guide
https://wiki.archlinux.org/index.php/MacBookPro11,x
https://aur.archlinux.org/packages/linux-macbook/
https://loicpefferkorn.net/2015/01/arch-linux-on-macbook-pro-retina-2014-with-dm-crypt-lvm-and-suspend-to-disk/
https://blog.jeaye.com/2016/06/29/encrypted-arch-linux/
https://www.lewis8s.codes/apple/linux/archlinux/macbookpro/2020/01/18/how-to-install-arch-linux-on-macbook.html
https://gist.github.com/ellipticaldoor/793606049f18dfb57e9c24d6fbe0efe4