arch btrfs timeshift - Forest0923/memo GitHub Wiki

System

  • CPU: Intel
  • UEFI Boot

Commands

Keymap

  • Change keymap:
loadkeys jp106

Time

  • Timedatectl:
timedatectl set-ntp true

Mirrorlist

  • Optimize mirror list:
pacman -Syy
pacman -S reflector
reflector -c Japan --sort rate -a 6 --save /etc/pacman.d/mirrorlist

Disk Partitioning

  • Disk partitioning:
gdisk /dev/vda
/dev/vda1: EFI system (200M)
/dev/vda2: Linux filesystem
  • Format partitions:
mkfs.fat -F32 /dev/vda1
mkfs.btrfs /dev/vda2
  • Create subvolume and mount devices:
mount /dev/vda2 /mnt
btrfs su cr /mnt/@
umount /mnt
mount -o compress=lzo,subvol=@ /dev/vda2 /mnt
mkdir -p /mnt/boot/efi
mount /dev/vda1 /mnt/boot/efi

Base Install

  • Install base package:
pacstrap /mnt base linux linux-firmware vim

fstab

  • Generate fstab file:
genfstab -U /mnt >> /mnt/etc/fstab

chroot

  • chroot:
arch-chroot /mnt

Localization

  • Hardware clock:
ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
hwclock --systohc
  • locale:
vim /etc/locale.gen
- # en_US.UTF-8 UTF-8
+ en_US.UTF-8 UTF-8
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo KEYMAP=jp106 >> /etc/vconsole.conf

Set hostname and hosts

  • Hostname:
vim /etc/hostname
+ arch
  • Hosts:
vim /etc/hosts
+ 127.0.0.1   localhost
+ ::1         localhost
+ 127.0.1.1   arch.localdomain    arch

Root password

  • Set root password:
passwd

Install necessary softwares

  • Bootloader:
pacman -S grub efibootmgr os-prober
  • Network and wireless tools:
pacman -S networkmanager network-manager-applet wireless_tools wpa_supplicant dialog
  • Disk:
pacman -S mtools dosgstools
  • Basic apps (bison, make, gcc, sudo, and etc.):
pacman -S base-devel
  • Kernel header files:
pacman -S linux-headers
  • Bluetooth and audio:
pacman -S bluez bluez-utils alsa-utils pulseaudio pulseaudio-bluetooth
  • Desktop:
pacman -S xdg-utils xdg-user-dirs
  • Git:
pacman -S git
  • cron:
pacman -S cron
  • reflector:
pacman -S reflector

Grub install

  • Grub install and make config:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

Systemd

  • Activate network:
systemctl enable NetworkManager
  • Bluetooth:
systemctl enable bluetooth
  • Refresh mirrorlist with reflector
    • Exec options : /etc/xdg/reflector/reflector.conf
    • Weekly setting : /usr/lib/systemd/system/reflector.timer
systemctl enable reflector.service  # update mirrorlist every boot
# or
systemctl enable reflector.timer    # update mirrorlist weekly

Add user

  • Add user:
useradd -mG wheel mori
passwd mori
  • Give the user priviledge:
EDITOR=vim visudo
- # %wheel ALL=(ALL) ALL
+ %wheel ALL=(ALL) ALL

Finish base installation

  • Reboot
exit
umount -a
reboot

Install desktop environment

Install timeshift

  • Install AUR helper:
# yay
git clone https://aur.archlinux.org/yay
cd yay
makepkg -si
# paru
git clone https://aur.archlinux.org/paru
cd paru
makepkg -si
  • Install timeshift:
paru -S timeshift