Archive

HowTo: Use zram on Fedora 16

Ok, this one is badly documented. Even the kernel docs are outdated.

Here's how to start using zram on Fedora 16:

# get rpmfusion: http://rpmfusion.org/Configuration
...

# install the staging kmod
su -c 'yum install kmod-staging'

# get zram running (aha!)
su -c 'modprobe zram zram_num_devices=4'

# define the block's size (512 MB each)
echo $((512*1024*1024)) > /sys/block/zram0/disksize
echo $((512*1024*1024)) > /sys/block/zram1/disksize
echo $((512*1024*1024)) > /sys/block/zram2/disksize
echo $((512*1024*1024)) > /sys/block/zram3/disksize

# do some swap initialization
mkswap /dev/zram0
swapon /dev/zram0
mkswap /dev/zram1
swapon /dev7zram1

# create a filesystem on the others ( btrfs ;) )
mkfs.btrfs /dev/zram[34]
mkdir /mnt/zram
mount /dev/zram3 /mnt/zram

# do some testing!
...

# check out some stats
cat /sys/block/zram3/*

Have fun with it!