Difference between revisions of "Swap files"

From Bitnami MediaWiki
Jump to navigation Jump to search
(Created page with "===Creating a swap file=== Te create a swapfile on the fly, without partitioning etc., do the following: # makeswap -U clear --size XG --file /swapfile Activate it: # swap...")
 
Line 6: Line 6:
 
Last, add an entry to the filesystem table (fstab):  
 
Last, add an entry to the filesystem table (fstab):  
 
   /swapfile  none  swap defaults 0 0
 
   /swapfile  none  swap defaults 0 0
 +
 +
===Removing a swap file===
 +
Turn it off first:
 +
  # swapoff /swapfile
 +
Then delete the file:
 +
  rm -f /swapfile

Revision as of 18:47, 11 July 2024

Creating a swap file

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

 # makeswap -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

Turn it off first:

 # swapoff /swapfile 

Then delete the file:

 rm -f /swapfile