ZFS: Difference between revisions

imported>Fadenb
m whitespace removal
imported>Fpletz
Added automatic scrubbing
Line 50: Line 50:
The <code>nixos-generate-config</code> command regenerates your <code>/etc/nixos/hardware-configuration.nix</code> file, which includes the list of filesystems for NixOS to mount during boot, e.g.:
The <code>nixos-generate-config</code> command regenerates your <code>/etc/nixos/hardware-configuration.nix</code> file, which includes the list of filesystems for NixOS to mount during boot, e.g.:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
(...)
   fileSystems."/home" =
   fileSystems."/home" =
     { device = "rpool/home";
     { device = "rpool/home";
Line 60: Line 59:
       fsType = "zfs";
       fsType = "zfs";
     };
     };
(...)
</syntaxhighlight>
</syntaxhighlight>
== Automatic Scrubbing ==
Regular scrubbing of ZFS pools is recommended and can be enabled in your NixOS configuration via:
<syntaxhighlight lang="nix">
services.zfs.autoScrub.enable = true;
</syntaxhighlight>
You can tweak the interval (defaults to once a week) and which pools should be scrubbed (defaults to all).


== How to use the auto-snapshotting service ==
== How to use the auto-snapshotting service ==