Swapfile

From KlavoWiki
Revision as of 03:03, 22 June 2016 by David (talk | contribs) (Created page with "I've written this based on my experience of Bananian which is Debian based. = Deleting Swap File = <pre> swapoff /swapfile1 </pre> <pre> rm -f /swapfile1 </pre> = Creating...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

I've written this based on my experience of Bananian which is Debian based.

Deleting Swap File

swapoff /swapfile1
rm -f /swapfile1


Creating Swap File

Hard Disk Partition

The parition needs to be created as a swapfile and not ext3, ext4 or something else.

mktemp /dev/sda1

File

Create a file of 1GB

dd if=/dev/zero of=/swapfile1 bs=512 count=2048
chmod 600 /swapfile1
mkswap /swapfile1
swapon /swapfile1

fstabs

vi /etc/fstab

Add an entry or change the existing one

/dev/sda1 swap swap defaults 0 0

or

/swapfile1 swap swap defaults 0 0