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/26 19:38] – 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 5: | Line 7: | ||
| - mount -o remount, | - mount -o remount, | ||
| - Add zfs support | - Add zfs support | ||
| - | - curl -s https:// | + | - < |
| - | - Create a normal user and add to sudoers/ | + | - < |
| - | - user add -G wheel toms | + | - Partition Disk(s) |
| - | | + | - Create EFI partition< |
| - | | + | - I suggest a swap partition large enough to hold RAM (my system has 16g) contents if you intend to use hibernate< |
| - | - passwd toms | + | - Allocate the remainder to the ZFS pool< |
| - | - su - toms | + | - Create the ZFS pool |
| - | - Install paru | + | - I suggest using the partition UUID for the device name.< |
| - | - sudo pacman -S --needed base-devel git | + | root@archiso ~ # ls -l / |
| - | | + | lrwxrwxrwx 1 root root 10 Sep 2 10:21 1aea6cc8-8333-4d5c-a9e6-e0a51296391d -> ../ |
| - | | + | </ |
| - | | + | - We will be using [[https:// |
| - | - Install zfs support | + | zpool create -f -o ashift=12 \ |
| - | - paru -S linux linux-headers | + | -O compression=lz4 \ |
| - | | + | -O acltype=posixacl \ |
| - | - zgenhostid -f 0x00bab10c | + | -O xattr=sa \ |
| + | -O relatime=on \ | ||
| + | -o autotrim=on \ | ||
| + | -o compatibility=openzfs-2.3-linux \ | ||
| + | -m none zroot / | ||
| + | </ | ||
| + | - Export / Import the ZFS pool< | ||
| + | - Create the ZFS file systems including the home directory for the normal user account.< | ||
| + | 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 | ||
| + | - < | ||
| + | - Set up arch system | ||
| + | - Time< | ||
| + | hwclock --systohc</ | ||
| + | - locale< | ||
| + | locale-gen | ||
| + | echo " | ||
| + | - vconsole< | ||
| + | - hostname/ | ||
| + | - set root password< | ||
| + | - Create a normal user and add to sudoers/ | ||
| + | passwd | ||
| + | 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 | ||
| + | </ | ||
| + | - 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 | ||
| + | </ | ||
