How to add Linux Swap file if you don’t have Swap Partition


Assuming you want to put it in '/', create an empty 1024MB file:

dd if=/dev/zero of=/swap bs=2048k count=512

Format it as a swap file:

sudo mkswap /swap

Add it to your running Linux system:

swapon /swap

Add /swap to fstab for automatic swap activation:

echo "/swap none swap sw 0 0" >>/etc/fstab

Verify that you've added the newly created swap to your Linux based operating system:

free -m
info/nix/linux/stuff/swap-file.txt · Последние изменения: 2009/05/22 13:43 От dant
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki