Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zram: using a compressed in-memory fs? #16

Open
eMPee584 opened this issue Oct 7, 2018 · 0 comments
Open

zram: using a compressed in-memory fs? #16

eMPee584 opened this issue Oct 7, 2018 · 0 comments

Comments

@eMPee584
Copy link
Contributor

eMPee584 commented Oct 7, 2018

as inspiration, my /usr/local/bin/overlay-zram

#!/bin/bash -xv
set -e # die if one step fails

echo "called $0 $@"
dir=$(basename "$@")
zram=/tmp/zram

modprobe -v zram
zramdev=$(zramctl --find --size 20GiB --algorithm lz4)
mkfs.ext4 -O ^has_journal ${zramdev}
mkdir -pv ${zram}
mount -vo discard,dax,noatime ${zramdev} ${zram}
mkdir -pv "/tmp/${dir}-union" "${zram}/${dir}"/{.work,.upper}
modprobe -v overlay
mount -vt overlay overlay -o "lowerdir=${@},upperdir=${zram}/${dir}/.upper,workdir=${zram}/${dir}/.work" "/tmp/${dir}-union"
chown -v --reference="${@}" "/tmp/${dir}-union"

Compression ratio can be looked at with zramctl ..
hard to know if it's worth the fuzz without trying..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant