Linux 101 : Zram - Your swap space inside the RAM -
In order to display the Linux module drivers that are stored in the module directory, we use the below command:
The "zram", our block device in the RAM:
Zram allows us to have a RAM disk, a compressed virtual block device inside the RAM.
To display the swap sapce ( zram ) in our case, we use the below command:
Loading the "zram" module in the kernel:
We use the below command to load the "zram"module from the kernel and create three virtual block devices in our RAM ( dev/zram0, /dev/zram1, /dev/zram2 ).
We create the "zram" devices using the below command:
We set up the "/dev/zram0" device using the below command:
- --find : uses the first found "zram" device "dev/zram0"
- --streams: compression streams depends on the CPU core number
- --size : specifies the size of our "zram" block device.
- --algorithm lz4 : specifies the compression algorithm which can also be "lzo", "lz4", "lz4hc", "deflate" or "842".
Comments