Talk:ZFS: Difference between revisions
imported>Vater m Vater moved page Talk:NixOS on ZFS to Talk:ZFS |
imported>Vater →best practice: new section |
||
(3 intermediate revisions by 3 users not shown) | |||
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. | |||
== Unable to follow instructions from "Laying out the filesystem hierarchy" == | |||
I tried following the instructions from [[ZFS#Laying_out_the_filesystem_hierarchy]] but the system never fully booted and had errors about being unable to mount "/home" or "/root". | |||
The fix was to use a legacy mountpoint instead, while also reducing the number of ZFS data sets to a minimum and using "/" as a ZFS data set instead of tmpfs. | |||
--[[User:Grische|Grische]] ([[User talk:Grische|talk]]) 12:45, 26 February 2022 (UTC) | |||
== Inclusion of /var/persist == | |||
Looking over the post, there is no mention of creating a /var/persist directory. I'd personally recommend adding it as a separate volume/dataset which is autosnapshotted in case it is needed. | |||
# zfs create -o canmount=on rpool/nixos/var/persist | |||
--[[User:Keksbg|Keksbg]] ([[User talk:Keksbg|talk]]) 21:55, 29 March 2022 (UTC) | |||
== best practice == | |||
; Datasets: | |||
* https://grahamc.com/blog/nixos-on-zfs/ |