aboutsummaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-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"