Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Oct 2020 11:36:35 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Andrea Venturoli <ml@netfence.it>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: A couple of questions about SSDs
Message-ID:  <20201014113635.ce39d02e.freebsd@edvax.de>
In-Reply-To: <fee9e64d-4b27-d1cf-11c5-5af9ffa99935@netfence.it>
References:  <fee9e64d-4b27-d1cf-11c5-5af9ffa99935@netfence.it>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Wed, 14 Oct 2020 11:03:57 +0200, Andrea Venturoli wrote:
> I've heard people say that Windows will soon wear an SSD out unless you 
> turn swap off.
> While I don't believe that 100%, is there any reccomendation wrt to 
> FreeBSD swap in an SSD only install?

It's not about swap, it's about write access in general.
That write access depends on what programs you run on
your machine, or specific to "Windows", what programs
MICROS~1 intends to download, install, and run on "your"
PC. :-)

Regarding swap, using a regular swap partition is not
a problem: If nothing writes to it, it won't affect wear.

My first experience with a SSD-only install in a laptop
was to use a file-backed swap space, again with the
advantage that space wasn't allocated and written to
until needed.

In /etc/rc.local:

	SWAP="/ssdswap"
	/bin/rm -f $SWAP
	/bin/dd if=/dev/zero of=$SWAP bs=16m seek=500 count=0
	/sbin/mdconfig -a -t vnode -u 0 -f $SWAP || /bin/sh
	/bin/chflags nodump $SWAP
	/bin/rm $SWAP
	/sbin/swapctl -a /dev/md0
	echo -n " swap"

And in /etc/rc.shutdown.local:

	/sbin/swapctl -d /dev/md0 > /dev/null 2>&1
	/sbin/mdconfig -d -u 0
	echo -n " swap"

As this was an older laptop with only 4 GB (or 2 GB?) of
RAM, I thought that it wouldn't hurt to have swap available
if urgently needed. So far occassional monitoring in htop
didn't show any excessive swap usage.

Today I'd probably go with a regular swap partition, as
SSDs become bigger and cheaper.



> Is anyone using Poudriere on SSDs? Are there any measures of the impact 
> on wear?

No, I'm still using rotating rust for that. ;-)

But you're absolutely thinking into the right direction:
Running poudriere causes a lot of writes, it's not just
limited to swap (which gets activated only if RAM is full).
During ports building, lots of files are being written,
and _that_ probably is the significant question here.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20201014113635.ce39d02e.freebsd>