aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcustom/install-archzfs19
-rwxr-xr-xscripts/full-test.sh21
2 files changed, 12 insertions, 28 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"
diff --git a/scripts/full-test.sh b/scripts/full-test.sh
index c5fa641..a1e1c3a 100755
--- a/scripts/full-test.sh
+++ b/scripts/full-test.sh
@@ -448,23 +448,12 @@ CONF"
fi
$VERBOSE && info "Genesis snapshot exists"
- # Check cachefile property is set (required for boot)
- local cachefile=$(ssh_cmd "zpool get -H -o value cachefile zroot" 2>/dev/null)
- if [[ "$cachefile" != "/etc/zfs/zpool.cache" ]]; then
- fail "$test_name: Pool cachefile not set (was: '$cachefile', need: '/etc/zfs/zpool.cache')"
- cleanup
- return 1
- fi
- $VERBOSE && info "Pool cachefile property set correctly"
-
- # Check zpool.cache is in initramfs (required for boot)
- local initramfs_cache=$(ssh_cmd "lsinitcpio /boot/initramfs-linux-lts.img 2>/dev/null | grep zpool.cache" 2>/dev/null)
- if [[ -z "$initramfs_cache" ]]; then
- fail "$test_name: zpool.cache missing from initramfs"
- cleanup
- return 1
+ # Check zfs-import-scan is enabled (our preferred import method - no cachefile needed)
+ local import_scan=$(ssh_cmd "systemctl is-enabled zfs-import-scan" 2>/dev/null)
+ if [[ "$import_scan" != "enabled" ]]; then
+ warn "$test_name: zfs-import-scan not enabled (was: '$import_scan')"
fi
- $VERBOSE && info "zpool.cache present in initramfs"
+ $VERBOSE && info "zfs-import-scan service: $import_scan"
# Check kernel
local kernel=$(ssh_cmd "uname -r" 2>/dev/null)