Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computers:linux:arch-zfs-install [2025/08/31 10:56] – wikiadmin | computers:linux:arch-zfs-install [2025/09/06 11:30] (current) – wikiadmin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Install arch linux with zfs root ===== | + | ===== Install arch linux with zfs root ===== |
| + | |||
| - Obtain latest ISO from archlinux.org and burn it to an ISO | - Obtain latest ISO from archlinux.org and burn it to an ISO | ||
| - Boot up and change / size \ | - Boot up and change / size \ | ||
| Line 7: | Line 9: | ||
| - < | - < | ||
| - < | - < | ||
| - | - Create | + | |
| - | - Create | + | |
| - | - Export/ | + | - I suggest a swap partition large enough to hold RAM (my system has 16g) contents if you intend to use hibernate< |
| - | - Install the system | + | - Allocate the remainder to the ZFS pool< |
| - | - < | + | - Create |
| + | - I suggest using the partition UUID for the device name.< | ||
| + | root@archiso ~ # ls -l / | ||
| + | lrwxrwxrwx 1 root root 10 Sep 2 10:21 1aea6cc8-8333-4d5c-a9e6-e0a51296391d -> ../ | ||
| + | </ | ||
| + | - We will be using [[https:// | ||
| + | zpool create -f -o ashift=12 \ | ||
| + | -O compression=lz4 \ | ||
| + | -O acltype=posixacl \ | ||
| + | -O xattr=sa \ | ||
| + | -O relatime=on \ | ||
| + | -o autotrim=on \ | ||
| + | -o compatibility=openzfs-2.3-linux \ | ||
| + | -m none zroot / | ||
| + | </ | ||
| + | - Export / Import | ||
| + | - Create the ZFS file systems | ||
| + | zfs create -o mountpoint=none zroot/ | ||
| + | zfs create -o mountpoint=/ | ||
| + | zfs mount zroot/ | ||
| + | |||
| + | zfs mount | ||
| + | zroot/ | ||
| + | </ | ||
| + | - Set up EFI and swap partitions< | ||
| + | mkfs.vfat -F32 /dev/sda1 | ||
| + | mkswap / | ||
| + | - Install the system< | ||
| + | - Populate the fstab< | ||
| + | echo " | ||
| + | echo " | ||
| - Move into the install | - Move into the install | ||
| - < | - < | ||
| Line 20: | Line 52: | ||
| locale-gen | locale-gen | ||
| echo " | echo " | ||
| - | - vconsole | + | - vconsole< |
| - | - < | + | - hostname/ |
| - | - hostname/ | + | |
| - | - < | + | |
| - set root password< | - set root password< | ||
| - | - Create a normal user and add to sudoers/ | + | - Create a normal user and add to sudoers/ |
| - | - useradd -G wheel some_user | + | passwd some_user |
| - | | + | mkdir -p ~some_user && chown some_user ~some_user</ |
| - | - visudo to allow wheel group to sudo | + | - edit sudoers with visudo to uncomment one of the wheel stanzas< |
| + | EDITOR=vim visudo</ | ||
| + | - create home for some_user< | ||
| - su - some_user | - su - some_user | ||
| - | - Install paru | + | - Install paru< |
| - | - sudo pacman -S --needed base-devel git | + | git clone https:// |
| - | | + | cd paru |
| - | | + | makepkg -si |
| - | | + | </ |
| - | - Install zfs support | + | - Install zfs support< |
| - | - paru -S zfs-utils | + | paru -S zfs-dkms |
| - | | + | </ |
| - | - exit to root | + | |
| - finish setup | - finish setup | ||
| - < | - < | ||
| - | - edit / | + | - edit / |
| - | - remove fsck, add zfs resume | + | vim / |
| - | - < | + | grep ^HOOKS / |
| + | HOOKS=(base udev autodetect microcode modconf kms keyboard keymap | ||
| + | mkinitcpio | ||
| + | | ||
| - set up services< | - set up services< | ||
| systemctl mask zfs-import-cache.service | systemctl mask zfs-import-cache.service | ||
| - | systemctl enable zfs-import-scan.service | + | systemctl enable zfs-import-scan.service zfs-mount.service zfs.target zfs-volumes.target zfs-import.target zfs-zed.service NetworkManager</ |
| - | systemctl enable | + | - Set up the EFI and install zfsbootmenu< |
| - | systemctl enable | + | zfs set org.zfsbootmenu: |
| - | systemctl enable | + | mkdir /boot/efi |
| - | systemctl enable | + | mount /boot/efi |
| - | systemctl enable | + | mkdir -p / |
| - | systemctl enable | + | curl -o / |
| + | cp / | ||
| + | pacman -S refind | ||
| + | refind-install | ||
| + | rm / | ||
| + | cat << EOF >> / | ||
| + | |||
| + | menuentry "zbm boot" { | ||
| + | loader / | ||
| + | options "quiet loglevel=0 zbm.skip" | ||
| + | } | ||
| + | menuentry "zbm menu" { | ||
| + | loader / | ||
| + | options "quiet loglevel=0 zbm.show" | ||
| + | } | ||
| + | menuentry "zbm backup menu" { | ||
| + | loader / | ||
| + | options "quiet loglevel=0 zbm.show" | ||
| + | } | ||
| + | EOF | ||
| + | </ | ||
| + | - Exit and reboot< | ||
| + | exit | ||
| + | umount -n -R /mnt | ||
| + | zpool export zroot | ||
| + | reboot | ||
| + | </ | ||
| + | - Finish up | ||
| + | - Log in as root< | ||
| + | zfs create -o mountpoint=none zroot/ | ||
| + | zfs create -o mountpoint=/ | ||
| + | zfs create -o mountpoint=/ | ||
| + | cp -r /etc/skel/. ~ | ||
| + | cp -r /etc/skel/. ~some_user | ||
| + | chown -R some_user: | ||
| + | chmod 750 ~some_user | ||
| + | zfs snapshot zroot/ | ||
| + | exit | ||
| + | </ | ||
