Instructions to setup swap file

Select the partition where you want to create the swap file. This partition must have free disk space to create the swap file.

Create a file for swap with the following command (# is shell prompt):

#dd if=/dev/zero of=/var/swapfile bs=1024 count=[count]

where [count]= number of 1024 blocks required. If count=1024000 size of /var/swapfile will be 1024* 1024000 = 1 GB .

You can decide the size of “/var/swapfile” depending on the size of the backup tar file.

Setup an extra swap with the following command:

#mkswap /var/swapfile

Enable “/var/swapfile” for swapping with the following command:

#swapon /var/swapfile

Verification: The file “/proc/swaps” must contain the entry for the swap file “/var/swapfile”. If this entry is not present, then swapping has not been enabled for the swap area.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.