diff options
author | des <des@FreeBSD.org> | 2011-04-29 23:00:23 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2011-04-29 23:00:23 +0000 |
commit | e9b6a49782626401ce568d3d1e87a29ec181aed0 (patch) | |
tree | e58bb5eb7293c08ac870dd7b462cbf76cdde8ec2 /sbin/fsck_ffs/fsck_ffs.8 | |
parent | 5adbc718330a91ab900ef67c71de25f7154ab8b6 (diff) | |
download | FreeBSD-src-e9b6a49782626401ce568d3d1e87a29ec181aed0.zip FreeBSD-src-e9b6a49782626401ce568d3d1e87a29ec181aed0.tar.gz |
Add an -E option to mirror newfs's. The idea is that if you have a system
that was built before ffs grew support for TRIM, your filesystem will have
plenty of free blocks that the flash chip doesn't know are free, so it
can't take advantage of them for wear leveling. Once you've upgraded your
kernel, you enable TRIM on the filesystem (tunefs -t enable), then run
fsck_ffs -E on it before mounting it.
I tested this patch by half-filling an mdconfig'ed filesystem image,
running fsck_ffs -E on it, then verifying that the contents were not
damaged by comparing them to a pristine copy using rsync's checksum
functionality. There is no reliable way to test it on real hardware.
Many thanks to mckusick@, who provided the tricky parts of this patch and
reviewed the final version.
Reviewed by: mckusick@
MFC after: 3 weeks
Diffstat (limited to 'sbin/fsck_ffs/fsck_ffs.8')
-rw-r--r-- | sbin/fsck_ffs/fsck_ffs.8 | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sbin/fsck_ffs/fsck_ffs.8 b/sbin/fsck_ffs/fsck_ffs.8 index 2834149..523cb65 100644 --- a/sbin/fsck_ffs/fsck_ffs.8 +++ b/sbin/fsck_ffs/fsck_ffs.8 @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 25, 2009 +.Dd April 27, 2011 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BFfnpry +.Op Fl BEFfnpry .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -149,6 +149,24 @@ If unexpected errors are found, the file system is marked as needing a foreground check and .Nm exits without attempting any further cleaning. +.It Fl E +Clear unallocated blocks, notifying the underlying device that they +are not used and that their contents may be discarded. +This is useful for filesystems which have been mounted on systems +without TRIM support, or with TRIM support disabled, as well as +filesystems which have been copied from one device to another. +.Pp +See the +.Fl E +and +.Fl t +flags of +.Xr newfs 8 , +and +the +.Fl t +flag of +.Xr tunefs 8 . .It Fl F Determine whether the file system needs to be cleaned immediately in foreground, or if its cleaning can be deferred to background. |