ZFS: Difference between revisions

imported>Bitonic
Detect if `zfs` is not running in remote unlock -- happens when the pool is degraded at boot
imported>Vater
No edit summary
Line 1: Line 1:
[[NixOS]] has native support for ZFS ([[wikipedia:ZFS]]). It uses the code from the [http://zfsonlinux.org/ ZFS on Linux project], including kernel modules and userspace utilities. The installation isos also come with zfs.
'''[https://openzfs.org/ ZFS]''' ([[wikipedia:en:ZFS]]), also known as '''OpenZFS''' ([[wikipedia:en:OpenZFS]]), is a software for a file system[[category:file system]].
<!--
 
[[ZFS]] is not part of the manual.[[category:manual]]<ref>https://nixos.org/manual/nixos/stable/index.html#ch-file-systems</ref>
-->
 
[[ZFS]] is a package[[category:package]].<ref>https://search.nixos.org/packages?type=packages&query=zfs</ref>.
 
[[ZFS]] is a service[[category:service]].<ref>https://search.nixos.org/options?query=zfs</ref>
 
[[ZFS]] is written in [[C]][[category:c]].
 
[[ZFS]] is maintained by [[OpenZFS Project]][[category:OpenZFS Project]].
 
[[ZFS]] is a file system [[NixOS]] runs on. So [[NixOS]] can be installed with and on [[ZFS]].
 
== Source ==
 
[[NixOS]] uses the code from the [http://zfsonlinux.org/ ZFS on Linux project], including kernel modules and userspace utilities. The installation isos also come with zfs.


== What works ==
== What works ==
Line 20: Line 38:


{{note|For now, setting <code><nowiki>boot.kernelParams = [ "nohibernate" ];</nowiki></code>is necessary to avoid the issue described above.}}
{{note|For now, setting <code><nowiki>boot.kernelParams = [ "nohibernate" ];</nowiki></code>is necessary to avoid the issue described above.}}


== Caveats ==  
== Caveats ==  
Line 28: Line 45:
* By default, all ZFS pools available to the system will be forcibly imported during boot, regardless if you had imported them before or not. You should be careful not to have any other system accessing them at the same time, otherwise it will corrupt your pools. Normally (for the common desktop user) this should not be a problem, as a hard disk is usually only directly connected to one machine. This behaviour can be disabled by setting <code>boot.zfs.forceImportAll = false</code>.
* By default, all ZFS pools available to the system will be forcibly imported during boot, regardless if you had imported them before or not. You should be careful not to have any other system accessing them at the same time, otherwise it will corrupt your pools. Normally (for the common desktop user) this should not be a problem, as a hard disk is usually only directly connected to one machine. This behaviour can be disabled by setting <code>boot.zfs.forceImportAll = false</code>.
* If you create a zpool in the installer, make sure you run `zpool export <pool name>` after `nixos-install`, or else when you reboot into your new system, zfs will fail to import the zpool.
* If you create a zpool in the installer, make sure you run `zpool export <pool name>` after `nixos-install`, or else when you reboot into your new system, zfs will fail to import the zpool.


== How to use it ==
== How to use it ==