Veera's Web Site
Search Website

Atom Feed
Linux Penguin Logo

zram - Linux compressed ram block device: setup and script

Date: 12-02-2023 02:20 UTC

Linux has a facility to use random access memory as block device with compression. It uses lzo, lzo-rle, lz4 and zstd for compression. So saving space on ram. There is other ramdisk block device which does not uses compression.

Download the shell script and use it to setup zram block device.

Alternatively you can use /sys directory files to setup it. You can view the script to know how to do it.

A brief explanation:

Careful with reset, any data or file system made in block device will be deleted/emptied!