CFT: TRIM Consolodation on UFS/FFS filesystems

bob prohaska fbsd at www.zefox.net
Fri Aug 24 00:06:22 UTC 2018


On Wed, Aug 22, 2018 at 10:57:57PM -0700, Kirk McKusick wrote:
> > Date: Tue, 21 Aug 2018 17:48:43 -0700
> > From: bob prohaska <fbsd at www.zefox.net>
> > To: Kirk McKusick <mckusick at mckusick.com>
> > Cc: FreeBSD Current <freebsd-current at FreeBSD.org>,
> >         FreeBSD Filesystems <freebsd-fs at FreeBSD.org>,
> >         bob prohaska <fbsd at www.zefox.net>
> > Subject: Re: CFT: TRIM Consolodation on UFS/FFS filesystems
> > X-ASK-Info: Message Queued (2018/08/21 17:55:39)
> > X-ASK-Info: Confirmed by User (2018/08/21 18:47:17)
> > 
> > 
> > Will the new feature be active on a Raspberry Pi 3 using flash 
> > on microSD and USB for file systems and swap? 
> 
> When you create the filesystem (using newfs) you need to specify
> the -t option to request that it send TRIM commands to the underlying
> media. If you have an existing filesystem, you can use the command
> `tunefs -t enable <filesystem name or device>' to set the TRIM-request
> flag. When you mount a fiesystem that has been told to send TRIM
> commands, it will send an ioctl to the device asking if it supports
> TRIM. If it replies that it does, then the TRIM commands will be
> sent. If it does not then the kernel will print an error message
> ``WARNING: <filesystem name>: TRIM flag on fs but disk does not
> support TRIM'' or ``WARNING: <filesystem name>: TRIM flag on fs but
> disk does not confirm that it supports TRIM''.  If you get no message
> when you mount, then the drive will accept TRIM commands. Now whether
> it will do anything with them is not clear based on your quote below.
> 

Using
FreeBSD 12.0-ALPHA2 #12 r338122: Tue Aug 21 14:26:18 PDT 2018

Alas, no luck. On mount TRIM isn't supported:

WARNING: /usr: TRIM flag on fs but disk does not support TRIM

Using tunefs on the microSD produced a different refusal:
# tunefs -t enable /dev/mmcsd0s2a
tunefs: issue TRIM to the disk set
tunefs: /dev/mmcsd0s2a: failed to open disk for writing
I tried with the device both ro and rw, same error. I
expected "not supported", rather than "failed to open".
If there's a mistake please tell me.

Not sure if this is true of all possible storage devices, but
the Sandisk Ultra microSD and Sandisk Extreme USB appear to be
non-starters.

Thanks very much for your help!

bob prohaska



More information about the freebsd-fs mailing list