Swap sur ramdisk

Voir :

https://wiki.debian.org/ZRam

https://la-vache-libre.org/zram-un-kernel-module-qui-peut-etre-utile/

Source : https://wiki.archlinux.org/index.php/Maximizing_performance

modprobe zram echo lz4 > /sys/block/zram0/comp_algorithm echo 1G > /sys/block/zram0/disksize mkswap --label zram0 /dev/zram0 swapon --priority 100 /dev/zram0

Erreur

echo 1G > /sys/block/zram0/disksize
-bash: echo: write error: Invalid argument
dmesg |grep zram
[29996.637522] zram: Cannot initialise lz4

Solution

echo "lzo" > /sys/block/zram0/comp_algorithm

modprobe zram echo 3 > /sys/block/zram0/max_comp_streams echo "lzo" > /sys/block/zram0/comp_algorithm echo 100M > /sys/block/zram0/disksize mkswap --label zram0 /dev/zram0 swapon --priority 100 /dev/zram0