novaspirit / rpi_zram

script to enable zram for raspberry pi
351 stars 96 forks source link

resolve issues with existing swap devices #2

Open DonThorntonJr opened 7 years ago

DonThorntonJr commented 7 years ago

per Ubuntu: https://askubuntu.com/questions/471912/zram-vs-zswap-vs-zcache-ultimate-guide-when-to-use-which-one

my solution was to turn off non-zram swap devices after initialization:

... swapon -p 5 /dev/zram3

swapon -s for i in $( swapon -s | awk 'NR>1 { print $1 }' | egrep -v zram ) ; do swapoff ${i} ; done swapon -s

Cat5TV commented 6 years ago

Existing swap is disabled before creating the ZRAM swap in PR #3 - I tested your code first but it didn't work. I just took a different approach and instead turned off existing swap before enabling ZRAM.

dcpender commented 5 years ago

there wasn't any problem with novas code for my rpi 3b+ it automatically disabled the existing swap before creating the new one