UFS Trim wont stay set

Jeremy Chadwick jdc at koitsu.org
Thu Jul 4 20:33:58 UTC 2013


On Thu, Jul 04, 2013 at 03:37:28PM -0400, Mike Jakubik wrote:
> Hello,
> 
> I've just installed a stable snapshot on a new machine with a SSD
> drive, after installing i booted single user mode and ran
> 
> # tunefs -t enable /dev/ada0p2
> tunefs: issue TRIM to the disk set
> 
> Great, back to multiuser mode, i check the partition
> 
> # tunefs -p /dev/ada0p2
> tunefs: POSIX.1e ACLs: (-a)                                disabled
> tunefs: NFSv4 ACLs: (-N)                                   disabled
> tunefs: MAC multilabel: (-l)                               disabled
> tunefs: soft updates: (-n)                                 enabled
> tunefs: soft update journaling: (-j)                       enabled
> tunefs: gjournal: (-J)                                     disabled
> tunefs: trim: (-t)                                         disabled
> 
> What the heck.. did i miss something? Back to single user mode and
> 
> # tunefs -t enable /dev/ada0p2
> tunefs: issue TRIM to the disk remains unchanged as enabled
> 
> I check again in multiuser mode and it says disabled, any ideas what
> is going on here?

Yup, experienced this myself many times over.  The reasons are
understood (it's not limited to just the TRIM bits, it's related to
anything adjusting the superblock -- it gets cached in memory in certain
situations and not flushed back to disk).

Hint: are you booting into single user and then issuing a "mount"
command before doing your tunefs stuff?  If so, this is probably
what's causing it (at least it was in my case).

Instead just boot into single-user, do not mount anything, and use
/sbin/tunefs (if available -- depends on your filesystem setup) or
/rescue/tunefs.

-- 
| Jeremy Chadwick                                   jdc at koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Making life hard for others since 1977.             PGP 4BD6C0CB |



More information about the freebsd-stable mailing list