RE: fsck'ing a Vinum RAID5 volume (and a stale drive)

From: Daniel Eriksson (daniel_k_eriksson_at_telia.com)
Date: 06/26/04

  • Next message: j.e.drews_at_att.net: "Does Zoom 3075 PCMCIA modem work on FreeBSD ?"
    To: "'Benjamin P. Keating'" <bkeating@gmail.com>, <freebsd-questions@freebsd.org>
    Date: Sat, 26 Jun 2004 05:35:09 +0200
    
    

    Benjamin P. Keating wrote:

    > I've found on the net that I can switch the state by doing:
    >
    > $ vinum setstate up backup.p0 backup.p0.s3

    Ouch, this is a bad move. You just told vinum to start using the stale (=out
    of date data) disc as if it was up to date and nothing was wrong with it.
    Basically you have trashed your data, possibly beyond repair.

    Why was the disc in a stale state? If it developed bad blocks that could not
    be remapped, then vinum marked it as stale and continued to use the other
    discs in degraded mode (just as it should). Even if the disc did not break
    (maybe just connection problems or something), once vinum marked it as stale
    any further writing to the array would immediately invalidate the data on
    the disc; which means the only way to bring it back up would be to go throug
    a proper rebuild of the data.

    > I rebooted, the state is "up" so I unmounted the volume to fsck it. Is
    > this approach correct? does this do anything productive or just forces
    > the state label to change and do nothing to the drives? I don't feel
    > confident that it did anything and Im having a VERY hard time finding
    > documentation on this.

    Your approach is not correct. You should have paid attention to the vinum
    manpage which says this about setstate: "This bypasses the usual consistency
    mechanism of vinum and should be used only for recovery purposes. It is
    possible to crash the system by incorrect use of this command."

    It is unfortunate that the manpage says "for recovery", since people can
    misunderstand and think you can recover from a crashed disc. setstate should
    not need to be used during normal operation, even if a disc in a RAID-5
    array crashes.

    > Im assuming I'll want to answer yes to at least some of those. Can I
    > say yes to all of them? What errors should I say no to? I have no idea
    > whats bad bad and whats correctable.

    An fsck of a degraded RAID-5 array should not normally have any errors. The
    errors you are seeing is because you have forced out-of-date (stale) data
    into the middle of the filesystem, messing up pretty much the entire
    filesystem.

    > Now. because this is a raid5 volume, are some of these fsck prompts
    > false positives? ie; fsck is giving a error but really it's fine as
    > it's raid5?

    No, that is not how RAID-5 works. RAID-5 protects the integrity of the
    filesystem by ensuring that the stored data can be read/written even if one
    disc fails. RAID arrays work at a level below the filesystem, and they
    generally don't know anything about the actual filesystem.

    Your only hope now is if you haven't actually allowed anything to be written
    to the array. If fsck changed things around then you are probably out of
    luck. IF nothing has been written, then reset the failed disc to the
    "stale/down" state (which should put the array in degraded mode hopefully)
    and then try fsck again. If you are lucky you should see no errors at all.

    If the disc isn't physically broken, then the proper way to get your array
    back to the original "all up" state, you should run a "vinum start
    backup.p0.s3". I'm not sure if this will rebuild all the data automatically
    (it does for RAID-1 arrays), but if it doesn't then I guess you also need to
    run a "vinum rebuildparity backup.p0".

    /Daniel Eriksson

    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: j.e.drews_at_att.net: "Does Zoom 3075 PCMCIA modem work on FreeBSD ?"

    Relevant Pages

    • RE: Vinum status
      ... Has anyone tried to verify the recovery capability of gvinum for RAID-5 ... I recently helped a friend set up a 4 disc RAID-5 array, ...
      (freebsd-current)
    • Re: Can linux support hotswap ?
      ... If you want to increase your data's integrity against harddisk failures, ... you need to set up a "raid array". ... behave like a regular disc .. ... but I'm confident that your Hardware e.g. your disc controller WILL NOT like ...
      (comp.os.linux.setup)
    • Re: Dead PowerBook G4
      ... Just whip the disc out and stick it in something else. ... You set aside a Saturday afternoon, line up an array of spudgers, get ...
      (uk.comp.sys.mac)
    • RAID Version & Backup advice please
      ... Array - any views on speed, reliability, justifiability, etc (I am aware it ... We were thinking of just one Raid array with ... rather than separate arrays to avoid the disc numbers ... at Paragon DriveBackup Small Business server edition - it appears to provide ...
      (microsoft.public.windows.server.sbs)