Some way to support compression in front of ecryptfs transparently?

2

1

I would like to use ecryptfs for some files/directories, maybe a whole file system. Some of my files can be compressed pretty good, but from what I've read so far ecryptfs doesn't support compression currently. There's file systems like BTRFS or ZFS supporting compression, but from my understanding that shouldn't work in a setup using ecryptfs because the file systems only see random encrypted data and can't compress it anymore.

So is there some transparent way like ecryptfs itself to get compression before encryption?

I'm not interested in things like bzip or manually zipping files or such, I need something transparent, so that applications don't need to care, just like ecryptfs itself works. So I need some file system layer or such. Additionally, I'm aware of lower level things like LUKS, but am especially interested in something on top of the file system to easier be able to use e.g. BTRFS and ZFS with their LVM possibilities to increase storage and such.

Thorsten Schöning

Posted 2017-06-14T10:30:59.093

Reputation: 523

Answers

1

Not with ecryptfs AFAIK.

But if you used a LUKS container you could then use a compressing filesystem like btrfs or zfs.

The downside is LUKS needs a fixed size container (file/partition) first, so if you know the space requirements beforehand it may save space overall.

I've read about methods to get a variable size, or expanding LUKS file using virtual machine hard drive container files...

Xen2050

Posted 2017-06-14T10:30:59.093

Reputation: 12 097

Thanks, I'm aware of LUKS but the downsides of it in combination with BTRFS or ZFS you mentioned are the reason why I'm asking for something on top of the file system, like ecryptfs. Added that to my question. – Thorsten Schöning – 2017-06-15T10:04:26.850