UFS Trim wont stay set

Jeremy Chadwick jdc at koitsu.org
Thu Jul 4 21:01:30 UTC 2013


On Thu, Jul 04, 2013 at 04:48:38PM -0400, Mike Jakubik wrote:
> On 07/04/13 16:33, Jeremy Chadwick wrote:
> >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.
> 
> I booted in to single user mode and the system mounted the only file
> system there, which is mounted at /. What i did now however is boot
> off a Live CD and run tunefs, this did the trick!

I talked with Andriy Gapon a couple years ago about this, actually.  I
had to dig up the thread.  Here are the relevant parts (read in order):

http://lists.freebsd.org/pipermail/freebsd-stable/2011-June/062921.html
http://lists.freebsd.org/pipermail/freebsd-stable/2011-June/062922.html
http://lists.freebsd.org/pipermail/freebsd-stable/2011-June/062923.html
http://lists.freebsd.org/pipermail/freebsd-stable/2011-June/062924.html

Make sure you read Andriy's comments (2nd URL) in full.  My follow-up
(4th URL) confirms that the "mount -a" (which is what made / read-write
since /etc/fstab obviously has / as rw) was causing the issue.  He
explains the reason.

-- 
| 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