Compiling Swap space

Steve O'Hara-Smith steve at
Tue Feb 27 08:09:39 UTC 2018

On 27 Feb 2018 00:23:46 -0500
"John Levine" <johnl at> wrote:

> In article <20180227040015.7d2fb579.freebsd at> you write:
> >On Mon, 26 Feb 2018 19:46:34 -0700, The Doctor wrote:
> >> I notice the default swap is 4G.  
> >> 
> >> How can that be increased to 32G or 64G?
> >
> >By repartitioning your drive.
> You can also use mdconfig to make an md device backed by a file and
> swap on that.  That's slower than a swap partition since it has to

	You don't need mdconfig, just make a large file and use swapon like

# dd if=/dev/zero of=swapfile bs=1m count=1024
# swapon swapfile

> find the blocks using the filesystem, but you don't have to
> repartition, just make a big file for it to swap to.

	All of these disadvantages apply.

Steve O'Hara-Smith <steve at>

More information about the freebsd-questions mailing list