ZFS: Difference between revisions

Illode (talk | contribs)
Update notes on using SWAP and add warning about hibernation
Achooie (talk | contribs)
Line 182: Line 182:
};
};
</syntaxhighlight>
</syntaxhighlight>
If you used bus-based disk names in the <syntaxhighlight inline>zpool create</syntaxhighlight> command, e.g., <syntaxhighlight inline>/dev/sda</syntaxhighlight>, NixOS may run into issues importing the pool if the names change. Even if the pool is able to be mounted (with <syntaxhighlight lang="nix" inline>boot.zfs.devNodes = "/dev/disk/by-partuuid";</syntaxhighlight> set), this may manifest as a <syntaxhighlight inline>FAULTED</syntaxhighlight> disk and a <syntaxhighlight inline>DEGRADED</syntaxhighlight> pool reported by <syntaxhighlight inline>zpool status</syntaxhighlight>. The fix is to re-import the pool using disk IDs:
<syntaxhighlight>
# zpool export zpool_name
# zpool import -d /dev/disk/by-id zpool_name
</syntaxhighlight>
The import setting is reflected in <syntaxhighlight inline>/etc/zfs/zfs.cache</syntaxhighlight>, so it will persist through subsequent boots.


== Mount datasets at boot ==
== Mount datasets at boot ==