Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1605  / 2 Years ago, sat, november 12, 2022, 7:34:43

I am currently trying to change over a data dump server running 19.04 from LUKS+btrfs to ZFS.
The system drive is LUKS-encrypted and can be decrypted via SSH. It contains a key file that is supposed to decrypt the ZFS filesystems. I am halfway there but automount does not work.




  • I have managed to compile ZFS 0.8.1 and build a DKMS package following the wiki. By reading the makefile, I have in addition found out that I also need to make deb-utils to get zpool and such.

  • I created a pool that supports encryption



    zpool create -o ashift=12 dataint /dev/disk/by-id/mydrive
    zpool set feature@encryption=enabled dataint


  • I created filesystems in it that are encrypted with the keyfile



    zfs create
    -o encryption=on
    -o keylocation=file:///root/keys/hdd256.key -o keyformat=raw
    dataint/test


  • I can mount this with zfs mount dataint -l




The issues I have now are:




  1. zfs is not loaded at startup. Not even the kernel module and accordingly certainly not the pool.


  2. Encrypted volumes are only loaded when the pool is imported or the filesystem is mounted with the -l option. I guess that has to be addressed somehow for autoload when 1. is solved?




I do have some zfs systemd services, but they are masked. Not sure if they are leftovers from a prior 0.7 package manager installation, which I removed.


More From » mount

 Answers
6

I have fully solved the issue now, which essentially has too parts.




  1. The systemd services have to be built into the deb package at all. Unfortunately, the wiki packe linked above is very sloppy, as discussed here in the issue tracker.



In short, the build commands for DKMS deb should be



$ ./configure
$ make -j1 deb-utils deb-dkms



  1. Old installation needs to be cleaned up



Command:



sudo systemctl unmask zfs*


and the new services need to be enabled and started.



I have also described how to deal with encrypted datasets here.


[#5340] Saturday, November 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
velelf

Total Points: 395
Total Questions: 115
Total Answers: 107

Location: Sudan
Member since Mon, Jun 1, 2020
4 Years ago
;