Question

I want to switch to ZFS, but still want to encrypt my data. Native Encryption for ZFS was added in "ZFS Pool Version Number 30", but I'm using ZFS on FreeBSD with Version 28. My question is how would encfs (fuse encryption) affect ZFS specific features like data Integrity and deduplication?

Was it helpful?

Solution

encfs has a limit for a file/directory name length which is shorter than that of zfs. I couldn't remember but probably less than 255 chars per object. If you happen to have any files/directories with names exceeding that limit you'll get an i/o error during copying to a mounted encfs resource and the offending file/directory will not be created, that's all.

I do not use deduplication (too little RAM unfortunately) but since encfs uses ECB mode for the encryption of file names, then naturally similar file names are seen as such on the encrypted side (file attributes are unchanged too), which is fortunate for tools like rsync. Unfortunately for deduplication, encfs uses data signing (hmac) for initialization vectors which renders copies of the same content completely different. It is probably feasible to find a way to block this behaviour, but then data integrity depends on it, so I wouldn't recommend that.

If you need device-level encryption take look at cryptsetup. For this you would need to migrate your pool from /dev/disk/by-id/ata-* to /dev/disk/by-id/dm-name-* devices. That would not prohibit using deduplication, only incur slight performance penalty. And you would have to opearate on decrypted data for backup, which may not be desirable.

Currently I am using both methods (that is cryptsetup and encfs). It may seem a little redundant, but I find it necessary to avoid both decrypting data for backup as well as storing encryption parameters in plain text in the .encfs.xml file which bothers my paranoid sense of security ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top