Creating a swap file in FreeBSD
- Make sure the virtual disk driver (md(4)) is present in the kernel configuration file. It is included in the GENERIC kernel.
device md # Memory "disks"- Create a swap file (/usr/swap0):
# dd if=/dev/zero of=/usr/swap0 bs=1024k count=64- Set appropriate permissions on (/usr/swap0):
# chmod 0600 /usr/swap0- Enable the swap file in /etc/rc.conf:
swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired.- Reboot the computer, or to enable swap right now enter:
# mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0