Help/problems with fsck_ffs
Webster, Andrew
awebster at connectalk.com
Fri Sep 24 14:42:56 PDT 2004
FreeBSD: 5.2.1-RELEASE, and 5.2.1-p10
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.
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
LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y
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).
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.
# fsck_ffs -b 192 /dev/da1s1d
Alternate super block location: 192
** /dev/da1s1d
** Last Mounted on
** 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)
UPDATE STANDARD SUPERBLOCK? [yn] y
***** FILE SYSTEM WAS MODIFIED *****
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!
I recompiled fsck_ffs with debugging and spent a while looking at it,
and have a few observations.
Setup.c 346: super *= 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.
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...
The question: How to you repair the damaged superblock when it isn't
the first one?
--
Andrew
**************************************************************************************************
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
sender immediately and do not disclose the contents to anyone or make copies.
** eSafe scanned this email for viruses, vandals and malicious content. **
**************************************************************************************************
More information about the freebsd-fs
mailing list