ZRAM Debian Jessie 8.x

ZRAM Debian Jessie 8.x


case «$1» in
«start»)
echo 512M > /sys/block/zram0/disksize # assigns size limit to virtual ram disk
echo 512M > /sys/block/zram1/disksize # assigns size limit to virtual ram disk
echo 512M > /sys/block/zram2/disksize # assigns size limit to virtual ram disk
echo 512M > /sys/block/zram3/disksize # assigns size limit to virtual ram disk
mkswap /dev/zram0 # sets up a virtual swap area in ram
mkswap /dev/zram1 # sets up a virtual swap area in ram
mkswap /dev/zram2 # sets up a virtual swap area in ram
mkswap /dev/zram3 # sets up a virtual swap area in ram
swapon /dev/zram0 -p 10 # enables virtual swap, assigns priority
swapon /dev/zram1 -p 10 # enables virtual swap, assigns priority
swapon /dev/zram2 -p 10 # enables virtual swap, assigns priority
swapon /dev/zram3 -p 10 # enables virtual swap, assigns priority
echo «zram.start executed: $(date +’%Y%m%d-%H%M%S’)» >> /var/log/zram.log
;;
«stop»)
swapoff /dev/zram0 # disables virtual device swap area
swapoff /dev/zram1 # disables virtual device swap area
echo 1 > /sys/block/zram0/reset # triggers reset in running zram device
echo 1 > /sys/block/zram1/reset # triggers reset in running zram device
swapoff /dev/zram2 # disables virtual device swap area
swapoff /dev/zram3 # disables virtual device swap area
echo 1 > /sys/block/zram2/reset # triggers reset in running zram device
echo 1 > /sys/block/zram3/reset # triggers reset in running zram device
wait
sleep .5
modprobe -r zram # removes module from running kernel
echo «zram.stop executed: $(date +’%Y%m%d-%H%M%S’)» >> /var/log/zram.log
;;
*)
echo «Usage: `basename $0` (start | stop)»
exit 1
;;
esac

Источник

Запись опубликована в рубрике *Unix,*Linux. Добавьте в закладки постоянную ссылку.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Я не спамер This plugin created by Alexei91