Please login or register.

Increase swap space for blockchain

Short version (replace ampersand)

sudo dd if=/dev/zero of=/moneroswap bs=$((1024*1024)) count=8192 && sudo mkswap /moneroswap && sudo losetup /dev/loop0 /moneroswap && sudo swapon /dev/loop0 && free -h

Long version Until the DB is operational, we'll have to deal with an ever-increasing blockchain that needs to be fully loaded in RAM. For a sizeable part of holders, this means swapping. And even the swap partition (on Linux) may end up being too small, making bitmonerod crash. I must shutdown my browser to load monero...

Solution, increase swap space. You can do it without reformatting. Kudos to moneromoo for the tutorial.

First be sure you have enough free space (let's target 8 additional gigabytes of swap)

df -h /

Now that you are sure you have enough space

sudo dd if=/dev/zero of=/moneroswap bs=$((1024*1024)) count=8192

sudo mkswap /moneroswap

sudo losetup /dev/loop0 /moneroswap

sudo swapon /dev/loop0

free -h

You will have to remount the extra swap space after each reboot

sudo losetup /dev/loop0 /moneroswap

sudo swapon /dev/loop0

free -h

If you want to unmount this swap space (without rebooting)

sudo swapoff /dev/loop0

sudo losetup -d /dev/loop0

Remove this swap space (AFTER unmounting) - not recommended except if the swap space is really needed because creating a swapspace stresses the drive)

sudo rm /moneroswap
Replies: 0