From owner-freebsd-questions@FreeBSD.ORG Fri Sep 24 21:42:56 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EA9016A4CE; Fri, 24 Sep 2004 21:42:56 +0000 (GMT) Received: from esafe.connectalk.com (esafe.connectalk.com [204.19.165.17]) by mx1.FreeBSD.org (Postfix) with SMTP id 4A95E43D1F; Fri, 24 Sep 2004 21:42:55 +0000 (GMT) (envelope-from awebster@connectalk.com) Received: from mtlex01.connectalk.com ([IP=10.125.204.14]) by eSafe SMTP Relay 1095882830; Fri Sep 24 17:57:49 2004 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 24 Sep 2004 17:42:53 -0400 Message-ID: <9D61D69E3C1F7F459C5513AD830EE219047E7B@mtlex01.connectalk.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help/problems with fsck_ffs Thread-Index: AcSif3KKTpHlluoPSHC+/57vDRHQHA== From: "Webster, Andrew" To: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Help/problems with fsck_ffs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2004 21:42:56 -0000 FreeBSD: 5.2.1-RELEASE, and 5.2.1-p10 =20 Synopsis I have 2 identical systems with very large 1.3TB disk array (OS sees it as a single drive /dev/da1) On one system fsck /dev/da1s1d works fine, on the other fsck /dev/da1s1d fails with BAD SUPER BLOCK error. =20 Description On the problem system, fsck returns: # fsck_ffs /dev/da1s1d ** /dev/da1s1d BAD SUPER BLOCK: VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE =20 LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y =20 64 is not a file system superblock 917118848 is not a file system superblock 1834237632 is not a file system superblock SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE -b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8). =20 However when running fsck_ffs -b 192 (192 because newfs listed it as a backup superblock location) /dev/da1s1d on the problem system, it works fine.=20 # fsck_ffs -b 192 /dev/da1s1d Alternate super block location: 192 ** /dev/da1s1d ** Last Mounted on=20 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 298602 files, 10861179 used, 309521859 free (763 frags, 38690137 blocks, 0.0% fragmentation) =20 UPDATE STANDARD SUPERBLOCK? [yn] y =20 =20 ***** FILE SYSTEM WAS MODIFIED *****=20 =20 Trying fsck_ffs /dev/da1s1d again after responding to UPDATE STANDARD SUPERBLOCK still returns BAD SUPER BLOCK error message, so the update isn't happening, or it is writing to THE WRONG PART OF THE DISK! =20 I recompiled fsck_ffs with debugging and spent a while looking at it, and have a few observations. =20 Setup.c 346: super *=3D dev_bsize; Interestingly this doesn't work as expected when debugging. Super went from 128 to 128 as I stepped through this code (dev_bsize was 512). I don't know if it is a problem with GDB or with GCC, but when I removed the -O option in the compile, it worked, and super went from 128 to 65536, but didn't fix the superblock problem. =20 Second observation: Setup.c 356 getblk(&asblk, cgsblock(&sblock, sblock.fs_ncg - 1), sblock.fs_sbsize); This looks like to goes to get the _LAST_ superblock on the drive and then compares it to the first. If they don't match: error. The problem is that there is no way to _correct_ a particular superblock, as the UPDATE STANDARD SUPERBLOCK only fixes the first one if there is a problem with it. The only way to workaround the problem is to backup the data, newfs and restore, but 1.3TB is somewhat large... =20 The question: How to you repair the damaged superblock when it isn't the first one? =20 -- Andrew=20 =20 *************************************************************************= ************************* The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error please notify the system manager= or the=20 sender immediately and do not disclose the contents to anyone or make cop= ies. ** eSafe scanned this email for viruses, vandals and malicious content. *= * *************************************************************************= *************************