Advertisement
ZxZ666

zram.sh

Mar 24th, 2014
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. SIZE=$1
  4. DEVICE_COUNT=$2
  5. rmmod zram && modprobe zram num_devices=$DEVICE_COUNT
  6. for (( i=0; i < $DEVICE_COUNT; i++ )); do
  7.     echo $(($SIZE*1024*1024)) > /sys/block/zram$i/disksize
  8.     mkswap /dev/zram$i
  9.     swapon /dev/zram$i -p 10
  10. done
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement