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/29 20:07] – 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 zfs pool | + | - Partition Disk(s) |
| - | - Create | + | - Create |
| - | | + | - I suggest a swap partition large enough to hold RAM (my system |
| - | - Install the system | + | - Allocate the remainder to the ZFS pool< |
| - | - < | + | - Create |
| - | - Create | + | - I suggest using the partition UUID for the device name.< |
| - | - user add -G wheel toms | + | root@archiso ~ # ls -l / |
| - | - passwd toms | + | lrwxrwxrwx 1 root root 10 Sep 2 10:21 1aea6cc8-8333-4d5c-a9e6-e0a51296391d |
| - | - su - toms | + | </ |
| - | - Install paru | + | - We will be using [[https://zfsbootmenu.org|zfsbootmenu]] which is currently using OpenZFS 2.3< |
| - | | + | zpool create |
| - | - git clone https://aur.archlinux.org/paru.git | + | -O compression=lz4 \ |
| - | - cd paru | + | -O acltype=posixacl \ |
| - | - makepkg | + | -O xattr=sa \ |
| - | - Install zfs support | + | -O relatime=on \ |
| - | - paru -S zfs-utils | + | -o autotrim=on \ |
| - | - paru -S zfs-dkms | + | -o compatibility=openzfs-2.3-linux \ |
| - | - exit to root | + | -m none zroot / |
| - | - finish setup | + | </ |
| - | - < | + | - Export / Import the ZFS pool< |
| - | - edit / | + | - Create the ZFS file systems including the home directory for the normal user account.< |
| - | - remove fsck, add zfs resume | + | zfs create |
| - | - < | + | zfs create -o mountpoint=/ |
| - | - set up services< | + | zfs mount zroot/ |
| - | systemctl mask zfs-import-cache.service | + | |
| - | systemctl enable zfs-import-scan.service | + | zfs mount |
| - | systemctl enable zfs-mount.service | + | zroot/ |
| - | systemctl enable zfs.target | + | </ |
| - | systemctl enable zfs-volumes.target | + | |
| - | systemctl enable zfs-import.target | + | mkfs.vfat |
| - | systemctl enable zfs-zed.service | + | mkswap /dev/sda2</ |
| - | systemctl enable NetworkManager</ | + | - Install the system< |
| + | - Populate the fstab< | ||
| + | echo " | ||
| + | echo " | ||
| + | - Move into the install | ||
| + | - < | ||
| + | - Set up arch system | ||
| - Time< | - Time< | ||
| hwclock --systohc</ | hwclock --systohc</ | ||
| Line 44: | Line 52: | ||
| locale-gen | locale-gen | ||
| echo " | echo " | ||
| - | | + | - vconsole< |
| - | | + | - hostname/ |
| - | - < | + | - set root password< |
| - | - hostname/ | + | |
| - | - < | + | passwd some_user |
| - | - < | + | mkdir -p ~some_user && chown some_user ~some_user</ |
| + | - edit sudoers with visudo to uncomment one of the wheel stanzas< | ||
| + | EDITOR=vim visudo</ | ||
| + | - create home for some_user< | ||
| + | - su - some_user | ||
| + | - Install paru< | ||
| + | git clone https:// | ||
| + | cd paru | ||
| + | makepkg -si | ||
| + | </ | ||
| + | - Install zfs support< | ||
| + | paru -S zfs-dkms | ||
| + | </ | ||
| + | - exit to root< | ||
| + | - finish setup | ||
| + | - < | ||
| + | - edit / | ||
| + | vim / | ||
| + | grep ^HOOKS / | ||
| + | HOOKS=(base udev autodetect microcode modconf kms keyboard keymap zfs consolefont block filesystems resume) | ||
| + | mkinitcpio -P</ | ||
| + | - fix up user home directories< | ||
| + | - set up services< | ||
| + | systemctl mask zfs-import-cache.service | ||
| + | systemctl enable zfs-import-scan.service zfs-mount.service zfs.target zfs-volumes.target zfs-import.target zfs-zed.service NetworkManager</ | ||
| + | - Set up the EFI and install zfsbootmenu< | ||
| + | zfs set org.zfsbootmenu: | ||
| + | mkdir /boot/efi | ||
| + | mount /boot/efi | ||
| + | mkdir -p / | ||
| + | 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 | ||
| + | </code> | ||
| + | - 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 | ||
| + | </ | ||
