Raspberry Pi : Create SWAP volume on LVM

Adding a swap volume on LVM.

# add a logical volume for swap
lvcreate -L 2G VolGroup00 -n lvolswap 
# make swap
mkswap /dev/VolGroup00/lvolswap
# activate swap
swapon /dev/VolGroup00/lvolswap

After that add following line to /etc/fstab.

/dev/mapper/VolGroup00-lvolswap none swap sw 0 0

Now it works!

root@raspberrypi:/home/pi# free -h
              total        used        free      shared  buff/cache   available
Mem:           926M        499M         46M         53M        379M        314M
Swap:          2.0G        390M        1.6G

Leave a Reply

Your email address will not be published. Required fields are marked *