Talk:ZFS: Difference between revisions

imported>Vater
m Vater moved page Talk:NixOS on ZFS to Talk:ZFS
imported>Thedude
Suggest adding 'sleep' to multi-pool encrypted ZFS example.
Line 13: Line 13:


--[[User:Mohe2015|Mohe2015]] ([[User talk:Mohe2015|talk]]) 15:46, 22 March 2021 (UTC)
--[[User:Mohe2015|Mohe2015]] ([[User talk:Mohe2015|talk]]) 15:46, 22 March 2021 (UTC)
== Multiple Encrypted Pools Issue ==
I tried following the "Import and unlock multiple encrypted pools/dataset at boot" section (and friends) but could not get it to work, with the dataset either not being mounted, or the boot aborting with a permission error. What finally fixed it for me:
  # Create pool like so:
  zpool create <your-other-options> -O keyformat=passphrase pool_name $DISK_HDD
 
And use this for initrd.network.postCommands:
        cat <<EOF > /root/.profile
        if pgrep -x "zfs" > /dev/null
        then
          zpool import hdd  # Import pool like in example
          sleep 3          #  <---- THIS IS THE IMPORTANT PART
          zfs load-key -a
          killall zfs
        else
          echo "zfs not running -- maybe the pool is taking some time to load for some unforseen reason."
        fi
        EOF
Long story short, I think the example on the ZFS page should include the sleep.