Adding FreeBSD swap partition

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qiuchangyong/article/details/89974022

To add a swap partition, FreeBSD and other linux server command a little different, try to go through the following steps pro-test available on FreeBSD11.1.

1. Create the swap file, /usr/swap0:

# dd if=/dev/zero of=/usr/swap0 bs=1024k count=512

2. Set the proper permissions on /usr/swap0:

# chmod 0600 /usr/swap0

3. Enable the swap file in /etc/rc.conf:

# swapfile="/usr/swap0" # Set to name of swap file

4. Swap space will be added on system startup. To enable the swap file immediately, specify a free memory device.

# mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0

 

 

Guess you like

Origin blog.csdn.net/qiuchangyong/article/details/89974022