os:archlinux:30l3-2021
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| os:archlinux:30l3-2021 [2021/12/29 19:56] – ↷ Page moved from archlinux:30l3-2021 to os:archlinux:30l3-2021 warnaud | os:archlinux:30l3-2021 [2023/01/06 14:50] (current) – [Battery] warnaud | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Archlinux With BTRFS + systemd-boot | ||
| + | Experience the thrill ! systemd-boot looks less bloated than grub while graphically horrible :-)\\ | ||
| + | Machine has 2 hard drives: | ||
| + | * sdb 256GB msata | ||
| + | * sda 1T SSD | ||
| + | |||
| + | The concept will be to put all system on sda and and data/VMs on sdb | ||
| + | |||
| + | Dowload [[https:// | ||
| + | |||
| + | ====== Enable SSH ====== | ||
| + | On the live system, | ||
| + | ===== Start SSHD ===== | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | ===== Set a password for root ===== | ||
| + | <code bash> | ||
| + | ===== Look up the IP address of the live system ===== | ||
| + | <code bash>ip a</ | ||
| + | |||
| + | ====== Remote PC ====== | ||
| + | On a second PC, connect to the live system via SSH: | ||
| + | |||
| + | <code bash>ssh root@< | ||
| + | |||
| + | ===== Partition disk ===== | ||
| + | A very simple setup: | ||
| + | * sdb1 fat32 EFI crap (from Windows)550MB | ||
| + | * sdb2 swap 10G | ||
| + | * sdb3 btrfs with tons of subvolumes | ||
| + | |||
| + | Adapt if you have only one drive with full Linux install like: | ||
| + | * sda1 (home) btrfs all drive | ||
| + | |||
| + | |||
| + | <code bash> | ||
| + | # tout sda en linux | ||
| + | o [enter] | ||
| + | n[enter] | ||
| + | [enter x 4] | ||
| + | w [enter] | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | ==== Create new partition table ==== | ||
| + | < | ||
| + | Command (? for help): o</ | ||
| + | |||
| + | ==== Create an EFI partition (optional if you already have Windows installed)==== | ||
| + | < | ||
| + | Partition number (1-128, default 1):[enter] | ||
| + | First sector (34-500118158, | ||
| + | Last sector (2048-500118158, | ||
| + | Hex code or GUID (L to show codes, Enter = 8300): EF00 | ||
| + | </ | ||
| + | | ||
| + | ==== SWAP ==== | ||
| + | < | ||
| + | Partition number (2-128, default 2): [enter] | ||
| + | First sector (34-500118158, | ||
| + | Last sector (1128448-500118158, | ||
| + | Hex code or GUID (L to show codes, Enter = 8300): 8200 [enter] | ||
| + | </ | ||
| + | ==== Create a root partition ==== | ||
| + | Select default values | ||
| + | < | ||
| + | Partition number (3-128, default 3): [enter] | ||
| + | First sector (34-500118158, | ||
| + | Last sector (22099968-500118158, | ||
| + | Hex code or GUID (L to show codes, Enter = 8300): [enter] | ||
| + | </ | ||
| + | ==== Write the new partitions to disk ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | ===== Format partitions ===== | ||
| + | |||
| + | < | ||
| + | mkfs.vfat -F32 -n EFI /dev/sdb1 ## if not already existing | ||
| + | mkswap -L SWAP /dev/sdb2 # Adapt if necessary | ||
| + | mkfs.btrfs -L ROOT /dev/sdb3 # Adapt if necessary | ||
| + | mkfs.btrfs -L HOME / | ||
| + | |||
| + | ===== Subvolumes creation ===== | ||
| + | <code bash> | ||
| + | # Adapt if necessary | ||
| + | mount /dev/sdb3 /mnt | ||
| + | btrfs sub create /mnt/@ | ||
| + | btrfs sub create /mnt/@pkg | ||
| + | btrfs sub create / | ||
| + | btrfs sub create /mnt/@btrfs | ||
| + | umount /mnt | ||
| + | |||
| + | mount /dev/sda1 /mnt | ||
| + | btrfs sub create /mnt/@home | ||
| + | umount /mnt | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Mount the subvolumes ===== | ||
| + | <code bash> | ||
| + | mount -o noatime, | ||
| + | mkdir -p / | ||
| + | #mount -o noatime, | ||
| + | mount -o noatime, | ||
| + | mount -o noatime, | ||
| + | mount -o noatime, | ||
| + | mount -o noatime, | ||
| + | </ | ||
| + | <code bash> | ||
| + | mount /dev/sdb1 /mnt/boot # Adapt if necessary | ||
| + | swapon /dev/sdb2 # Adapt if necessary | ||
| + | </ | ||
| + | ===== Base System ===== | ||
| + | Install Arch Linux with (adjust this list to your needs): | ||
| + | |||
| + | <code bash> | ||
| + | Optional, for über security :!: If Multibooting... Microsoft creates a 100MB EFI partition so you cannot have 20 linux kernel...) | ||
| + | Second warning :!: some modules need recompiling (acpi_call/ | ||
| + | <code bash> | ||
| + | ===== Generate /etc/fstab ===== | ||
| + | <code bash> | ||
| + | ====== System Configuration ====== | ||
| + | |||
| + | ===== chroot into the new system ===== | ||
| + | <code bash> | ||
| + | |||
| + | ===== Set host name ===== | ||
| + | <code bash> | ||
| + | ===== Set locale ===== | ||
| + | <code bash> | ||
| + | Uncomment the following appropriates locales in / | ||
| + | < | ||
| + | en_US.UTF-8 | ||
| + | </ | ||
| + | ===== Generate locale ===== | ||
| + | <code bash> | ||
| + | ===== Set keyboard layout and font ===== | ||
| + | |||
| + | <code bash> | ||
| + | echo FONT=lat9w-16 >> / | ||
| + | ===== Set time zone ===== | ||
| + | <code bash>ln -sf / | ||
| + | ===== /etc/hosts ===== | ||
| + | <code perl> | ||
| + | #< | ||
| + | 127.0.0.1 < | ||
| + | </ | ||
| + | |||
| + | ====== Initramfs ====== | ||
| + | |||
| + | Configure the creation of initramfs by editing / | ||
| + | Change the line HOOKS=... to: | ||
| + | |||
| + | <code bash> | ||
| + | ===== Recreate initramfs ===== | ||
| + | <code bash> | ||
| + | ====== Boot Manager ====== | ||
| + | ===== Install systemd-boot ===== | ||
| + | <code bash> bootctl --path=/ | ||
| + | |||
| + | ===== Arch entry ===== | ||
| + | |||
| + | Create file **/ | ||
| + | <code perl> | ||
| + | title Arch Linux | ||
| + | linux / | ||
| + | initrd / | ||
| + | initrd / | ||
| + | options root=" | ||
| + | </ | ||
| + | Edit file **/ | ||
| + | <code perl> | ||
| + | default | ||
| + | timeout | ||
| + | console-mode max | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | ====== Final Steps ====== | ||
| + | Exit chroot, unmount partitions and reboot: | ||
| + | |||
| + | <code bash> | ||
| + | passwd | ||
| + | exit | ||
| + | umount -R /mnt | ||
| + | reboot</ | ||
| + | |||
| + | ====== Troubleshoot ====== | ||
| + | ===== Network ===== | ||
| + | If you forgot dhcpcd... like I did first time: | ||
| + | <code bash>ip addr add 192.168.1.116/ | ||
| + | ip link set enp0s25 up | ||
| + | ip route add 192.168.1.0/ | ||
| + | echo " | ||
| + | </ | ||
| + | |||
| + | ====== Post install ====== | ||
| + | ===== Wifi ===== | ||
| + | <code bash> | ||
| + | To know the module: | ||
| + | <code bash> | ||
| + | Set the interface up | ||
| + | <code bash> ip link set wlp3s0 up</ | ||
| + | |||
| + | ===== Enp0s25 ===== | ||
| + | Isn't that a beautiful name? so romantic and of course more simple than eth0.... Thank you Lenard | ||
| + | <code bash> | ||
| + | systemctl enable --now NetworkManager | ||
| + | </ | ||
| + | If you don't want NetworkManager | ||
| + | <code bash> | ||
| + | |||
| + | ===== Tools ===== | ||
| + | Start building and installing nice stuff | ||
| + | <code bash> | ||
| + | ===== Configure pacman ===== | ||
| + | <code bash>vi / | ||
| + | See: [[https:// | ||
| + | === Color === | ||
| + | Remove the "#" | ||
| + | ===== LARBS ===== | ||
| + | < | ||
| + | sh larbs.sh</ | ||
| + | FAILOVER method: | ||
| + | < | ||
| + | cd LARBS | ||
| + | sh larbs.sh | ||
| + | </ | ||
| + | ===== Battery ===== | ||
| + | ==== tp-battery-mode ==== | ||
| + | * https:// | ||
| + | <code bash>yay -S tp-battery-mode</ | ||
| + | Config | ||
| + | <code bash>vi / | ||
| + | <code perl> | ||
| + | START_THRESHOLD=85 | ||
| + | STOP_THRESHOLD=100 | ||
| + | </ | ||
| + | Enable | ||
| + | <code bash> | ||
| + | systemctl start tp-battery-mode</ | ||
| + | |||
| + | ==== Battery Modes ==== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | <code bash> | ||
| + | systemctl enable --now acpid | ||
| + | </ | ||
| + | |||
| + | Then add | ||
| + | <code perl> | ||
| + | in **/ | ||
| + | === Laptop Mode Tools === | ||
| + | From aur | ||
| + | < | ||
| + | systemctl enable --now laptop-mode | ||
| + | </ | ||
| + | === CPU frequenct Squaling === | ||
| + | <code bash> | ||
| + | systemctl enable --now thermald | ||
| + | systemctl enable --now cpupower | ||
| + | acpi -i -b</ | ||
| + | <code bash>vi / | ||
| + | :!: Uncomment #ondemand | ||
| + | |||
| + | |||
| + | ===== Backlight ===== | ||
| + | Fn+F8/F9 works when adding | ||
| + | <code perl> | ||
| + | to **/ | ||
| + | ===== Firewall ===== | ||
| + | * https:// | ||
| + | <code bash> | ||
| + | systemctl enable --now firewalld</ | ||
| + | ===== SUSPEND to disk ===== | ||
| + | This requires a SWAP partition/ | ||
| + | * https:// | ||
| + | * https:// | ||
| + | <code perl> | ||
| + | <code perl> | ||
| + | |||
| + | in **/ | ||
| + | <code perl> | ||
| + | then | ||
| + | </code bash> | ||
| + | ===== TROUBLESHOOTING ===== | ||
| + | <code bash> journalctl -p 3 -xb</ | ||
| + | ===== BLUETOOTH ===== | ||
| + | * https:// | ||
| + | <code bash> | ||
| + | | ||
| + | modprobe btusb | ||
| + | systemctl enable --now bluetooth | ||
| + | yay bcm20702a | ||
| + | bluetoothctl</ | ||
| + | ==== NTP ==== | ||
| + | * https:// | ||
| + | |||
| + | <code bash> | ||
| + | pacman -S chrony</ | ||
| + | * / | ||
| + | Uncomment / change iburst to offline | ||
| + | <code perl> | ||
| + | server 0.arch.pool.ntp.org offline | ||
| + | server 1.arch.pool.ntp.org offline | ||
| + | server 3.arch.pool.ntp.org offline | ||
| + | </ | ||
| + | * Run | ||
| + | <code bash> | ||
| + | systemctl enable --now chronyd | ||
| + | chronyc | ||
| + | chronyc> online | ||
| + | 200 OK | ||
| + | chronyc> exit | ||
| + | </ | ||
| + | ==== Blackarch ==== | ||
| + | <code bash> | ||
| + | chmod +x strap.sh | ||
| + | sudo ./strap.sh | ||
| + | </ | ||
| + | ==== print ==== | ||
| + | * https:// | ||
| + | <code bash> | ||
| + | systemctl enable --now cups</ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ====== TODO ====== | ||
| + | ===== AUDIO ===== | ||
| + | * https:// | ||
| + | |||
| + | <code bash> | ||
| + | alsamixer | ||
| + | speaker-test -c 2 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== TIMESHIFT ===== | ||
| + | * https:// | ||
| + | |||
| + | ===== Suspend to disk/ram ===== | ||
| + | check if suspend works on hardened linux + if reboot works after no more batteries | ||
| + | -> 5% -> hibernate rule etc,,, | ||
| + | |||
| + | ===== Mutt-Wizzard ===== | ||
| + | |||
| + | ===== Cybersecurity tools ===== | ||
| + | |||
| + | ==== Hardened linux ==== | ||
| + | |||
| + | |||
| + | === Sound === | ||
| + | |||
| + | |||
| + | ===== Optional utilities ===== | ||
| + | |||
| + | ccze libreoffice discord irssi newsflash kitty zsh-* starship | ||
| + | |||
| + | |||
| + | ===== Starship prompt ===== | ||
| + | * https:// | ||
| + | |||
| + | ===== Battery ===== | ||
| + | cpufreq ? | ||
| + | |||
| + | MISSING: backlight on battery | ||
| + | ===== US International layout ===== | ||
| + | if using larbs: | ||
| + | <code bash> | ||
| + | vi ~/ | ||
| + | </ | ||
| + | add | ||
| + | <code perl> | ||
| + | setxkbmap -layout us -variant intl</ | ||
| + | ====== Référence ====== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
