Using SSDs as swap

Warren Block wblock at wonkity.com
Sat Aug 8 18:26:43 UTC 2015


On Sat, 8 Aug 2015, Willem Jan Withagen wrote:
>
> So perhaps the nicest thing to do for the SSDs is TRIM swap at
> startup??? So the the SSD controller van do its garbage collection and
> then keep the remainder of the stuff as it is.

This can be done now by using a swap file on a UFS partition with trim 
enabled.  The catch is that the swap file has to be deleted and 
recreated to trigger the trim.  The delete is quick, but the create 
depends on the size of the file and the speed of the hardware.  (And no, 
sparse files do not work as swap files.)

Maybe rotate swap files like log files, so they could be created when 
the system is idle.


More information about the freebsd-fs mailing list