Skip to content

ArchLinux

Arch Linux Tips

Mac stuff

https://loicpefferkorn.net/2015/01/arch-linux-on-macbook-pro-retina-2014-with-dm-crypt-lvm-and-suspend-to-disk/
https://mchladek.me/post/arch-mbp/

Installation

Better InitFS

Make Bootable USB:

sudo dd bs=4M if=/path/to/arch.iso of=/dev/sdx

Install paru:

#Install Black arch
curl -O https://blackarch.org/strap.sh
chmod +x strap.sh
sudo ./strap.sh

#Install paru
pacman -S paru

Install List:

#Generate List of installed packages
pacman -Qqen > pkglist.txt

#Install List of packages
pacman -S - < pkglist.txt

Recover from bad boot

Mount encrypted Drive:

cryptsetup open /dev/sda3 root
mount /dev/mapper/lvm-root /mnt
arch-chroot /mnt
mount /sda1 /boot
bootctl update

Update microcode

Install Intel Package:

yay install intel-ucode 

Update Bootloader:

>>> cat /boot/loader/entries/arch-mac-enc-lvm.conf 
title ArchLinux Encrypted
linux /vmlinuz-linux-macbook
initrd /intel-ucode.img
initrd /initramfs-linux-macbook.img
options cryptdevice=UUID=df915784-8700-4718-a4d9-7112e6bb7fbf:root root=/dev/mapper/lvm-root quiet rw hid_apple.iso_layout=0 libata.force=noncq resume=/dev/mapper/lvm-swap processor.ignore_ppc=1

Enable Hibernation

Enable Swap space:

sudo swapon --show # or `cat /proc/swaps`
sudo swapoff -a
sudo fallocate -l <SIZE>G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show # to verify changed size

Get UUID:

sudo swap-offset /swapfile
> <OFFSET>
sudo findmnt -no SOURCE,UUID -T /swapfile 
> <UUID>

Update GRUB:

#Update /etc/default/grub
`GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=<UUID> resume_offset=<OFFSET>"`

# Create /etc/initramfs-tools/conf.d/resume
sudo update-grub
sudo update-initramfs -u -k all

Wayland

Full Wayland Setup on Arch Linux

https://github.com/swaywm/sway/wiki/i3-Migration-Guide
https://github.com/Alexays/Waybar/wiki/Examples

MOZ_ENABLE_WAYLAND=1

Old Installer

#Create
parted mklabel gpt
parted mkpart primary 1MB 2048MB
parted mkpart primary 2048MB 100%
parted print

#Create encrypted volume
cryptsetup --batch-mode --verbose --type luks2 --pbkdf argon2id --hash sha512 --iter-time 1000 --use-urandom luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 crypt

#Create lvm swap and root
pvcreate /dev/mapper/crypt
vgcreate lvm /dev/mapper/crypt
lvcreate -n swap -L 32GB lvm
lvcreate -n root -l 100%FREE lvm

#Make swap and root
mkswap /dev/mapper/lvm-swap
mkfs.ext4 /dev/mapper/lvm-root


#Edit the mkinitcpio.conf
#HOOKS="base udev autodetect modconf block keyboard encrypt lvm2 filesystems fsck"
mkinitcpio -p linux

#Install bootloader
bootctl --path=/boot/ install

cat /boot/loader/loader.conf

cat /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID={UUID}:crypt root=/dev/lvm/root quiet rw

#in vim use :read ! blkid /dev/sda2

#reboot
exit
umount -R /mnt
reboot

Fix Plex Acl issue

setfacl -m "g:plex:rwx" /run/media/generalzero
usermod -a -G generalzero plex