´ÙÀ½ ÀÌÀü Â÷·Ê

4. ¿¡·¯ÀÇ º¹±¸

  1. Q: RAID-1À» »ç¿ëÇÏ°í Àִµ¥, µð½ºÅ©°¡ ÀÛµ¿Áß Àü¿øÀÌ ²¨Á³½À´Ï´Ù. ¾î¶»°Ô ÇØ¾ß ÇÒ±î¿ä?
    A: ÀÌ·± »óȲ¿¡¼­´Â ¸î°¡Áö ¹æ¹ýÀÌ ÀÖ´Ù.

    The redundancy of RAID levels is designed to protect against a disk failure, not against a power failure.

    There are several ways to recover from this situation.

    • ù¹ø° ¹æ¹ýÀº raid µµ±¸µéÀ» »ç¿ëÇÏ´Â °ÍÀÌ´Ù. ÀÌ°ÍÀº raidÀÇ µ¥ÀÌÅ͵éÀ» µ¿±âÈ­ ½ÃÄÑÁØ´Ù.(sync) ÇÏÁö¸¸, ÆÄÀϽýºÅÛÀÇ ¼Õ»óÀº º¹±¸ÇØÁÖÁö ¾ÊÀ¸¹Ç·Î ÈÄ¿¡ fsck¸¦ »ç¿ëÇØ °íÃÄ¾ß ÇÑ´Ù. RAID ´Â ckraid /etc/raid1.conf ÅëÇØ Á¡°ËÇغ¼¼ö ÀÖ´Ù.(RAID-1ÀÏ °æ¿ìÀÌ´Ù, ´Ù¸¥ °æ¿ì¶ó¸é, /etc/raid5.confó·³»ç¿ëÇØ¾ß ÇÑ´Ù.) ckraid /etc/raid1.conf --fix ¸¦ »ç¿ëÇØ RAIDµÈ µð½ºÅ©Áß Çϳª¸¦ ¼±ÅÃÇؼ­, ´Ù¸¥ µð½ºÅ©·Î ¹Ì·¯¸µ ½Ãų¼ö ÀÖ´Ù. µð½ºÅ©Áß ¾î´À °ÍÀ» ¼±ÅÃÇØ¾ß ÇÒÁö ¸ð¸¥´Ù¸é, ckraid /etc/raid1.conf --fix --force-source /dev/hdc3 ÀÌ·± ½ÄÀ¸·Î --force-source¿É¼ÇÀ» »ç¿ëÇ϶ó.

      ckraid ´Â --fix ¿É¼ÇÀ» Á¦°ÅÇÔÀ¸·Î½á RAID ½Ã½ºÅÛ¿¡ ¾î¶² º¯È­¾øÀÌ ¾ÈÀüÇÏ°Ô ½Ãµµ µÉ ¼ö ÀÖ´Ù. Á¦¾ÈµÈ º¯°æ¿¡ ´ëÇؼ­, ¸¸Á·ÇÒ °æ¿ì¿¡ --fix ¿É¼ÇÀ» »ç¿ëÇضó.

      Method (1): Use the raid tools. These can be used to sync the raid arrays. They do not fix file-system damage; after the raid arrays are sync'ed, then the file-system still has to be fixed with fsck. Raid arrays can be checked with ckraid /etc/raid1.conf (for RAID-1, else, /etc/raid5.conf, etc.)

      Calling ckraid /etc/raid1.conf --fix will pick one of the disks in the array (usually the first), and use that as the master copy, and copy its blocks to the others in the mirror.

      To designate which of the disks should be used as the master, you can use the --force-source flag: for example, ckraid /etc/raid1.conf --fix --force-source /dev/hdc3

      The ckraid command can be safely run without the --fix option to verify the inactive RAID array without making any changes. When you are comfortable with the proposed changes, supply the --fix option.

    • µÎ¹ø° ¹æ¹ýÀº ù¹ø° ¹æ¹ýº¸´Ù ¸¹ÀÌ ÁÁÀº ¹æ¹ýÀº ¾Æ´Ï´Ù. /dev/hda3 ¿Í /dev/hdc3 ·Î ¸¸µé¾îÁø RAID-1 µð½ºÅ©°¡ ÀÖ´Ù°í °¡Á¤ÇÒ¶§, ¾Æ·¡¿Í °°ÀÌ Çغ¼¼ö ÀÖ´Ù.

      Method (2): Paranoid, time-consuming, not much better than the first way. Lets assume a two-disk RAID-1 array, consisting of partitions /dev/hda3 and /dev/hdc3. You can try the following:

      1. fsck /dev/hda3
      2. fsck /dev/hdc3
      3. µÎ°³ÀÇ ÆÄƼ¼ÇÁß, ¿¡·¯°¡ ÀûÀº ÂÊÀ̳ª, ´õ ½±°Ô º¹±¸°¡ µÈÂÊ, ¶Ç´Â º¹±¸ÇÏ°í ½ÍÀº µ¥ÀÌÅÍ°¡ ³²¾ÆÀÖ´Â Âʵî, »õ·Î¿î ¸¶½ºÅÍ·Î ¾µ ÆÄƼ¼ÇÀ» °áÁ¤ÇØ¾ß ÇÑ´Ù. /dev/hdc3 ¸¦ ¼±ÅÃÇß´Ù ÇÏÀÚ.

        decide which of the two partitions had fewer errors, or were more easily recovered, or recovered the data that you wanted. Pick one, either one, to be your new ``master'' copy. Say you picked /dev/hdc3.

      4. dd if=/dev/hdc3 of=/dev/hda3
      5. mkraid raid1.conf -f --only-superblock

      ¸¶Áö¸· µÎ´Ü°è ´ë½Å¿¡ ckraid /etc/raid1.conf --fix --force-source /dev/hdc3 ¸¦ »ç¿ëÇϸé Á» ´õ ºü¸¦ °ÍÀÌ´Ù.

      Instead of the last two steps, you can instead run ckraid /etc/raid1.conf --fix --force-source /dev/hdc3 which should be a bit faster.

    • ¼¼¹ø¤Š ¹æ¹ýÀº ¿À·¨µ¿¾È fsck¸¦ ±â´Ù¸®±â°¡ ±ÍÂúÀº »ç¶÷µéÀ» À§ÇÑ °ÍÀÌ´Ù. ù¹ø° 3´Ü°è¸¦ ¶Ù¾î³Ñ°í ¹Ù·Î ¸¶Áö¸· µÎ´Ü°è¸¦ ½ÇÇàÇÏ´Â °ÍÀÌ´Ù. ±×·± ÈÄ¿¡ fsck /dev/md0 ¸¦ ½ÇÇàÇÏ´Â °ÍÀÌ´Ù. ÀÌ°ÍÀº ù¹ø° ¹æ¹ýÀÇ ¸ð¾çÀ» ¹Ù²Û °ÍÀÏ »ÓÀÌ´Ù.

      Method (3): Lazy man's version of above. If you don't want to wait for long fsck's to complete, it is perfectly fine to skip the first three steps above, and move directly to the last two steps. Just be sure to run fsck /dev/md0 after you are done. Method (3) is actually just method (1) in disguise.

    ¾î¶² ¹æ¹ýµµ RAID¸¦ µ¿±âÈ­ ½ÃÄÑÁÙ ¼ö ÀÖÀ» »ÓÀÌ°í, ÆÄÀÏ ½Ã½ºÅÛ ¶ÇÇÑ Àß º¹±¸µÇ±â¸¦ ¿øÇÒ °ÍÀÌ´Ù. À̸¦ À§Çؼ­, fsck¸¦ md device¸¦ unmount ½ÃŲÈÄ fsck¸¦ ½ÇÇàÇ϶ó.

    In any case, the above steps will only sync up the raid arrays. The file system probably needs fixing as well: for this, fsck needs to be run on the active, unmounted md device.

    ¼¼°³ÀÇ µð½ºÅ©·Î ±¸¼ºµÈ RAID-1 ½Ã½ºÅÛÀ̶ó¸é ¸¹ÀÌ ÀÏÄ¡ÇÑ ºÎºÐÀ» ÅëÇØ, ´äÀ» ã¾Æ³»´Â ¹æ¹ýµîÀÇ, Á¶±Ý ´õ ¸¹Àº ¹æ¹ýÀÌ ÀÖ°ÚÁö¸¸, ÀÌ·± °ÍÀ» ÀÚµ¿À¸·Î ÇØÁÖ´Â µµ±¸´Â ÇöÀç Áö¿øµÇÁö ¾Ê´Â´Ù.

    With a three-disk RAID-1 array, there are more possibilities, such as using two disks to ''vote'' a majority answer. Tools to automate this do not currently (September 97) exist.

  2. Q: RAID-4 ¶Ç´Â RAID-5 ½Ã½ºÅÛÀ» °¡Áö°í Àִµ¥, µð½ºÅ© ÀÛµ¿Áß¿¡ ²¨Á³½À´Ï´Ù. ¾î¶»°Ô ÇØ¾ß ÇÒ±î¿ä?
    A: RAID-4³ª RAID-5 ½Ã½ºÅÛ¿¡¼­´Â ¿¹ºñ ¼ö¸®¸¦ À§ÇØ fsck¸¦ »ç¿ëÇÒ ¼ö ¾ø´Ù. ¸ÕÀú ckraid¸¦ »ç¿ëÇ϶ó.

    ckraid ´Â --fix ¿É¼ÇÀ» Á¦°ÅÇÔÀ¸·Î½á RAID ½Ã½ºÅÛ¿¡ ¾î¶² º¯È­¾øÀÌ ¾ÈÀüÇÏ°Ô ½Ãµµ µÉ ¼ö ÀÖ´Ù. Á¦¾ÈµÈ º¯°æ¿¡ ´ëÇؼ­, ¸¸Á·ÇÒ °æ¿ì¿¡ --fix ¿É¼ÇÀ» »ç¿ëÇضó.

    ¿øÇÑ´Ù¸é,--suggest-failed-disk-mask ¿É¼ÇÀ» ÅëÇØ µð½ºÅ©µéÁß Çϳª¸¦ ¸Á°¡Áø µð½ºÅ©·Î ÁöÁ¤ÇÑ Ã¤ ckraid¸¦ ½Ãµµ ÇÒ¼ö ÀÖ´Ù.

    RAID-5´Â ´ÜÁö ÇϳªÀÇ bit¸¸ÀÌ flag ·Î ¼³Á¤µÇ¾î Àֱ⠶§¹®¿¡, RAID-5´Â µÎ°³ÀÇ µð½ºÅ©°¡ ¸Á°¡Á³À» ¶§´Â º¹±¸ÇÒ ¼ö ¾ø´Ù. ¾Æ·¡´Â binary bit mask ÀÌ´Ù.

    The redundancy of RAID levels is designed to protect against a disk failure, not against a power failure.

    Since the disks in a RAID-4 or RAID-5 array do not contain a file system that fsck can read, there are fewer repair options. You cannot use fsck to do preliminary checking and/or repair; you must use ckraid first.

    The ckraid command can be safely run without the --fix option to verify the inactive RAID array without making any changes. When you are comfortable with the proposed changes, supply the --fix option.

    If you wish, you can try designating one of the disks as a ''failed disk''. Do this with the --suggest-failed-disk-mask flag.

    Only one bit should be set in the flag: RAID-5 cannot recover two failed disks. The mask is a binary bit mask: thus:

        0x1 == first disk
        0x2 == second disk
        0x4 == third disk
        0x8 == fourth disk, etc.
                
    
    ¶Ç´Â, --suggest-fix-parity ¿É¼ÇÀ» ÅëÇØ parity ¼½Å͸¦ ¼öÁ¤ÇÒ ¼öµµ ÀÖ´Ù. ÀÌ°ÍÀº ´Ù¸¥ ¼½Å͵é·ÎºÎÅÍ parity ¸¦ ´Ù½Ã °è»êÇس¾ °ÍÀÌ´Ù.

    --suggest-failed-dsk-mask ¿Í --suggest-fix-parity ¿É¼ÇÀº --fix¿É¼ÇÀ» Á¦°ÅÇÔÀ¸·Î½á, °¡´ÉÇÑ ¼öÁ¤ °èȹÀÇ È®ÀÎÀ» À§ÇØ ¾ÈÀüÇÏ°Ô »ç¿ëµÉ¼ö ÀÖ´Ù.

    Alternately, you can choose to modify the parity sectors, by using the --suggest-fix-parity flag. This will recompute the parity from the other sectors.

    The flags --suggest-failed-dsk-mask and --suggest-fix-parity can be safely used for verification. No changes are made if the --fix flag is not specified. Thus, you can experiment with different possible repair schemes.

  3. Q: /dev/hda3 °ú /dev/hdc3 µÎ°³ÀÇ µð½ºÅ©·Î /dev/md0 ÀÇ RAID-1 ½Ã½ºÅÛÀ» ¸¸µé¾î¼­ »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù. ÃÖ±Ù¿¡, /dev/hdc3 ÀÌ °íÀ峪¼­ »õ µð½ºÅ©¸¦ ±¸ÀÔÇß´Ù. Á¦ °¡Àå Ä£ÇÑ Ä£±¸°¡, ''dd if=/dev/hda3 of=/dev/hdc3''¸¦ Çغ¸¶ó°í Çؼ­ Çغ¸¾ÒÁö¸¸, ¾ÆÁ÷µµ ÀÛµ¿ÇÏ°í ÀÖÁö ¾Ê½À´Ï´Ù.

    My RAID-1 device, /dev/md0 consists of two hard drive partitions: /dev/hda3 and /dev/hdc3. Recently, the disk with /dev/hdc3 failed, and was replaced with a new disk. My best friend, who doesn't understand RAID, said that the correct thing to do now is to ''dd if=/dev/hda3 of=/dev/hdc3''. I tried this, but things still don't work.

    A: Ä£±¸¸¦ ´ç½ÅÀÇ ÄÄÇ»ÅÍ¿¡ °¡±îÀÌ °¡°Ô ÇÏÁö ¾Ê°Ô Çؼ­, ±³¿ì°ü°è¸¦ À¯ÁöÇÏ´Â °Ô ÁÁÀ» °ÍÀÌ´Ù. ´ÙÇེ·´°Ôµµ, ½É°¢ÇÑ ¼Õ»óÀ» ÀÔÁö´Â ¾Ê´Â´Ù. ¾Æ·¡¿Í °°ÀÌ ½ÇÇàÇÔÀ¸·Î½á, ½Ã½ºÅÛÀ» ȸº¹½Ãų¼ö ÀÖÀ» °ÍÀÌ´Ù.
    mkraid raid1.conf -f --only-superblock
                
    
    dd ¸í·É¾î¸¦ ÀÌ¿ëÇؼ­, ÆÄƼ¼ÇÀÇ º¹»çº»À» ¸¸µå´Â °ÍÀº ´ëºÎºÐ °¡´ÉÇÏ´Ù. ÇÏÁö¸¸, RAID-1 ½Ã½ºÅÛ¿¡¼­´Â superblock ÀÌ ´Ù¸£±â ¶§¹®¿¡ ¾ÈµÈ´Ù. ¶§¹®¿¡ RAID-1À» µÎ ÆÄƼ¼ÇÁßÀÇ ÇϳªÀÇ superblock¸¦ ´Ù½Ã ¸¸µé¾îÁÖ¸é, ´Ù½Ã »ç¿ë°¡´ÉÇÏ°Ô µÉ °ÍÀÌ´Ù.

    You should keep your best friend away from you computer. Fortunately, no serious damage has been done. You can recover from this by running:

    mkraid raid1.conf -f --only-superblock
                
    
    By using dd, two identical copies of the partition were created. This is almost correct, except that the RAID-1 kernel extension expects the RAID superblocks to be different. Thus, when you try to reactivate RAID, the software will notice the problem, and deactivate one of the two partitions. By re-creating the superblock, you should have a fully usable system.

  4. Q: ³» mkraid ´Â --only-superblock ¿É¼ÇÀÌ Áö¿øµÇÁö ¾Ê´Â ¹öÁ¯ÀÔ´Ï´Ù. ¾î¶»°Ô ÇØ¾ß ÇÒ±î¿ä?
    A: »õ·Î¿î Åø¿¡¼­´Â --force-resync ¿É¼ÇÀ¸·Î ¹Ù²ã¾ú°í, ÃÖ½ÅÀÇ ÅøµéÀÇ »ç¿ëÀº ¾Æ·¡¿Í °°ÀÌ »ç¿ëÇØ¾ß ÇÑ´Ù.
      umount /web (/dev/md0°¡ ¸¶¿îÆ® µÇ¾îÀÖ´Â °÷.)
      raidstop /dev/md0
      mkraid /dev/md0 --force-resync --really-force
      raidstart /dev/md0
                
    
    cat /proc/mdstat ¸¦ ÅëÇØ °á°ú¸¦ º¼ ¼ö ÀÖÀ» °ÍÀÌ°í, mount /dev/md0¸¦ ÅëÇØ ´Ù½Ã »ç¿ë°¡´ÉÇÒ °ÍÀÌ´Ù.

    The newer tools drop support for this flag, replacing it with the --force-resync flag. It has been reported that the following sequence appears to work with the latest tools and software:

      umount /web (where /dev/md0 was mounted on)
      raidstop /dev/md0
      mkraid /dev/md0 --force-resync --really-force
      raidstart /dev/md0
                
    
    After doing this, a cat /proc/mdstat should report resync in progress, and one should be able to mount /dev/md0 at this point.
  5. Q: /dev/hda3 °ú /dev/hdc3 µÎ°³ÀÇ µð½ºÅ©·Î /dev/md0 ÀÇ RAID-1 ½Ã½ºÅÛÀ» ¸¸µé¾î¼­ »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù. Á¦ °¡Àå Ä£ÇÑ (¿©ÀÚ?) Ä£±¸°¡, ¸øº¸´Â »çÀÌ, /dev/hda3 ¸¦ fsck ·Î ½ÇÇà½ÃÅ°´Â ¹Ù¶÷¿¡, RAID°¡ µ¿ÀÛÇÏÁö ¾Ê°í ÀÖ½À´Ï´Ù. ¾î¶»°Ô ÇØ¾ß ÇÒ±î¿ä?

    My RAID-1 device, /dev/md0 consists of two hard drive partitions: /dev/hda3 and /dev/hdc3. My best (girl?)friend, who doesn't understand RAID, ran fsck on /dev/hda3 while I wasn't looking, and now the RAID won't work. What should I do?

    A: ´ç½ÅÀº °¡Àå Ä£ÇÑ Ä£±¸¶ó´Â °³³äÀ» ´Ù½Ã Çѹø »ý°¢Çغ¸¾Æ¾ß ÇÒ°ÍÀÌ´Ù. ÀϹÝÀûÀ¸·Î fsck ´Â RAID¸¦ ¸¸µå´Â ÆÄƼ¼ÇÁß Çϳª¿¡¼­ µ¹·Á¼­´Â Àý´ë·Î ¾ÈµÈ´Ù. ÆÄƼ¼Ç ¼Õ»óÀ̳ª, µ¥ÀÌÅÍ ¼Õ»óÀÌ ¹ß»ýµÇÁö ¾Ê¾Ò´Ù°í ÇÑ´Ù¸é, RAID-1 ½Ã½ºÅÛÀ» ¾Æ·¡¿Í °°ÀÌ ¼ö¸®ÇÒ ¼ö ÀÖ´Ù.
    1. /dev/hda3 ÀÇ ¹é¾÷À» ¹Þ´Â´Ù.
    2. dd if=/dev/hda3 of=/dev/hdc3
    3. mkraid raid1.conf -f --only-superblock

    You should re-examine your concept of ``best friend''. In general, fsck should never be run on the individual partitions that compose a RAID array. Assuming that neither of the partitions are/were heavily damaged, no data loss has occurred, and the RAID-1 device can be recovered as follows:

    1. make a backup of the file system on /dev/hda3
    2. dd if=/dev/hda3 of=/dev/hdc3
    3. mkraid raid1.conf -f --only-superblock
    This should leave you with a working disk mirror.

  6. Q: ¿Ö À§ÀÇ º¹±¸ ¼ø¼­´ë·Î ÇØ¾ß Çϴ°¡?
    A: RAID-1 À» ÀÌ·ç´Â ÆÄƼ¼ÇµéÀº ¿Ïº®È÷ °°Àº º¹Á¦º»À̾î¾ß Çϱ⠶§¹®ÀÌ´Ù. ¹Ì·¯¸µÀÌ ÀÛµ¿µÇÁö ¾ÊÀ» °æ¿ì, ÇÇƼ¼ÇµéÁß Çϳª¸¦ RAID¸¦ »ç¿ëÇÏÁö ¾Ê°í mountÇؼ­ »ç¿ëÇÏ°í, ¾Æ·¡¿Í °°Àº ¸í·ÉÀ» »ç¿ëÇØ RAID ½Ã½ºÅÛÀ» º¹±¸ÇÑ ÈÄ, ÆÄƼ¼ÇÀ» unmount ÇÏ°í, RAID ½Ã½ºÅÛÀ» ´Ù½Ã ½ÃÀÛÇÏ¿©¾ß ÇÑ´Ù. ¾Æ·¡ÀÇ ¸í·ÉµéÀº RAID-1ÀÌ ¾Æ´Ñ ´Ù¸¥ ·¹º§µé¿¡ »ç¿ëÇÏ¸é ¾ÈµÈ´Ù´Â °ÍÀ» ÁÖÀÇÇ϶ó.

    Because each of the component partitions in a RAID-1 mirror is a perfectly valid copy of the file system. In a pinch, mirroring can be disabled, and one of the partitions can be mounted and safely run as an ordinary, non-RAID file system. When you are ready to restart using RAID-1, then unmount the partition, and follow the above instructions to restore the mirror. Note that the above works ONLY for RAID-1, and not for any of the other levels.

    À§¿¡¼­ ó·³ ¸Á°¡ÁöÁö ¾ÊÀº ÆÄƼ¼ÇÀ» ¸Á°¡Áø ÆÄƼ¼ÇÀ¸·Î º¹»çÇÏ´Â °ÍÀº ±âºÐ ÁÁÀº ÀÏÀÏ °ÍÀÌ´Ù. ÀÌÁ¦ md ÀåÄ¡¸¦ fsck ·Î °Ë»çÇϱ⸸ ÇÏ¸é µÈ´Ù.

    It may make you feel more comfortable to reverse the direction of the copy above: copy from the disk that was untouched to the one that was. Just be sure to fsck the final md.

  7. Q: ³ª´Â À§ÀÇ Áú¹®µé¿¡ È¥¶õ½º·´´Ù. fsck /dev/md0 ¸¦ ½ÇÇàÇÏ´Â °ÍÀº ¾ÈÀüÇÑ°¡?
    A: ±×·¸´Ù. md ÀåÄ¡µéÀ» fsck ÇÏ´Â °ÍÀº ¾ÈÀüÇÏ´Ù. »ç½Ç, ±×°Ô ¾ÈÀüÇÏ°Ô fsck¸¦ ½ÇÇà½ÃÅ°´Â À¯ÀÏÇÑ ¹æ¹ýÀÌ´Ù.

    Yes, it is safe to run fsck on the md devices. In fact, this is the only safe place to run fsck.

  8. Q: µð½ºÅ©°¡ õõÈ÷ ¿À·ù³ª±â ½ÃÀÛÇÑ´Ù¸é, ¾î´À ÆÄƼ¼ÇÀÇ ¿À·ùÀÎÁö ¸í¹éÇÒ°ÍÀΰ¡? ÀÌ·± È¥¶õÀº °ü¸®ÀڷκÎÅÍ À§ÇèÇÑ °áÁ¤À» ³»¸®°Ô ÇÒ ¼öµµ ÀÖÁö ¾ÊÀº°¡.
    A: µð½ºÅ©¿¡ ¹®Á¦°¡ »ý±â±â »õÀÛÇϸé, RAIDÀÇ Àú¼öÁØ µå¶óÀ̹ö°¡ error Äڵ带 ¹ÝȯÇÒ °ÍÀÌ´Ù. RAID µå¶óÀ̹ö´Â ÁÁÀº ÂÊ diskÀÇ superblock¾È¿¡ ''bad'' Ç¥½Ã¸¦ ÇÒ°ÍÀÌ°í, °¡´ÉÇÑ ¹Ì·¯¸µÀ» À¯ÁöÇϵµ·Ï ¸í·ÉÇÒ °ÍÀÌ´Ù. (³ªÁß¿¡ ¾î¶² ¹Ì·¯¸µÀÌ ÁÁÀº ÂÊÀÌ°í ³ª»ÛÂÊÀÎÁö ¹è¿ì°Ô µÉ °ÍÀÌ´Ù.) ¹°·Ð, disk¿Í Àú¼öÁØ µå¶óÀ̹ö°¡ Àбâ/¾²±â ¿¡·¯¸¦ °¨ÁöÇÒ °ÍÀÌ°í, Á¶¿ëÈ÷ µ¥ÀÌÅÍ°¡ ¸Á°¡ÁöÁö´Â ¾Ê´Â´Ù.

    Once a disk fails, an error code will be returned from the low level driver to the RAID driver. The RAID driver will mark it as ``bad'' in the RAID superblocks of the ``good'' disks (so we will later know which mirrors are good and which aren't), and continue RAID operation on the remaining operational mirrors.

    This, of course, assumes that the disk and the low level driver can detect a read/write error, and will not silently corrupt data, for example. This is true of current drives (error detection schemes are being used internally), and is the basis of RAID operation.

  9. Q: hot-repair ´Â ¹«¾ùÀΰ¡?
    A: RAID ½Ã½ºÅÛÁß ÇϳªÀÇ µð½ºÅ©°¡ ¸Á°¡Á³À» ¶§, RAIDÀÇ ÁߴܾøÀÌ ½ÇÇàÁß¿¡ ¿©ºÐÀÇ µð½ºÅ©ÀÇ Ãß°¡¸¦ ÅëÇØ º¹±¸ÇÏ´Â ''ºü¸¥ º¹±¸'' ¸¦ ¿Ï¼ºÇÏ·Á°í ÁøÇàÁßÀÌ´Ù. ±×·¯³ª ÀÌ°ÍÀ» »ç¿ëÇϱâ À§Çؼ±, ¿©ºÐÀÇ µð½ºÅ©´Â ºÎÆýà ¼±¾ðµÇ¾ú°Å³ª. ¸î¸î Ưº°ÇÑ Àåºñ°¡ Áö¿øÇÏ´Â Àü¿øÀÌ µé¾î¿Â »óÅ¿¡¼­ Çϵ带 Ãß°¡°¡ °¡´ÉÇØ¾ß ÇÑ´Ù.

    Work is underway to complete ``hot reconstruction''. With this feature, one can add several ``spare'' disks to the RAID set (be it level 1 or 4/5), and once a disk fails, it will be reconstructed on one of the spare disks in run time, without ever needing to shut down the array.

    However, to use this feature, the spare disk must have been declared at boot time, or it must be hot-added, which requires the use of special cabinets and connectors that allow a disk to be added while the electrical power is on.

    97³â 10¿ù MDÀÇ º£Å¸¹öÁ¯ÀÌ ÇÒ¼ö ÀÖ´Â °ÍÀº ¾Æ·¡¿Í °°´Ù.

    • ¿©ºÐÀÇ µð½ºÅ©¸¦ ÅëÇÑ RAID 1 ¿Í 5 ÀÇ º¹±¸
    • À߸øµÈ ½Ã½ºÅÛÁ¾·á½Ã RAID-5 parity ÀÇ º¹±¸
    • ÀÛµ¿ÇÏ´Â RAID 1, 4,5 ½Ã½ºÅÛ¿¡ ¿©ºÐ µå¶óÀ̺ê Ãß°¡.
    ÇöÀç ±âº»ÀûÀ¸·Î ÀÚµ¿º¹±¸´Â ¼³Á¤µÇ¾î ÀÖÁö ¾Ê°í, include/linux/md.h ¾ÈÀÇ SUPPORT_RECONSTRUCTION °ªÀ» ¹Ù²Ù¾î ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.

    As of October 97, there is a beta version of MD that allows:

    • RAID 1 and 5 reconstruction on spare drives
    • RAID-5 parity reconstruction after an unclean shutdown
    • spare disk to be hot-added to an already running RAID 1 or 4/5 array
    By default, automatic reconstruction is (Dec 97) currently disabled by default, due to the preliminary nature of this work. It can be enabled by changing the value of SUPPORT_RECONSTRUCTION in include/linux/md.h.

    Ä¿³Î ±â¹ÝÀÇ º¹±¸°¡ ¼³Á¤µÇ¾î ÀÖ°í, RAID ½Ã½ºÅÛ¿¡ ¿©ºÐÀÇ µð½ºÅ©( superblockÀº ÀÌ¹Ì mkraid¸¦ ÅëÇØ ¸¸µé¾îÁ³À» °ÍÀÌ´Ù.) ¸¦ Ãß°¡ÇÏ·Á ÇÑ´Ù¸é, Ä¿³ÎÀº ³»¿ëÀ» ÀÚµ¿ÀûÀ¸·Î º¹±¸½ÃÄÑÁÙ °ÍÀÌ´Ù. (ÀϹÝÀûÀÎ mdstop, µð½ºÅ©±³Ã¼, ckraid, mdrun ÀÇ ÀýÂ÷¸¦ ¹âÁö ¾Ê¾Æµµ µÈ´Ù.)

    If spare drives were configured into the array when it was created and kernel-based reconstruction is enabled, the spare drive will already contain a RAID superblock (written by mkraid), and the kernel will reconstruct its contents automatically (without needing the usual mdstop, replace drive, ckraid, mdrun steps).

    ´ç½ÅÀÌ ÀÚµ¿ º¹±¸¸¦ ½ÇÇàÇÏÁö ¾Ê¾Ò°í, ±³Ã¼ÇÒ µð½ºÅ©¸¦ ¼³Á¤ÇÏÁö ¾Ê¾Ò´Ù¸é, Gadi Oxman < gadio@netvision.net.il> °¡ Á¦¾ÈÇÑ ¾Æ·¡¿Í °°Àº ´Ü°è¸¦ µû¸¦ ¼ö ÀÖ´Ù.

    • ÇϳªÀÇ µð½ºÅ©°¡ Á¦°ÅµÇ¾ú´Ù¸é, RAID´Â degraged mode ·Î ¼³Á¤µÇ¾î ÀÛµ¿ÇÒ °ÍÀÌ´Ù. ÀÌ°ÍÀ» full operation mode·Î À嵿½ÃÅ°±â À§Çؼ­´Â ¾Æ·¡¿Í °°Àº ÀýÂ÷°¡ ÇÊ¿äÇÏ´Ù.
      • RAID¸¦ ÁߴܽÃÄѶó. (mdstop /dev/md0)
      • °íÀå³­ µð½ºÅ©¸¦ ±³Ã¼Ç϶ó.
      • ³»¿ëº¹±¸¸¦ À§ÇØ ckraid raid.conf ¸¦ ½ÇÇàÇ϶ó.
      • RAID¸¦ ´Ù½Ã½ÇÇà½ÃÄѶó. (mdadd, mdrun).
      Áß¿äÇÑ Á¡Àº RAID´Â ´Ù½Ã ¸ðµç µå¶óÀ̺꿡¼­ µ¹¾Æ°¥ °ÍÀ̶ó´Â °Í°ú. ÇϳªÀÇ µð½ºÅ©ÀÇ ¹®Á¦°¡ »ý°åÀ» ¶§¸¦ ´ëºñÇÑ °ÍÀ̶ó´Â °ÍÀÌ´Ù.
    ÇöÀçÀÇ ÇϳªÀÇ ±³Ã¼µð½ºÅ©¸¦ ¿©·¯°³ÀÇ RAID¿¡ ¹èºÐÇÏ´Â °ÍÀº ºÒ°¡´ÉÇÏ´Ù. °¢°¢ÀÇ RAID´Â °¢°¢ÀÇ disk¸¦ ÇÊ¿ä·Î ÇÑ´Ù.

    If you are not running automatic reconstruction, and have not configured a hot-spare disk, the procedure described by Gadi Oxman < gadio@netvision.net.il> is recommended:

    • Currently, once the first disk is removed, the RAID set will be running in degraded mode. To restore full operation mode, you need to:
      • stop the array (mdstop /dev/md0)
      • replace the failed drive
      • run ckraid raid.conf to reconstruct its contents
      • run the array again (mdadd, mdrun).
      At this point, the array will be running with all the drives, and again protects against a failure of a single drive.

    Currently, it is not possible to assign single hot-spare disk to several arrays. Each array requires it's own hot-spare.

  10. Q: Ãʺ¸ °ü¸®ÀÚ°¡ ¹®Á¦°¡ »ý°å´Ù´Â °ÍÀ» ¾Ë ¼ö ÀÖµµ·Ï ''¹Ì·¯¸µµÇ°í ÀÖ´Â µð½ºÅ©Áß Çϳª°¡ ¸Á°¡Á³´Ù.¸Ûû¾Æ.'' °°Àº °æ°í¸¦ ¼Ò¸®·Î µéÀ» ¼ö Àֱ⸦ ¿øÇÑ´Ù.
    A: Ä¿³ÎÀº ``KERN_ALERT'' À̺¥Æ®¿¡ ´ëÇؼ­ ¿ì¼±ÀûÀ¸·Î syslog¿¡ ·Î±×¸¦ ³²±â°í ÀÖ´Ù. syslog¸¦ ¸ð´ÏÅ͸µÇÒ ¸î¸î ¼ÒÇÁÆ®¿þ¾îµéÀÌ ÀÖ°í, ±×°ÍµéÀÌ ÀÚµ¿ÀûÀ¸·Î PC speaker·Î beep¸¦ ¿ï¸®°Å³ª, »ß»ß¸¦ È£ÃâÇϰųª. e-mailµîÀ» º¸³¾°ÍÀÌ´Ù.

    The kernel is logging the event with a ``KERN_ALERT'' priority in syslog. There are several software packages that will monitor the syslog files, and beep the PC speaker, call a pager, send e-mail, etc. automatically.

  11. Q: RAID-5¸¦ ¾î¶»°Ô degraded mode·Î »ç¿ëÇÒ ¼ö Àִ°¡? (µð½ºÅ© Çϳª¿¡ ¹®Á¦°¡ »ý°å°í, ¾ÆÁ÷ ±³Ã¼ÇÏÁö ¾Ê¾Ò´Ù.)
    A: Gadi Oxman < gadio@netvision.net.il> ÀÌ Àû±â¸¦... ÀϹÝÀûÀ¸·Î, n °³ÀÇ µå¶óÀ̺ê·Î raid-5 ½Ã½ºÅÛÀ» µ¹¸®·Á¸é ¾Æ·¡¿Í °°ÀÌ ÇÑ´Ù.:
    mdadd /dev/md0 /dev/disk1 ... /dev/disk(n)
    mdrun -p5 /dev/md0
                  
    
    µð½ºÅ©Áß¿¡ Çϳª°¡ ¸Á°¡Áø °æ¿ì¶óµµ ¿©ÀüÈ÷ mdadd¸¦ »ç¿ëÇØ ¼³Á¤ÇØ¾ß ÇÑ´Ù. (?? ¸Á°¡Áø µð½ºÅ© ´ë½Å /dev/nullÀ» »ç¿ëÇؼ­ µµÀüÇضó ??? Á¶½ÉÇضó..) (¿ªÀÚ, µ¡. ÀÌ ¹°À½Ç¥´Â ¹»±î... ÀÌ ¹®¼­ÀÇ ÀúÀÚ´Â ÀÌ ¹®¼­ÀÇ À­ºÎºÐ¿¡¼­ ÀÌ ¹æ¹ýÀº ½ÃµµÇØ º»ÀûÀÌ ¾ø´Ù°í Çß´Ù...-.-) RAID´Â (n-1)°³ÀÇ µå¶óÀ̺긦 »ç¿ëÇÑ degraded mode·Î µ¿ÀÛÇÒ °ÍÀÌ´Ù. ``mdrun''°¡ ½ÇÆÐÇß´Ù¸é, kernelÀº ¿¡·¯¸¦ ³¾ °ÍÀÌ´Ù. ( ¸î°³ÀÇ ¹®Á¦°¡ ÀÖ´Â µð½ºÅ©¶óµçÁö, shutdownÀ» Á¦´ë·Î ¾ÈÇÑ °æ¿ì.) ''dmesg'' ¸í·É¾î¸¦ »ç¿ëÇÏ¿© kernelÀÇ ¿¡·¯¸¦ º¸¾Æ¶ó. raid-5´Â µð½ºÅ©°¡ Çϳª ±úÁö´Â °Íº¸´Ù Àü¿øÀÌ ³ª°¬À» ´õ À§ÇèÇϸç, ¾Æ·¡¿Í °°ÀÌ »õ·Î¿î RAID superblock¸¦ ¸¸µêÀ¸·Î½á º¹±¸¸¦ ½Ãµµ ÇÒ ¼ö ÀÖ´Ù.
    mkraid -f --only-superblock raid5.conf
                
    
    superblockÀÇ º¹±¸´Â ¸ðµç µå¶óÀ̺갡 ''OK'' ·Î Ç¥½ÃµÇ´Â »óÅÂ(¾Æ¹«Àϵµ ÀϾÁö ¾Ê¾Ò´Ù¸é.)¿¡ ¿µÇâÀ» ¹ÞÁö ¾Ê±â ¶§¹®¿¡ °£´ÜÇÒ °ÍÀÌ´Ù.

    Gadi Oxman < gadio@netvision.net.il> writes: Normally, to run a RAID-5 set of n drives you have to:

    mdadd /dev/md0 /dev/disk1 ... /dev/disk(n)
    mdrun -p5 /dev/md0
                  
    
    Even if one of the disks has failed, you still have to mdadd it as you would in a normal setup. (?? try using /dev/null in place of the failed disk ??? watch out) Then,

    The array will be active in degraded mode with (n - 1) drives. If ``mdrun'' fails, the kernel has noticed an error (for example, several faulty drives, or an unclean shutdown). Use ``dmesg'' to display the kernel error messages from ``mdrun''. If the raid-5 set is corrupted due to a power loss, rather than a disk crash, one can try to recover by creating a new RAID superblock:

    mkraid -f --only-superblock raid5.conf
                
    
    A RAID array doesn't provide protection against a power failure or a kernel crash, and can't guarantee correct recovery. Rebuilding the superblock will simply cause the system to ignore the condition by marking all the drives as ``OK'', as if nothing happened.
  12. Q: µð½ºÅ©¿¡ ¹®Á¦°¡ ¹ß»ýÇϸé RAID-5´Â ¾î¶»°Ô µ¿ÀÛÇϳª¿ä?
    A: ¾Æ·¡¿Í °°Àº ÀüÇüÀûÀÎ µ¿ÀÛ ´Ü°è°¡ ÀÖ´Ù.
    • RAID-5 °¡ ÀÛµ¿ÇÑ´Ù.
    • RAID ÀÛµ¿Áß ÇϳªÀÇ µð½ºÅ©¿¡ ¹®Á¦°¡ »ý°å´Ù.
    • µå¶óÀ̺êÀÇ firmware¿Í Àú¼öÁØÀÇ Linux µð½ºÅ© ÄÁÆ®·Ñ·¯ µå¶óÀ̹ö´Â ¿À·ù¸¦ °¨ÁöÇÏ°í MD driver¿¡ º¸°íÇÑ´Ù.
    • MD driver´Â ³ª¸ÓÁö »ç¿ë°¡´ÉÇÑ µå¶óÀ̺êµé·Î, Ä¿³ÎÀÇ »óÀ§·¹º§ ºÎºÐ¿¡ ¿¡·¯¿Í °ü°è¾øÀÌ /dev/md0 ¸¦ Á¦°øÇÒ °ÍÀÌ´Ù. (¼º´ÉÀº ¶³¾îÁø´Ù.)
    • °ü¸®ÀÚ´Â ÀϹÝÀûÀ¸·Î umount /dev/md0 °ú mdstop /dev/md0¸¦ ÇÒ ¼ö ÀÖ´Ù.
    • °íÀå³­ µð½ºÅ©°¡ ±³Ã¼µÇÁö ¾Ê¾Æµµ, °ü¸®ÀÚ´Â mdadd ¿Í mdrun¸¦ ½ÇÇà½ÃÄѼ­. ¿©ÀüÈ÷ degraded mode·Î µ¿ÀÛ½Ãų ¼ö ÀÖÀ» °ÍÀÌ´Ù.

    The typical operating scenario is as follows:

    • A RAID-5 array is active.
    • One drive fails while the array is active.
    • The drive firmware and the low-level Linux disk/controller drivers detect the failure and report an error code to the MD driver.
    • The MD driver continues to provide an error-free /dev/md0 device to the higher levels of the kernel (with a performance degradation) by using the remaining operational drives.
    • The sysadmin can umount /dev/md0 and mdstop /dev/md0 as usual.
    • If the failed drive is not replaced, the sysadmin can still start the array in degraded mode as usual, by running mdadd and mdrun.
  13. Q:
    A:
  14. Q: ¿Ö 13¹ø° Áú¹®Àº ¾ø³ª¿ä?
    A: ´ç½ÅÀÌ, RAID¿Í ³ôÀº ´É·Â°ú UPS¿Í °ü·ÃÀÌ ÀÖ´Â »ç¶÷À̶ó¸é, ±×°ÍµéÀ» ¹Ì½ÅÀûÀ¸·Î ¹Ï´Â °Í ¸¶Àúµµ ÁÁÀº »ý°¢ÀÏ °ÍÀÌ´Ù. ±×°ÍÀº Àý´ë ¸Á°¡ÁöÁö ¾ÊÀ» °ÍÀÌ´Ù. ±×·¸Áö ¾ÊÀº°¡?

    If you are concerned about RAID, High Availability, and UPS, then its probably a good idea to be superstitious as well. It can't hurt, can it?

  15. Q: RAID-5 ½Ã½ºÅÛ¿¡¼­ ÇϳªÀÇ °íÀå³­ µð½ºÅ©¸¦ ±³Ã¼ÇßÀ» »ÓÀε¥.. RAID ¸¦ º¹±¸ÇÑÈÄ fsck °¡ ¸¹Àº error¸¦ º¸¿©ÁÝ´Ï´Ù. ±×°Ô Á¤»óÀΰ¡¿ä?
    A: Á¤»óÀÌ ¾Æ´Ï´Ù. ±×¸®°í fsck¸¦ ¼öÁ¤À» ÇÏÁö ¾Ê´Â °Ë»ç Àü¿ë¸ðµå¿¡¼­ ½ÇÇà½ÃÅ°Áö ¾Ê¾Ò´Ù¸é, µ¥ÀÌÅÍ¿¡ ¹®Á¦°¡ »ý±â´Â °ÍÀÌ ÃæºÐÈ÷ °¡´ÉÇÏ´Ù. ºÒÇàÇÏ°Ôµµ, µð½ºÅ© ±³Ã¼ÈÄ RAID-5ÀÇ disk ¼ø¼­¸¦ ¿ì¿¬È÷ ¹Ù²Ù¾î ¹ö¸®´Â ÈçÇÑ ½Ç¼ö ÁßÀÇ ÇϳªÀÌ´Ù. ºñ·Ï RAID superblockÀÌ ¹Ù¶÷Á÷ÇÑ ¹æ¹ýÀ¸·Î ÀúÀåµÇ±ä ÇÏÁö¸¸, ¸ðµç ÅøµéÀÌ ÀÌ Á¤º¸¸¦ µû¸£´Â °ÍÀº ¾Æ´Ï´Ù. Ưº°È÷, ckraid ÀÇ ÇöÀç ¹öÁ¯Àº -f ¿É¼ÇÀ» »ç¿ëÇؼ­ ÇöÀç superblock¾ÈÀÇ µ¥ÀÌÅÍ ´ë½Å, Á¤º¸¸¦ Àоî¿Àµµ·Ï ÇÒ ¼ö ÀÖ´Ù. (´ëü·Î /etc/raid5.confÆÄÀÏÀ» »ç¿ëÇÑ´Ù.) ÁöÁ¤ÇÑ Á¤º¸°¡ ºÎÁ¤È®Çϸé, ±³Ã¼ÇÑ µð½ºÅ©°¡ ºÎÁ¤È®ÇÏ°Ô º¹±¸µÉ °ÍÀÌ°í. ÀÌ·± Á¾·ùÀÇ ½Ç¼öµéÀÌ ¸¹Àº fsck errorµéÀ» ³»´Â Áõ»óÀ» º¸¿©ÁØ´Ù.

    ±×¸®°í ´ç½ÅÀÌ ½Å±âÇÑ °æ¿ì¿¡(ÀÌ·± ½Ç¼ö·Î ¸ðµç µ¥ÀÌÅ͸¦ ¼Õ½Ç´çÇÏ´Â..) ÇØ´çµÈ´Ù¸é, RAIDÀÇ Àç¼³Á¤Àü¿¡ ¸ðµç µ¥ÀÌÅ͸¦ ¹é¾÷Çϱ⸦ °­·ÂÈ÷ ÃßõÇÑ´Ù.

    No. And, unless you ran fsck in "verify only; do not update" mode, its quite possible that you have corrupted your data. Unfortunately, a not-uncommon scenario is one of accidentally changing the disk order in a RAID-5 array, after replacing a hard drive. Although the RAID superblock stores the proper order, not all tools use this information. In particular, the current version of ckraid will use the information specified with the -f flag (typically, the file /etc/raid5.conf) instead of the data in the superblock. If the specified order is incorrect, then the replaced disk will be reconstructed incorrectly. The symptom of this kind of mistake seems to be heavy & numerous fsck errors.

    And, in case you are wondering, yes, someone lost all of their data by making this mistake. Making a tape backup of all data before reconfiguring a RAID array is strongly recommended.

  16. Q: QuickStart ¿¡¼­ mdstop´Â ´ÜÁö µð½ºÅ©µéÀ» µ¿±âÈ­(sync)½ÃÅ°´Â °Í »ÓÀ̶ó°í Çϴµ¥, ±×°Ô Á¤¸» ÇÊ¿äÇÑ °¡¿ä? ÆÄÀϽýºÅÛÀ» unmountÇÏ´Â °ÍÀ¸·Î ÃæºÐÇÏÁö ¾Ê³ª¿ä?
    A: mdstop /dev/md0 ¸í·ÉÀº.
    • shutdownÀÌ Àß µÇ¾ú¼¹´ÂÁö¸¦ ¹ß°ßÇϱâ À§ÇØ, ''clean''À» Ç¥½ÃÇÑ´Ù.
    • RAID¸¦ µ¿±âÈ­ ½ÃŲ´Ù. ÈÄ¿¡ ÆÄÀϽýºÅÛÀÇ unmountº¸´Ù Áß¿äÇÏÁö ¾ÊÁö¸¸, ÆÄÀϽýºÅÛÀ» ÅëÇÏ´Â °ÍÀÌ ¾Æ´Ñ, /dev/md0À» Á÷Á¢ access Çϱ⠶§¹®¿¡, Áß¿äÇÏ´Ù.

    The command mdstop /dev/md0 will:

    • mark it ''clean''. This allows us to detect unclean shutdowns, for example due to a power failure or a kernel crash.
    • sync the array. This is less important after unmounting a filesystem, but is important if the /dev/md0 is accessed directly rather than through a filesystem (for example, by e2fsck).

´ÙÀ½ ÀÌÀü Â÷·Ê