Friday, February 10, 2012

Create and add swap space in linux.

#dd if=/dev/zero of=/swap1 bs=1024 count=1048576

#mkswap /swap1

#swapon /swap1

#free -m


bs=1024 ( 1MB )
count=1048576 ( 1GB )

You can edit /etc/fstab to enable your swap file automatically at boot time.
By adding an entry like this:

/opt/swapfile swap swap defaults 0 0

No comments:

Post a Comment