Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #modprobe zram
- totalmem=$(free | grep -e "^Mem:" | sed -e 's/^Mem: *//' -e 's/ *.*//')
- # use all available physical memory
- zram_mem=$(( totalmem * 1024 ))
- echo $zram_mem > /sys/block/zram0/disksize
- mkfs.ext4 /dev/zram0
- mkdir -p /mnt/zram-ext4-test
- mount -o nobarrier /dev/zram0 /mnt/zram-ext4-test
- # without "-s" bonnie++ will try to use files twice the size of RAM, we use 2/3 of that
- # "-u root" is there because the mount above is writable only by root
- # "-x 10" means running the bench 10 times; obviously tweakable
- bonnie++ -s $((totalmem / 1024 * 2 / 3)) -r 0 -u root -x 10 -q -d /mnt/zram-ext4-test/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement