aboutsummaryrefslogtreecommitdiff
path: root/custom/install-archzfs
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-21 00:33:42 -0600
committerCraig Jennings <c@cjennings.net>2026-01-21 00:33:42 -0600
commitcb6d684aff1f2321c56c5b1de6c4da539e3a7a64 (patch)
tree50b8b446990e01bf29f7b48bc0ed365cf608145a /custom/install-archzfs
parent90585039f4a7ae6e7af8e1567a23c4c0b012930b (diff)
downloadarchangel-cb6d684aff1f2321c56c5b1de6c4da539e3a7a64.tar.gz
archangel-cb6d684aff1f2321c56c5b1de6c4da539e3a7a64.zip
Use zfs-import-scan instead of zfs-import-cache for boot
Switch to the recommended pool import method that uses blkid to scan for pools instead of relying on zpool.cache. This eliminates the complexity of managing cachefile paths with altroot during installation. Changes: - Remove cachefile setup from create_zfs_pool() and configure_zfs_services() - Enable zfs-import-scan.service instead of zfs-import-cache.service - Set cachefile=none on the pool since it's not needed - Update full-test.sh to verify zfs-import-scan is enabled This approach is recommended per the Arch Wiki and doesn't require the cachefile to be present in the initramfs.
Diffstat (limited to 'custom/install-archzfs')
-rwxr-xr-xcustom/install-archzfs19
1 files changed, 7 insertions, 12 deletions
diff --git a/custom/install-archzfs b/custom/install-archzfs
index e93186d..5c2380a 100755
--- a/custom/install-archzfs
+++ b/custom/install-archzfs
@@ -773,6 +773,7 @@ create_zfs_pool() {
fi
# Create pool (with or without encryption)
+ # Note: We use zfs-import-scan at boot which doesn't require a cachefile
if [[ "$NO_ENCRYPT" == "yes" ]]; then
warn "Creating pool WITHOUT encryption (testing mode)"
zpool create -f \
@@ -810,13 +811,6 @@ create_zfs_pool() {
fi
info "ZFS pool created successfully."
-
- # Set cachefile property - required for initramfs ZFS hook to import pool at boot
- # Without this, mkinitcpio won't include zpool.cache and boot will fail with
- # "cannot import '(null)': no such pool available"
- info "Setting pool cachefile for boot..."
- zpool set cachefile=/etc/zfs/zpool.cache "$POOL_NAME"
-
zpool status "$POOL_NAME"
}
@@ -1167,7 +1161,10 @@ configure_zfs_services() {
step "Configuring ZFS Services"
arch-chroot /mnt systemctl enable zfs.target
- arch-chroot /mnt systemctl enable zfs-import-cache
+ # Use zfs-import-scan instead of zfs-import-cache
+ # This is the recommended method - it uses blkid to scan for pools
+ # and doesn't require a cachefile
+ arch-chroot /mnt systemctl enable zfs-import-scan
arch-chroot /mnt systemctl enable zfs-mount
arch-chroot /mnt systemctl enable zfs-import.target
@@ -1175,10 +1172,8 @@ configure_zfs_services() {
# Note: hostid is generated in configure_bootloader, so it always exists here
cp /etc/hostid /mnt/etc/hostid
- # Generate zpool cache
- mkdir -p /mnt/etc/zfs
- zpool set cachefile=/etc/zfs/zpool.cache "$POOL_NAME"
- cp /etc/zfs/zpool.cache /mnt/etc/zfs/
+ # Disable cachefile - we use zfs-import-scan which doesn't need it
+ zpool set cachefile=none "$POOL_NAME"
# Set bootfs
zpool set bootfs="$POOL_NAME/ROOT/default" "$POOL_NAME"