Pages

Thursday, July 11, 2013

Creating Swap file in the BSD

Creating a 512 MB file using below command.
# dd if=/dev/zero of=/swap1/swap0 bs=1024k count=512

# chmod 600 /swap1/swap0
Convert the file in to Swap usingthe belwo command
# mdconfig -a -t -t vnode -f /swap1/swap0 -u
# swapon /dev/md0

Check the swap availability using the below command
# swapinfo OR # top 
Make the setup persistent across the reboot add the below line to /et/rc.conf
swapfile="/swap1/swap0"

To turn off Swap
#swapoff /dev/md0

No comments:

Post a Comment