Some Linux servers need to expand the swap, but the original hard disk cannot adjust the size of the SWAp partition due to partition issues.
Create a swap file to solve the swap space (Virtual Memory) Problem of the operating system.
Create a swap file using the following method:
# Dd If =/dev/Zero of =/tmp/swapfree BS = 1024 m count = 64 (count is the number of partitions, swap size = BS * count)
# Mkswap/tmp/swapfree (format the swap partition file)
# Swapon/tmp/swapfree (enable swap partition files)
# Swapon-s (display swap status)
Modify/etc/fstab so that the system uses/tmp/swapfree as swap each time it is started. The original/dev/sda3 can be taken away, or it can be kept as swap:
/Dev/sda3 swap defaults 0 0
/Tmp/swapfree swap defaults 0 0
This article from the Linux community website (www.linuxidc.com) original link: http://www.linuxidc.com/Linux/2008-09/15932.htm