From owner-freebsd-questions@FreeBSD.ORG Wed Sep 19 10:05:08 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3977E106564A for ; Wed, 19 Sep 2012 10:05:08 +0000 (UTC) (envelope-from mueller23@insightbb.com) Received: from mail.insightbb.com (smtp.insight.synacor.com [208.47.185.22]) by mx1.freebsd.org (Postfix) with ESMTP id E17A78FC08 for ; Wed, 19 Sep 2012 10:05:07 +0000 (UTC) X_CMAE_Category: 0,0 Undefined,Undefined X-CNFS-Analysis: v=1.1 cv=jtbWK/TOYMJiVmv7KZs5eLcg+r4de0oAOseVU9nuG5E= c=1 sm=0 a=vLACRKzSFM0A:10 a=jLN7EqiLvroA:10 a=FjilmrGXJiz-oJU6hCcA:9 a=AcdsImxJPJ9Yo6Ye3TGm+Q==:117 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: smtp02.insight.synacor.com header.from=mueller23@insightbb.com; sender-id=softfail Authentication-Results: smtp02.insight.synacor.com smtp.mail=mueller23@insightbb.com; spf=softfail; sender-id=softfail Received-SPF: softfail (smtp02.insight.synacor.com: transitional domain insightbb.com does not designate 74.134.34.76 as permitted sender) Received: from [74.134.34.76] ([74.134.34.76:53717] helo=localhost) by mail.insightbb.com (envelope-from ) (ecelerity 2.2.2.40 r(29895/29896)) with ESMTP id 85/11-23206-2D899505; Wed, 19 Sep 2012 06:05:06 -0400 Date: Wed, 19 Sep 2012 06:05:06 -0400 Message-ID: <85.11.23206.2D899505@smtp02.insight.synacor.com> From: "Thomas Mueller" To: freebsd-questions@freebsd.org Subject: fsck not working on messed-up file system X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 10:05:08 -0000 I have or had a problem with a file system (FreeBSD UFS2) messed up, either by errant software or system freeze/crash. I successfully cross-compiled, from FreeBSD 9.0-STABLE, a NetBSD 5.1_STABLE i386 system to install on 8 GB USB stick. I have both the NetBSD system source as well as pkgsrc and the FreeBSD ports tree on a FreeBSD partition originally used for FreeBSD 9.0-BETA1, hence I use /BETA1 as the mount point. This partition is /dev/ada0p9 in FreeBSD and /dev/dk6 in NetBSD. I subsequently built modular-xorg for this NetBSD installation, installating to USB stick but doing the heavy compiling on the hard-drive partition. NetBSD, especially with X, is rather freeze/crash-prone, meaning file system is not cleanly umounted. I then tried to cross-compile, from same NetBSD source tree, NetBSD 5.1_STABLE amd64 but was thrown in the debugger (db>), not really knowing what to do there. Choosing reset did not provide clean file-system unmount. I had to run "fsck /dev/ada0p9" on the reboot, got unreadable sectors and eventually a prompt to run fsck again. I did this but got to an infinite loop, where I got the same prompt again to run fsck again, with the same unreadable blocks. I got the same thing booting a backup installation of FreeBSD 9.0_STABLE amd64 on a USB stick. I eventually ran with "script" to capture the output onto another USB stick, sorry about all those ASCII 13s at the ends of the lines: Script started on Wed Sep 19 04:15:02 2012 fsck_ffs /dev/ada0p9 ** /dev/ada0p9 ** Last Mounted on /BETA1 ** Phase 1 - Check Blocks and Sizes CANNOT READ BLK: 7584192 CONTINUE? [yn] y THE FOLLOWING DISK SECTORS COULD NOT BE READ: 7584318, 7584319, ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 1475900 files, 4638292 used, 21162419 free (61643 frags, 2637597 blocks, 0.2% fragmentation) ***** FILE SYSTEM STILL DIRTY ***** ***** PLEASE RERUN FSCK ***** Script done on Wed Sep 19 04:17:27 2012 Would this indicate a software bug, or is my Western Digital Caviar Green 3 TB hard drive failing? I booted that USB stick with NetBSD 5.1_STABLE i386, successfully mounted that partition, /dev/dk6 in NetBSD, but got the message about dirty flag. So I umounted and ran NetBSD fsck_ffs, and after removing some files, mainly in /pkgsrc directory, and salvaging some stuff, got apparent success, and now that file system is again accessible in both NetBSD 5.1_STABLE i386 and FreeBSD 9.0_STABLE amd64. Now I wonder if the file system is really fixed, with possibly some files in /pkgsrc subdirectories lost, or if the hard drive is starting to fail. Tom