Re: critical bugs in md raid5

From: Andi Kleen (ak_at_muc.de)
Date: 01/27/05

  • Next message: Jack O'Quin: "Re: [patch, 2.6.11-rc2] sched: RLIMIT_RT_CPU_RATIO feature"
    To: linux-kernel@vger.kernel.org
    Date:	Thu, 27 Jan 2005 06:11:34 +0100
    
    

    Marc Lehmann <linux-kernel@plan9.de> writes:
    >
    > The summary seems to be that the linux raid driver only protects your data
    > as long as all disks are fine and the machine never crashes.

    "as long as the machine never crashes". That's correct. If you think
    about how RAID 5 works there is no way around it. When a write to
    a single stripe is interrupted (machine crash) and you lose a disk
    during the recovery a lot of data (even unrelated to the data just written)
    is lost. That is because there is no way to figure out what part
    of the data on the stripe belonged to the old and what part to
    the new write.

    But that's nothing inherent in Linux RAID5. It's a generic problem.
    Pretty much all Software RAID5 implementations have it.

    The only way around it is to journal all writes, to make stripe
    updates atomic, but in general that's too slow unless you have a
    battery backed up journal device.

    There are some tricks to avoid this (e.g. always write to a new disk
    location and update an disk index atomically), but they tend to be
    heavily patented and are slower too. They also go far beyond RAID-5
    (use disk space less efficiently etc.) and typically need support
    from the file system to be efficient.

    RAID-1 helps a bit, because you either get the old or the new data,
    but not some corruption. In practice even old data can be a big
    problem though (e.g. when file system metadata is affected)

    Morale: if you really care about your data backup very often and
    use RAID-1 or get an expensive hardware RAID with battery backup
    (all the cheap "hardware RAIDs" are equally useless for this)

    -Andi
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Jack O'Quin: "Re: [patch, 2.6.11-rc2] sched: RLIMIT_RT_CPU_RATIO feature"

    Relevant Pages

    • slackware 9.1 software raid problem
      ... Setting up a RAID system with Slackware 8 is not extremely difficult once ... mirroring the root partition and booting from that mirror was not possible. ... Each disk is attached to a different IDE chain on the motherboard. ... The ability to boot from the Slackware 8 install CD. ...
      (alt.os.linux)
    • Re: Is it HighPoint, is it Seagate, or is it Windows 2000 Professional
      ... I have really learnt about the uses and limits of RAID. ... Use all the manufacturer recommended system recovery ... provisions -- Emergency Disk, have a DOS boot disk ready, ... what could cause Windows to suddenly change its mind ...
      (microsoft.public.win2000.setup)
    • LVM on SW RAID for sarge - success
      ... I've just had success migrating Debian Sarge to root on LVM on RAID. ... First make sure the SCSI BIOS boots from the first disk. ... I made reiserfs on all the filesystem partitions and completed the ... The remaining two disks were partitioned and used to create RAID arrays ...
      (Debian-User)
    • Re: Platzierung und Größe der Auslagerungsdatei
      ... der Controller steckt, ... Bei der Latency ist die Raptor um Faktor 1,4, bei der Seektime um Faktor ... We recommend that you plan to use less than 80% disk utilization at ... Raid 0 has the same cost as no raid. ...
      (microsoft.public.de.german.windows.server.general)
    • Re: Is it HighPoint, is it Seagate, or is it Windows 2000 Professional
      ... As you've discovered Raid 0 has no fail safe redundancy, ... Then I tried to boot my system: Windows reported ... Barracuda disk running off a HighPoint HPT370A RAID ... never new that my drives were set up this way. ...
      (microsoft.public.win2000.setup)