Dont have swap enough ... make a swap file
Posted: 24 Dec 2011, 20:12
The trick is to make a file and then tell the swapon program to use it. Here’s how to create, for example, a 64
megs swap file on your root partition (of course make sure you have at least 64 megs free):
This will make a 64 megs (about 67 millions bytes) file on your hard drive. You now need to initialize it:
And you can then add it to your swap pool:
swapon /swapfile
With that you have 64 megs of swap added. Don’t forget to add the swapon command to your startup files so
the command will be repeated at each reboot.
megs swap file on your root partition (of course make sure you have at least 64 megs free):
Code: Select all
dd if=/dev/zero of=/swapfile bs=1024This will make a 64 megs (about 67 millions bytes) file on your hard drive. You now need to initialize it:
Code: Select all
mkswap /swapfile 65536
syncAnd you can then add it to your swap pool:
swapon /swapfile
With that you have 64 megs of swap added. Don’t forget to add the swapon command to your startup files so
the command will be repeated at each reboot.


