Re: [REPOST] fsck segfaults trying to repair HFS filesystem

From: Alan D Johnson (adjtech_at_usadatanet.net)
Date: 06/25/04


Date: Thu, 24 Jun 2004 21:33:21 -0400

Mark Bartelt wrote:

> [ I posted this at the beginning of the month. But sadly, I got
> exactly zero replies. I figure, at the risk of being horribly
> redundant, I'll post it one more time, in hopes that somebody
> who has a useful suggestion (or better yet, somebody from HP
> with access to a non-segfaulting fsck!) might have missed it
> the first time around. If not, I guess I'll just give up and
> build a new virgin filesystem on those disks ... ]
>
> Hi, folks ... We have a rather long-in-the-tooth Superdome,
> running HP-UX 11.11, and one of its disks (part of a volume
> group comprising eight drives) recently developed a bunch of
> bad blocks.
>
> The filesystem living on the logical volume isn't backed up.
> And of course, we have a couple users who, even though they
> were aware (or should have been aware) that there aren't any
> backups, are hoping to retrieve their data.
>
> So, my plan was basically this:
>
> (1) Do an image copy of the bad disk onto an identical (but
> good) disk. For those sectors which are unreadable, write a
> sector of all-zeros.
>
> (2) Replace the bad drive with the good one.
>
> (3) Run fsck on the filesystem (it's HFS; historical reasons
> not worth delving into ;-) to resurrect it as much as possible.
>
> Steps (1) and (2) went just fine. Unfortunately, when I try to
> repair the moderately-garbled filesystem (several dozen blocks,
> which were bad on the original disk, are of course wrong; plus
> there are most likely other inconsistencies resulting from the
> fact that the hardware problems meant the filesystem didn't get
> unmounted cleanly), fsck gets a segmentation fault and drops a
> core file.
>
> One would hope that fsck, if confronted with a filesystem that
> it couldn't put back together, would at least give up the ghost
> more gracefully than _that_.
>
> I'm hoping that there might be some updated fsck kicking around
> somewhere, fixing whatever bug is causing it to segfault. But
> our friendly HP guy reports that the most recent version he has
> access to appears to be identical to the one we have.
>
> Any useful suggestions? Do any HP insiders have access to some
> non-standard (and perhaps non-segfaulting) version of fsck that
> we could try?
>
> Oh, and I did try using "-f" with "-F hfs" to force a mount even
> though the filesystem is dirty. But unfortunately, with things
> in this current not-repaired-by-fsck state, only around 1% or so
> of the contents can be accessed. (With the filesystem still in
> its garbled state, one gets directory read errors on most of the
> directories when trying to descend through the hierarchy.)
>
> Many TIA ...
>
> ---------------
>
> Mark Bartelt
> Center for Advanced Computing Research
> California Institute of Technology
> Pasadena, California 91125
>
> 626 395 2522
> 626 584 5917 fax
> 626 628 3994 e-fax
>
> mark@cacr.caltech.edu
>
> http://www.cacr.caltech.edu/~mark
The one idea I would have is to use stm to check the media and find out
where the bad sectors are then spare them out, long, slow, tedious,
painfull at times but it should work unless the disk is really hosed.



Relevant Pages

  • identifying filesystem blocks (was Re: better disk reliability on a desktop machine)
    ... will identify the files (or inodes, or other filesystem metadata) ... The broken filesystem wouldn't fsck at ... But after the dd's (i.e. with those bad sectors replaced ... Nick Barnes ...
    (freebsd-questions)
  • Re: corrupt filesystem
    ... > I have a defect UFS filesystem where fsck reports unreadable blocks ... > CANNOT READ: BLK 1664 ... > THE FOLLOWING SECTORS COULD NOT BE READ: ...
    (comp.unix.solaris)
  • Re: fragmentation of file systems on linux.
    ... Is the unmount a must? ... If you have any drive problems fsck will ... better to do that than allow the bad sectors to go unheeded anyway. ... screwing up my filesystem just by "checking" it for fragmentation. ...
    (comp.os.linux.misc)
  • Re: fsckd - FIXED
    ... filesystem errors on boot, with the "hit control-D to continue or give root ... to fix the errors with fsck. ... filesystem and inability to reboot. ...
    (Debian-User)
  • Re: Ignorant user overfilled /usr; strange errors followed. Fixed with fsck -y, but what exactly
    ... While attempting to follow filesystem activity (and not realising the ... X/KDE, and found a whole sequence of 'filesystem is full' errors on ... Don't run fsck on a live filesystem; ... filesystem that apparently had no free blocks. ...
    (freebsd-questions)