ZFS: Difference between revisions

imported>Ryantm
No edit summary
imported>Ryantm
No edit summary
Line 14: Line 14:
==Importing on boot==
==Importing on boot==


If you create a zpool, it will not be imported on the next boot unless you either add a fileSystems entry:
If you create a zpool, it will not be imported on the next boot unless you either add the zpool name to <syntaxhighlight lang="nix" inline>boot.zfs.extraPools</syntaxhighlight:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
## In /etc/nixos/configuration.nix:
## In /etc/nixos/configuration.nix:
fileSystems."/mount/point" = {
boot.zfs.extraPools = [ "zpool_name"];
  device = "zpool_name";
  fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];
};
</syntaxhighlight>
</syntaxhighlight>


or add the zpool name to <syntaxhighlight lang="nix" inline>boot.zfs.extraPools</syntaxhighlight> and set the mount point in zfs:
or if you are using legacy mountpoints add a fileSystems entry:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
## In /etc/nixos/configuration.nix:
## In /etc/nixos/configuration.nix:
boot.zfs.extraPools = [ "zpool_name"];
fileSystems."/mount/point" = {
</syntaxhighlight>
  device = "zpool_name";
 
  fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];
<syntaxhighlight>
};
# zfs set canmount=on zpool_name
# zfs set mountpoint=/mount/point zpool_name
</syntaxhighlight>
</syntaxhighlight>