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

7. ÀÌ¹Ì ¼³Ä¡µÈ ½Ã½ºÅÛ ¼öÁ¤Çϱâ.

  1. Q: ¼±Çü RAID°¡ È®Àå°¡´ÉÇÑ°¡? µð½ºÅ©¸¦ Ãß°¡Çؼ­ Á¸ÀçÇÏ´Â ÆÄÀÏ ½Ã½ºÅÛÀÇ Å©±â¸¦ ´Ã¸± ¼ö Àִ°¡?

    Are linear MD's expandable? Can a new hard-drive/partition be added, and the size of the existing file system expanded?

    A: Miguel de Icaza < miguel@luthien.nuclecu.unam.mx> ´Â ¾Æ·¡¿Í °°ÀÌ ¸»Çß´Ù.
    ³ª´Â ÆÄÀÏ ½Ã½ºÅÛ ´ç ÇϳªÀÇ µð½ºÅ©´ë½Å ¿©·¯°³ÀÇ µð½ºÅ©¸¦ »ç¿ëÇÒ °æ¿ì¸¦ ´ëºñÇؼ­ ext2fsÀÇ ¼Ò½ºÄڵ带 °íÃÆ´Ù. ±×·¡¼­, ÆÄÀÏ ½Ã½ºÅÛÀ» ´Ã¸®°íÀÚ ÇÑ´Ù¸é, À¯Æ¿¸®Æ¼·Î »õµð½ºÅ©¸¦ Àû´çÈ÷ ¼³Á¤ÈÄ ´Ù¸¸, ½Ã½ºÅÛ¿¡ ¾Ë¸®±â¸¸ ÇϸéµÈ´Ù. ½Ã½ºÅÛÀÌ ÀÛµ¿Áß¿¡ °ð¹Ù·Î Ãß°¡°¡ °¡´ÉÇÏ°í, ÀçºÎÆÃÇÒ ÇÊ¿ä´Â ¾ø´Ù. ¾Æ·¡ÀÇ È¨ÆäÀÌÁö¿¡¼­, 2.1.x¹öÁ¯´ëÀÇ Ä¿³ÎÆÐÄ¡¸¦ ¹Þ¾Æ¶ó.
    http://www.nuclecu.unam.mx/~miguel/ext2-volume

    Miguel de Icaza < miguel@luthien.nuclecu.unam.mx> writes:

    I changed the ext2fs code to be aware of multiple-devices instead of the regular one device per file system assumption.

    So, when you want to extend a file system, you run a utility program that makes the appropriate changes on the new device (your extra partition) and then you just tell the system to extend the fs using the specified device.

    You can extend a file system with new devices at system operation time, no need to bring the system down (and whenever I get some extra time, you will be able to remove devices from the ext2 volume set, again without even having to go to single-user mode or any hack like that).

    You can get the patch for 2.1.x kernel from my web page:

    http://www.nuclecu.unam.mx/~miguel/ext2-volume

  2. Q: RAID-5 ½Ã½ºÅÛ¿¡ µð½ºÅ©¸¦ Ãß°¡ÇÒ ¼ö Àִ°¡?
    A: ÇöÀç, ¸ðµç µ¥ÀÌÅ͸¦ Áö¿ìÁö ¾Ê°í´Â ºÒ°¡´ÉÇÏ´Ù. ÄÁ¹öÁ¯ÇÏ´Â µµ±¸´Â ¾ÆÁ÷ ¾øÀ¸¸ç, RAID-5ÀÇ ½ÇÁ¦Àû ±¸Á¶´Â, diskÀÇ ¼ö¿¡ ÀÇÁ¸Çϱ⠶§¹®ÀÌ´Ù. ¹°·Ð, ¸ðµç µ¥ÀÌÅ͸¦ ¹é¾÷ÇÑÈÄ, ½Ã½ºÅÛÀ» ´Ù½Ã ±¸ÃàÇÏ¸é °¡´ÉÇÏ´Ù.

    Currently, (September 1997) no, not without erasing all data. A conversion utility to allow this does not yet exist. The problem is that the actual structure and layout of a RAID-5 array depends on the number of disks in the array.

    Of course, one can add drives by backing up the array to tape, deleting all data, creating a new array, and restoring from tape.

  3. Q: RAID1/RAID0 À¸·Î »ç¿ëÇÏ°í ÀÖ´Â /dev/hdb ¸¦ /dev/hdc·Î À̵¿½ÃÅ°·Á ÇÕ´Ï´Ù. ¸¸¾à, /etc/mdtab °ú /etc/raid1.confÀÇ ¼³Á¤¸¸ ¹Ù²Û´Ù°í ÇÑ´Ù¸é, ¾î¶² ÀÏÀÌ ÀϾ±î¿ä?

    What would happen to my RAID1/RAID0 sets if I shift one of the drives from being /dev/hdb to /dev/hdc?

    Because of cabling/case size/stupidity issues, I had to make my RAID sets on the same IDE controller (/dev/hda and /dev/hdb). Now that I've fixed some stuff, I want to move /dev/hdb to /dev/hdc.

    What would happen if I just change the /etc/mdtab and /etc/raid1.conf files to reflect the new location?

    A: linear ¿Í RAID-0¿¡¼­´Â Á¤È®È÷ °°Àº ¸í·ÉÀ¸·Î µå¶óÀ̺긦 ÁöÁ¤ÇØ¾ß ÇÑ´Ù. ¿¹¸¦ µé¸é ¿ø·¡ ¼³Á¤ÀÌ, ¾Æ·¡¿Í °°´Ù¸é,
    mdadd /dev/md0 /dev/hda /dev/hdb
                
    
    »õ·Î¿î ¼³Á¤Àº ¹Ýµå½Ã ¾Æ·¡¿Í °°¾Æ¾ß ÇÒ °ÍÀÌ´Ù.
    mdadd /dev/md0 /dev/hda /dev/hdc
                
    
    RAID-1/4/5¿¡¼­´Â superblock¿¡ ''RAID number''°¡ ÀúÀåµÇ¾î Àֱ⠶§¹®¿¡, ¾î¶² µð½ºÅ©¸¦ ÁöÁ¤Çϴ°¡´Â º°·Î Áß¿äÇÏÁö ¾Ê´Ù.

    For RAID-0/linear, one must be careful to specify the drives in exactly the same order. Thus, in the above example, if the original config is

    mdadd /dev/md0 /dev/hda /dev/hdb
                
    
    Then the new config *must* be
    mdadd /dev/md0 /dev/hda /dev/hdc
                
    

    For RAID-1/4/5, the drive's ''RAID number'' is stored in its RAID superblock, and therefore the order in which the disks are specified is not important.

    RAID-0/linear does not have a superblock due to it's older design, and the desire to maintain backwards compatibility with this older design.

  4. Q: µð½ºÅ© µÎ°³¸¦ »ç¿ëÇÏ´Â RAID-1 ½Ã½ºÅÛÀ» ¼¼°³ÀÇ µð½ºÅ©¸¦ »ç¿ëÇÏ´Â RAID-5 ½Ã½ºÅÛÀ¸·Î ¹Ù²Ü¼ö Àִ°¡?
    A: ÇÒ¼ö ÀÖ´Ù. BizSystems ÀÇ MichaelÀº ÀÌ°É ½±°Ô ÇÏ´Â ¹æ¹ýÀ» ¸¸µé¾î³Â´Ù. ±×·¯³ª, ½Ç¼ö·Î ÀÎÇØ µ¥ÀÌÅ͸¦ ³¯¸± ¼ö ÀÖÀ¸¹Ç·Î, ÇÊÈ÷ ¹é¾÷Çسõ±â¸¦ ¹Ù¶õ´Ù.

    Yes. Michael at BizSystems has come up with a clever, sneaky way of doing this. However, like virtually all manipulations of RAID arrays once they have data on them, it is dangerous and prone to human error. Make a backup before you start.

    
    I will make the following assumptions:
    ---------------------------------------------
    disks 
    original: hda - hdc
    raid1 partitions hda3 - hdc3
    array name /dev/md0
    
    new hda - hdc - hdd
    raid5 partitions hda3 - hdc3 - hdd3
    array name: /dev/md1
    
    You must substitute the appropriate disk and partition numbers for 
    you system configuration. This will hold true for all config file 
    examples.
    --------------------------------------------
    DO A BACKUP BEFORE YOU DO ANYTHING
    1) recompile kernel to include both raid1 and raid5
    2) install new kernel and verify that raid personalities are present
    3) disable the redundant partition on the raid 1 array. If this is a
     root mounted partition (mine was) you must be more careful.
    
     Reboot the kernel without starting raid devices or boot from rescue 
     system ( raid tools must be available )
    
     start non-redundant raid1
    mdadd -r -p1 /dev/md0 /dev/hda3
    
    4) configure raid5 but with 'funny' config file, note that there is 
      no hda3 entry and hdc3 is repeated. This is needed since the
      raid tools don't want you to do this.
    -------------------------------
    # raid-5 configuration
    raiddev                 /dev/md1
    raid-level              5
    nr-raid-disks           3
    chunk-size              32
    
    # Parity placement algorithm
    parity-algorithm        left-symmetric
    
    # Spare disks for hot reconstruction
    nr-spare-disks          0
    
    device                  /dev/hdc3
    raid-disk               0
    
    device                  /dev/hdc3
    raid-disk               1
    
    device                  /dev/hdd3
    raid-disk               2
    ---------------------------------------
     mkraid /etc/raid5.conf
    5) activate the raid5 array in non-redundant mode
    
    mdadd -r -p5 -c32k /dev/md1 /dev/hdc3 /dev/hdd3
    
    6) make a file system on the array
    
    mke2fs -b {blocksize} /dev/md1
    
    recommended blocksize by some is 4096 rather than the default 1024.
    this improves the memory utilization for the kernel raid routines and 
    matches the blocksize to the page size. I compromised and used 2048 
    since I have a relatively high number of small files on my system.
    
    7) mount the two raid devices somewhere
    
    mount -t ext2 /dev/md0 mnt0
    mount -t ext2 /dev/md1 mnt1
    
    8) move the data
    
    cp -a mnt0 mnt1
    
    9) verify that the data sets are identical
    10) stop both arrays
    11) correct the information for the raid5.conf file
      change /dev/md1 to /dev/md0
      change the first disk to read /dev/hda3
    
    12) upgrade the new array to full redundant status
     (THIS DESTROYS REMAINING raid1 INFORMATION)
    
    ckraid --fix /etc/raid5.conf
    
                
    


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