Problem with adding more swap !

Jerry McAllister jerrymc at
Mon Oct 13 06:56:22 PDT 2003

> Hi, all
>    The documents on freebsd's website suggest that,
> as a system grows, it's recommended for adding more
> swap paritition to system. My questions are: Does
> it mean adding another swap to disk or to slice ?
> The disk structure: 
>         ad0s1 --> ad0s1a   /      (boot from here)
>               --> ad0s1b   swap
>               --> ad0s1e   /var
>               --> ad0s1f   /tmp
>               --> ad0s1g   /usr
>         ad0s2 --> ad0s2e   /usr1  (data)
> Do I need to add another swap partition as "ad0s2b" ?

Hmmm.   I am not quite sure why you would have made two separate
slices on the one disk for FreeBSD instead of having another
partition on slice-1, but...

Anyway, what do you mean 'as a system grows'?   Unless you have some
very memory hungry applications or large numbers of processes that 
hang around but don't really need a lot of processor time, generally 
you figure swap size needs by memory size.   You want at least more
than your physical memory and 2X to 2-1/2X physical memory is the
typical rule of thumb.   If you already meet that, don't worry about,
unless you have some other indication that you are running out of
combined memory/swap (page) space.   NOTE that the virtual memory
system uses swap space for its paging.  Typically, not much actual
swapping really happens, though it can if there are a lot of processes
not doing anything.

You can make a file pretty much anywhere there is room and set things
up to swap to it, but that should be considered only a temporary solution.   
The better thing is to make either a larger s1b or make an s2b partition 
for swap (or add a disk - ad1s1b, + whatever) as you say.

In either case (enlarging s1b or making an s2b), unless you have space
left in one of those slices that you did not already use up in the
existing partitions,  it means redoing the filesystems already on the 
slice.  That means backing up everything on the slice, repartitioning, 
newfsing and restoring everything.  So, given this, it would probably 
be a good time to rethink your whole disk layout and go from there.
Maybe it would also be a good time to go to an additional or larger
disk as well.


> TIA,
> pjn

More information about the freebsd-questions mailing list