Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a ramdisk who handle transparent realtime compression on write and decompression on read.

Example : I use /dev/shm, or I create a new tmpfs, mount it writeable and compressed.

I wrote and read about 500 Mb - 1 GB of text files. The files' content is not fixed, every few seconds the files are updated.

So squashfs / zramswap seems not to fit my goal.

I wonder about fusecompress or other solutions.

share|improve this question

It seems it is possible to use zram without swap.

This script create a ram disk, maximum ram usage is 256 Mbyte. You can run it with sudo or put the script in /etc/init.d/


modprobe zram num_devices=1 
# max ram usage = 256 Mbytes
echo 256M > /sys/block/zram0/disksize
mke2fs -q -m 0 -b 4096 -O sparse_super -L zram /dev/zram0
mount -o relatime,noexec,nosuid /dev/zram0 /mnt/zram
# eof
share|improve this answer The value can be either in bytes or you can use mem suffixes. Example: echo 512M > /sys/block/zram0/disksize – Massimo Dec 29 '15 at 11:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.