FreeBSD Adding swap space

FreeBSD Installation tips

FreeBSD Adding swap space

Postby stephen » Sat May 22, 2010 4:39 am

I have FreeBSD running in VirtualBox on my windows P. When I compile the math/R port, the compile fails because of lack of swap space.

The FreeBSD Manual describes how to add swap space.
http://www.freebsd.org/doc/en/books/handbook/adding-swap-space.html

Example 11-1. Creating a Swapfile on FreeBSD

1. Be certain that your kernel configuration includes the memory disk driver (md(4)). It is default in GENERIC kernel.

device md # Memory "disks"

2. Create a swapfile (/usr/swap0):

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

3. Set proper permissions on (/usr/swap0):

# chmod 0600 /usr/swap0

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

swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired.

5. Reboot the machine or to enable the swap file immediately, type:

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

stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to FreeBSD

Who is online

Users browsing this forum: No registered users and 2 guests

cron