CompileNix's Blog - Quick and dirty: Adding a swap file to jour Linux

Start Page | RSS Feed | Find Stuff

Quickly adding and aktivating a (thick provisioned) swapfile to your Linux.

Nevertheless, i suggest doing this only if you have not a better solution.

# size in Megabytes
#size=512; dd if=/dev/zero of=/var/swap.bin bs=1M count=$size; mkswap -L swap_${size} /var/swap.bin; echo -e "/var/swap.bin\tnone\tswap\tsw\t0 0" >> /etc/fstab; chmod 0600 /var/swap.bin; swapon -a