Date: Wed, 06 Jan 2010 16:21:52 -0800 From: Kirk McKusick <mckusick@mckusick.com> To: Dan Strick <mla_strick@att.net> Cc: freebsd-fs@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/141992: fsck cannot repair file system in which it finds an error Message-ID: <201001070021.o070Lq0J056953@chez.mckusick.com> In-Reply-To: <200912291843.nBTIhBF0026212@chez.mckusick.com>
next in thread | previous in thread | raw e-mail | index | archive | help
So, I have (finally) gotten a chance to try out the disk image that you sent me using fsck_ffs from a FreeBSD 8.0 system. Here is the correction report and patch that I made: Author: mckusick Date: Thu Jan 7 00:17:36 2010 New Revision: 201700 URL: http://svn.freebsd.org/changeset/base/201700 Log: This corrects a bug that manifested itself as identifying the last cylinder group of a UFS1 filesystem as bad. The error was in the check and not in the cylinder group itself. So even though fsck fixed the cylinder group correctly, it was still endlessly reported as bad. PR: 141992 MFC after: 2 weeks Reported by: Dan Strick Modified: head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Thu Jan 7 00:04:29 2010 (r201699) +++ head/sbin/fsck_ffs/fsutil.c Thu Jan 7 00:17:36 2010 (r201700) @@ -436,7 +436,7 @@ check_cgmagic(int cg, struct cg *cgp) ((sblock.fs_magic == FS_UFS1_MAGIC && cgp->cg_old_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && - cgp->cg_old_ncyl == sblock.fs_old_cpg) || + cgp->cg_old_ncyl <= sblock.fs_old_cpg) || (sblock.fs_magic == FS_UFS2_MAGIC && cgp->cg_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && Please apply this patch to your fsck_ffs and confirm for me that it corrects your problem. Thanks for all your help. Kirk McKusick
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001070021.o070Lq0J056953>