If the Linux installation is not divided into swap partitions, you can:
1. Divide a partition and use it as swap. Then add a row in/etc/fstab,
/Dev/sda9 swap defaults 0 0
This is assumed to be sda9.
2. If there is no space
1) create a large enough file
Dd If =/dev/Zero of =/swapfile BS = 1024 COUNT = 262144
(The value of count is equal to 1024 x the size of the file you want, And 262144 is 256 MB)
2) Change this file to a swap file.
Mkswap/swapfile
3) enable this swap file
Swapon/swapfile
4) automatically load the swap file every time you start the system. Add a line to the/etc/fstab file.
/Swapfile swap defaults 0 0
Note: The last line must be blank when modifying fstab. Otherwise, the system will prompt warning.
Note: I am not liable for any of the above content from the Internet.
ArticleFrom: http://blog.csdn.net/DL88250/archive/2007/11/14/1883531.aspx