Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2018 08:47:05 +0700
From:      Victor Sudakov <vas@mpeks.tomsk.su>
To:        freebsd-questions@freebsd.org
Subject:   swap to a sparse file
Message-ID:  <20181011014705.GA17798@admin.sibptus.ru>

next in thread | raw e-mail | index | archive | help
Dear Colleagues,

I've inherited a swapless FreeBSD 11.2 host with no unused disk space.
I would like to add some swap to be on the safe side: in case there is
a memory leak etc.

On the other hand, I don't like to waste several gigabytes on a
precious SSD because perhaps the system will never need this swap
space anyway.

The FreeBSD Handbook prescribes creating a swap file with "dd if=/dev/zero ..."
which would waste the space.

Is there any good reason I can't just "truncate -s2G /swap0" and
make the swap a sparse file? 

Thanks in advance for any input.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181011014705.GA17798>