| Swap Management |
|
|
|
| Thursday, 03 December 2009 12:17 |
Get swap# mcedit /proc/swaps
Gem all memory (swap, RAM) # /proc/meminfo
Show logical volums # mcedit /etc/fstab
Create Swap FileCreate swap file 1 GB # dd if=/dev/zero of=/swapfile bs=1024 count=1048576
Prepare the swap file using mkswap just as you would a partition, but this time use the name of the swap file # mkswap /swapfile
And similarly, mount it # swapon /swapfile
Open etc/fstab # mcedit /etc/fstab
/swapfile none swap sw 0 0
Save, Reboot. The /etc/fstab entry for a swap file would look like this: /swapfile none swap sw 0 0
Remove Swap File# swapoff /swapfile
Open /etc/fstab # mcedit /etc/fstab
and remove the line /swapfile none swap sw 0 0
|