Memory upgrade and resizing the /swap partition ...
Björn König
bjoern.koenig at spray.se
Tue Dec 27 04:08:14 PST 2005
Kiffin Gish schrieb:
> I just upgraded my laptop from 512MB to 1024MB memory.
>
> It is said that the /swap partition has to be at least as much as the maximum available memory, [...]
This is more an ancient rule of thumb. You can even have a working
system without swap at all. Swap will be only used if you have to less
memory available and it depends on the main purpose of the computer how
much swap you need. For example I have a small server at home that acts
as small web server, mail server, file server and many other things; the
server has 768 MB RAM and 128 MB swap and ran for the last two years
without "out of memory" failures.
> Can I increase the size of the existing swap partition or do I have to create a new one? [...]
There is another solution: you can use a file that extends your swap
partition.
# create an empty 256 MB file
dd if=/dev/zero of=/usr/swapfile bs=1024k count=256
# add an appropriate line to rc.conf
echo 'swapfile="/usr/swapfile"' >> /etc/rc.conf
# add swap
/etc/rc.d/addswap start
'swapinfo' shows information about your current swap partition and files.
Regards
Björn
More information about the freebsd-questions
mailing list