====== Info ======
Thinkpad T495s/16GB/256GB
===== ISO/Network =====
Download ISO https://archlinux.org/download/\\
write the ISO on a USB key\\
boot\\
\\
Setup network\\
systemctl start iwd
iwctl
iwd]# device list
Devices
--------------------------------------------------------------------------------
Name Address Powered Adapter Mode
--------------------------------------------------------------------------------
wlan0 0c:7a:15:79:77:41 on phy0 station
iwd]# station wlan0 get-networks
Available networks
--------------------------------------------------------------------------------
Network name Security Signal
--------------------------------------------------------------------------------
FuckUMeta psk ****
XXXXXXXXXXXXXXXX psk ****
iwd]# station wlan0 connect FuckUMeta --passphrase **********************
iwd]# exit
ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp3s0f0: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether XX:YY:ZZ:AA:BB:CC brd ff:ff:ff:ff:ff:ff
altname enxf875a4853e1b
4: wlan0: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether XX:YY:ZZ:AA:BB:CC brd ff:ff:ff:ff:ff:ff
inet 192.168.1.156/24 metric 600 brd 192.168.1.255 scope global dynamic wlan0
valid_lft 84979sec preferred_lft 84979sec
inet6 fdbf:275d:b681:f346:e7a:15ff:fe79:7741/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 1741sec preferred_lft 1741sec
inet6 fe80::e7a:15ff:fe79:7741/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
===== Test + SSH =====
network OK ?\\
ping -c3 archlinux.org
Install SSH
pacman -Sy
pacman -S openssh
vim /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes
passwd
systemctl start sshd
\\
Now we can connect from the network
===== Disk partitions =====
==== List ====
# gdisk /dev/nvme0n1 -l
GPT fdisk (gdisk) version 1.0.10
The protective MBR's 0xEE partition is oversized! Auto-repairing.
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 500118192 sectors, 238.5 GiB
Model: KXG6AZNV256G TOSHIBA
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): A49CF274-51B4-4CBF-BE13-5195151DBF6E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 205869677 sectors (98.2 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB EF00 EFI system partition
2 206848 239615 16.0 MiB 0C01 Microsoft reserved ...
3 239616 250570751 119.4 GiB 0700 Basic data partition
4 250570752 292513791 20.0 GiB 0700 Basic data partition
5 498378752 500115455 848.0 MiB 2700
The goal is to make a 16GB swap partition and the btrfs root:
gdisk /dev/nvme0n1
==== SWAP ====
Command (? for help): n
Partition number (6-128, default 6):
First sector (34-500118158, default = 292513792) or {+-}size{KMGTP}:
Last sector (292513792-498378751, default = 498378751) or {+-}size{KMGTP}: +16G
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 8200
Changed type of partition to 'Linux swap'
==== BTRFS root ====
Command (? for help): n
Partition number (7-128, default 7):
First sector (34-500118158, default = 326068224) or {+-}size{KMGTP}:
Last sector (326068224-498378751, default = 498378751) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'
==== Save ====
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/nvme0n1.
The operation has completed successfully.
===== Mount/Format =====
==== SWAP ====
mkswap /dev/nvme0n1p6
swapon /dev/nvme0n1p6
==== BTRFS ====
pacman -Sy btrfs-progs
mkfs.btrfs -L ArchRoot /dev/nvme0n1p7
mount /dev/nvme0n1p7 /mnt
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
umount /mnt
==== Mount /boot /home / ====
mount -o noatime,compress=zstd,space_cache,subvol=@ /dev/nvme0n1p7 /mnt
mkdir -p /mnt/{home,boot}
mkdir /mnt/boot/efi
mount -o noatime,compress=zstd,space_cache,subvol=@home /dev/nvme0n1p7 /mnt/home
mount /dev/nvme0n1p1 /mnt/boot/efi
===== Pacstrap =====
pacstrap /mnt base base-devel linux linux-firmware amd-ucode btrfs-progs vim dhcpcd networkmanager efibootmgr dosfstools sudo git tlp htop zsh
===== FSTAB =====
genfstab -U /mnt >> /mnt/etc/fstab
===== Archlinux Machine setup =====
mount --types proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --rbind /dev /mnt/dev
arch-chroot /mnt /bin/bash
echo "Mjölnir" >/etc/hostname
echo LANG=en_US.UTF-8 > /etc/locale.conf
vim /etc/locale.gen
uncomment
en_US.UTF-8
Generate localeslocale-gen
==== fonts/keymap ====
echo KEYMAP=us-acentos > /etc/vconsole.conf
echo FONT=lat9w-16 >> /etc/vconsole.conf
==== TimeZone ====
ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime
==== /etc/hosts ====
vim /etc/hosts
#
127.0.0.1 .localdomain
==== Initramfs ====
vim /etc/mkinitcpio.conf
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block resume btrfs filesystems fsck)
===== Systemdboot =====
bootctl --esp-path=/boot/efi install
==== Entries ====
default:
cat > /boot/efi/loader/loader.conf <
Archlinux:
cat > /boot/efi/loader/entries/arch.conf <
Note: 43a3c9d5-0253-4f24-af47-7c11f3f39753 = UUID from `blkid /dev/nvme0n1p7`
Windows shit:
cat > /boot/efi/loader/entries/windows.conf <
===== Final step =====
candles
exit
umount -l /mnt/{dev,sys,proc}
umount /mnt/boot/efi
umount /mnt/{home,}
reboot
Notes:
* remount btrfs partition:
mount -t btrfs \
-o subvol=@,noatime,compress=zstd,space_cache=v2 \
/dev/nvme0n1p7 /mnt
* Wifi shit
cat > /tmp/wpa.conf <
wpa_supplicant -B -i wlan0 -c /tmp/wpa.conf
dhcpcd wlan0