Using the dd command to temporarily add swap partitions sometimes causes insufficient memory. You can use the method provided in this article to temporarily add swap partitions. [Plain] # create swap partition -- get the file [root @ serv01 linux-2.6.38] # dd if =/dev/zero of =/swap. img bs = 1 M count = 1024 1024 + 0 records in 1024 + 0 records out 1073741824 bytes (1.1 GB) copied, 2.68989 s, 399 MB/s [root @ serv01 linux-2.6.38] # ls swap. img # Make swap partition [root @ serv01 linux-2.6.38] # mkswap/swap. img mkswap: swap. img: warning: don't erase bootbits sectors on whole disk. use-f to force. setting up swapspace version 1, size = 1048572 KiB no label, UUID = 70945855-7bab-4c08-a880-77d089dd06cc # enable swap partition to take effect [root @ serv01 linux-2.6.38] # swapon/swap. img # You can use the free command to check whether the increase is successful [root @ serv01 linux-2.6.38] # free total used free shared buffers cached Mem: 384996 378700 6296 33232 249252-/+ buffers/cache: 96216 288780 Swap: 2097136 0 2097136 # Close, then delete [root @ serv01 linux-2.6.38] # swapoff/swap. img [root @ serv01 linux-2.6.38] # rm-rf/swap. img