Where does trim begin?

I have a machine (a few, but) with Freebsd installed with ZFS on a single SSD.

If I were to reinstall FreeBSD (a different version) from the memstick, what happens to the SSD? Does TRIM only begin when ZFS in there? Or does the install process - the bit where it asks you if you are sure - use TRIM?
 
I'm not sure what the install process does. My FreeBSD daily driver is a VM and all the TRIMing is done on the Hypervisor.

For ZFS, to see what's set zpool get autotrim [pool]. You can zpool set autotrim=on|off [pool]. See zpool-set(8) along with zpoolprops(7)

On my ZFS server, which has the root on an SSD, I trim it just once a month. This gives the TRIM algorithms a better chance of operating efficiently by avoiding continuous trivial transactions, in favour of occasionally hoovering up large swathes of free disk blocks:
Code:
[sherman.133] $ zpool get autotrim zroot
NAME   PROPERTY  VALUE     SOURCE
zroot  autotrim  off       default
[sherman.134] $ sudo crontab -l | grep trim
5 3 2 * * /sbin/zpool trim zroot
[My root disks (mirror) are significantly over-provisioned, so I have no need to TRIM often.]
 
TRIM on ufs is enabled when you make the file system (newfs -t, or modify it with tunefs -t enable).

With ZFS, not sure about the default, but TRIM is applied to pools, you can discover the autotrim setting with zpool get autotrim [pool].

You can set autotrim ZFS pools with zpool-create(8) or zpool-import(8) time, or at any time with zpool-set(8).

You can manually trim ZFS pools with zpool trim [pool]

periodic.conf(5) suggests that daily_trim_zfs_enable and daily_trim_zfs_pools may be set for daily trim of ZFS pools. I can't find any evidence that this actually happens under FreeBSD 13.5-RELEASE. I searched in /etc/periodic and /usr/local/etc/periodic, and found nothing related to TRIM. Happily cron(8) can do that.
 
TRIM on ufs is enabled when you make the file system (newfs -t, or modify it with tunefs -t enable).

With ZFS, not sure about the default, but TRIM is applied to pools, you can discover the autotrim setting with zpool get autotrim [pool].

You can set autotrim ZFS pools with zpool-create(8) or zpool-import(8) time, or at any time with zpool-set(8).

You can manually trim ZFS pools with zpool trim [pool]

periodic.conf(5) suggests that daily_trim_zfs_enable and daily_trim_zfs_pools may be set for daily trim of ZFS pools. I can't find any evidence that this actually happens under FreeBSD 13.5-RELEASE. I searched in /etc/periodic and /usr/local/etc/periodic, and found nothing related to TRIM. Happily cron(8) can do that.
It's in daily/801.trim-zfs in 14.2.

I'm not sure whether the original question was about a clean reinstall or overwriting an existing installation. In the former case you could just pre-trim; in the later case, hopefully, the installer would retain the existing trim settings. Whatever happens I can't see there being a significant problem; the install is pretty small compared with most SSDs.
 
in the later case, hopefully, the installer would retain the existing trim settings. Whatever happens I can't see there being a significant problem
No significant problem. Yes, hopefully. Is the installer aware of previous trim settings?
 
Back
Top