IPv4 Address:-
IPv6 Address:-
Service Provider:-
SSL Information:-
HTTP Protocol:-
Database:-
Web:-
Using a swapfile in FreeBSD10+ [11/May/2014]   A few quick thoughts about FreeBSD 10 installer     Activate IPFW without kernel compile in FreeBSD  

Configuring a swap file in FreeBSD 10 changed to handle some internal issues and race conditions.

Swapfiles are useful if you need to add extra swap space to an existing installation, or if you want to add swap space protected by ZFS pools.

First, create the swapfile on the disk.  In the example below, i'm creating a 4GB swapfile called /swapfile.dat:

dd if=/dev/zero of=/swapfile.dat bs=1m count=4096
chmod 0600 /swapfile.dat Copy


Now we've created the swapfile, we need to tell FreeBSD to mount it on startup.

Edit (or create) your /etc/fstab file with your favourite editor, and add the following line:

md99        none        swap        sw,file=/swapfile.dat        0        0 Copy

This will instruct the boot sequence to create a pseudo node called /dev/md99 which will be mapped to /swapfile.dat and mounted as swap.

If you wanted multiple swapfiles (perhaps on multiple pools), repeat the above steps and change the md99 to md98 etc. for each swapfile.

  A few quick thoughts about FreeBSD 10 installer     Activate IPFW without kernel compile in FreeBSD  
Copyright © 2024 Daniel Austin MBCS.
Proudly hosted using the FreeBSD operating system.
 
E-mail me
PGP Key
E-mail me
LOGGED IN
Login
padlock icon
LOGIN ERROR#123: random error here