Using mdconfig for swap space

Jerry McAllister jerrymc at
Tue Sep 8 23:57:17 UTC 2009

On Tue, Sep 08, 2009 at 04:51:20PM -0500, Peter Steele wrote:

> Are there any advantages to using mdconfig and creating a virtual disk for swap space as opposed to having a designated swap partition? For example, I could do something like this:

Unless I am missing something basic here, it seems like a bad idea to 
me - to carve out and use up some memory to use as extra storage for 
processes that need more memory that you have taken away to give to swap.  
That is self defeating.

In addition, one use of swap is to write dumps to if there is a crash. 
If you put it in memory, it is gone when you reboot.


> mdconfig -a -t swap -f /var/swap0 -s 4g
> swapon -a /dev/md0
> to add 4G to the system swap space backed by the file /var/swap0. How would this compare to repartitioning my hard drive and adding a new 4GB swap partition?
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list