Skip to content

Instantly share code, notes, and snippets.

@maninalift
Created March 8, 2017 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maninalift/2d9f0d84b18f78cabfd3e05938bc2406 to your computer and use it in GitHub Desktop.
Save maninalift/2d9f0d84b18f78cabfd3e05938bc2406 to your computer and use it in GitHub Desktop.

Based on https://nixos.org/wiki/ZFS_on_NixOS I did the following

Added

  boot.supportedFilesystems = [ "zfs" ];

to configuration.nix

Then run

nixos-rebuild switch
modprobe zfs
  
zpool create -f -o ashift=12 -m /mnt/zdata zdata \
               mirror \
                  ata-TOSHIBA_HDWD130_Y6CJLGNAS \
                  ata-TOSHIBA_HDWD130_Y6CJGJMAS
                
zfs create -o mountpoint=legacy zdata/home 
zfs create -o mountpoint=legacy zdata/roothome
mount -t zfs zdata/home /home   
mount -t zfs zdata/roothome /root

nixos-generate-config
nixos-rebuild switch

All of the above seems to work correctly, however on reboot my zpool disappears and I have to run zpool import zdata to get the pool back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment