Seriously awesome work on this post, thanks for putting it together. This inspired me to play around with zram and I had a LOT of trouble so I wanted to share my solution in case anyone else has issues.
It installed without issue on Ubuntu 16.04 but simply wouldn't start, responding with the less than helpful zram-config.service: Failed with result 'exit-code'.
To spare anyone the literal hours of troubleshooting I spent on this, the solution is pretty simple:
apt-get -y install linux-image-generic
Run this first and then follow this post from the top.
For anyone wondering why installing
linux-image-generic
works, it's the dependency on the "linux-image-extra
" for your kernel version. Thezram
driver is included in that dependency:Without the package, the necessary driver might not be installed.
Yeah, I read that
It is a module of the mainline Linux kernel since 3.14
and so I checked:$ uname -r 4.4.0-112-generic
And then I scratched my head for a bit until I realized it's not part of the base kernel package.