From owner-cvs-src-old@FreeBSD.ORG Fri Apr 29 23:00:43 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A47EB1065700 for ; Fri, 29 Apr 2011 23:00:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB3F8FC0A for ; Fri, 29 Apr 2011 23:00:43 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TN0h4j068237 for ; Fri, 29 Apr 2011 23:00:43 GMT (envelope-from des@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p3TN0hej068236 for cvs-src-old@freebsd.org; Fri, 29 Apr 2011 23:00:43 GMT (envelope-from des@repoman.freebsd.org) Message-Id: <201104292300.p3TN0hej068236@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to des@repoman.freebsd.org using -f From: Dag-Erling Smorgrav Date: Fri, 29 Apr 2011 23:00:23 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sbin/fsck_ffs fsck.h fsck_ffs.8 fsutil.c main.c pass5.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2011 23:00:43 -0000 des 2011-04-29 23:00:23 UTC FreeBSD src repository Modified files: sbin/fsck_ffs fsck.h fsck_ffs.8 fsutil.c main.c pass5.c Log: SVN rev 221233 on 2011-04-29 23:00:23Z by des 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 Revision Changes Path 1.47 +2 -0 src/sbin/fsck_ffs/fsck.h 1.46 +20 -2 src/sbin/fsck_ffs/fsck_ffs.8 1.32 +16 -1 src/sbin/fsck_ffs/fsutil.c 1.64 +6 -2 src/sbin/fsck_ffs/main.c 1.47 +23 -2 src/sbin/fsck_ffs/pass5.c