Difference between revisions of "Swap files"

From Bitnami MediaWiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 
===Creating a swap file===
 
===Creating a swap file===
 
Te create a swapfile on the fly, without partitioning etc., do the following:
 
Te create a swapfile on the fly, without partitioning etc., do the following:
−
   # makeswap -U clear --size XG --file /swapfile
+
   # mkswap -U clear --size XG --file /swapfile
 
Activate it:
 
Activate it:
 
   # swapon /swapfile
 
   # swapon /swapfile

Latest revision as of 16:54, 2 August 2024

Creating a swap file[edit]

Te create a swapfile on the fly, without partitioning etc., do the following:

 # mkswap -U clear --size XG --file /swapfile

Activate it:

 # swapon /swapfile

Last, add an entry to the filesystem table (fstab):

 /swapfile  none  swap defaults 0 0

Removing a swap file[edit]

Turn it off first:

 # swapoff /swapfile 

Then delete the file:

 rm -f /swapfile