다음 이전 차례

3. 설치와 설정

  1. Q: Software RAID 를 어떻게 설치해야 가장 좋을 까요?
    A: 나는 파일 시스템 계획이 좀 더 어려운 유닉스 설정작업인 것을 깨닫 도록 남겨둔다. 질문에 대한 대답으로, 우리가 한 일을 설명하겠다. 우리는 각각 2.1 기가의 EIDE 디스크를 아래와 같이 설정할 계획을 세웠다.

    I keep rediscovering that file-system planning is one of the more difficult Unix configuration tasks. To answer your question, I can describe what we did.

    We planned the following setup:

    • two EIDE disks, 2.1.gig each.
      disk partition mount pt.  size    device
        1      1       /        300M   /dev/hda1
        1      2       swap      64M   /dev/hda2
        1      3       /home    800M   /dev/hda3
        1      4       /var     900M   /dev/hda4
      
        2      1       /root    300M   /dev/hdc1
        2      2       swap      64M   /dev/hdc2
        2      3       /home    800M   /dev/hdc3
        2      4       /var     900M   /dev/hdc4
                          
      
    • 각 디스크는 모두 분리된 컨트롤러와 리본 케이블 상에 있다. 이것은 하나의 컨트롤러나 케이블이 고장 났을 때, 디스크들이 같이 사용 불가능하게 되는 것을 막아준다.

      Each disk is on a separate controller (& ribbon cable). The theory is that a controller failure and/or ribbon failure won't disable both disks. Also, we might possibly get a performance boost from parallel operations over two controllers/cables.

    • 루트 파티션 (/ /dev/hda1 )에 리눅스 커널을 설치할 것이다. 이 파티션을 bootable로 설정해라.

      Install the Linux kernel on the root (/) partition /dev/hda1. Mark this partition as bootable.

    • /dev/hac1은 /dev/hda1 의 RAID 복사본이 아닌 단순 복사본이다. 이것으로, 첫번째 디스크가 오류났을 때 rescue 디스크를 사용해 이 파티션을 bootable 설정하여 시스템을 다시 인스톨하지 않고 사용할 수 있다.

      /dev/hdc1 will contain a ``cold'' copy of /dev/hda1. This is NOT a raid copy, just a plain old copy-copy. It's there just in case the first disk fails; we can use a rescue disk, mark /dev/hdc1 as bootable, and use that to keep going without having to reinstall the system. You may even want to put /dev/hdc1's copy of the kernel into LILO to simplify booting in case of failure.

      이것은 심각한 문제 발생시, raid superblock-corruption 이나 다른 이해할수 없는 문제에 대한 걱정없이 시스템을 부팅할 수 있게 해준다.

      The theory here is that in case of severe failure, I can still boot the system without worrying about raid superblock-corruption or other raid failure modes & gotchas that I don't understand.

    • /dev/hda3/dev/hdc3 는 미러링을 통해 /dev/md0 가 될것이다.

      /dev/hda3 and /dev/hdc3 will be mirrors /dev/md0.

    • /dev/hda4/dev/hdc4 는 미러링을 통해 /dev/md1 가 될것이다.

      /dev/hda4 and /dev/hdc4 will be mirrors /dev/md1.

    • 우리는 아래와 같은 이유로 파티션을 나누고, /var/home 파티션을 미러링하기로 결정하였다.

      we picked /var and /home to be mirrored, and in separate partitions, using the following logic:

      • / (루트 파티션)의 데이터들은 상대적으로 잘 변하지 않는다.

        / (the root partition) will contain relatively static, non-changing data: for all practical purposes, it will be read-only without actually being marked & mounted read-only.

      • /home 파티션은 ''천천히'' 변하는 데이터를 가지고 있다.

        /home will contain ''slowly'' changing data.

      • /var> 는 메일 spool , 데이터베이스 내용, 웹 서버의 log 와 같은 급속히 변하는 데이터를 포함하고 있다.

        /var will contain rapidly changing data, including mail spools, database contents and web server logs.

      이렇게 여러개의 다른 파티션을 나누는 것은, 인간의 실수, 전원, 혹은 os의 문제등이 일어났을 때, 그것이 미치는 영향이 하나의 파티션에만 한정되기 때문이다.

      The idea behind using multiple, distinct partitions is that if, for some bizarre reason, whether it is human error, power loss, or an operating system gone wild, corruption is limited to one partition. In one typical case, power is lost while the system is writing to disk. This will almost certainly lead to a corrupted filesystem, which will be repaired by fsck during the next boot. Although fsck does it's best to make the repairs without creating additional damage during those repairs, it can be comforting to know that any such damage has been limited to one partition. In another typical case, the sysadmin makes a mistake during rescue operations, leading to erased or destroyed data. Partitions can help limit the repercussions of the operator's errors.

    • /usr/opt 파티션을 선택하여도 괜찮았을 것이다. 사실, 하드가 좀더 있었다면, /opt/home 파티션을 RAID-5 로 설정하는 것이 더 좋았을 것이다. 주의할 점은 /usr 파티션을 RAID-5로 설정하지 말라는 것이다. 심각한 문제가 일어났을 경우 /usr 파티션에 마운트 할수 없게 될 것이고, /usr 파티션안의 네트워크 툴과 컴파일러 같은 것들을 필요로 하게 될 것이다. RAID-1을 사용한다면, 이런 에러가 났을때, RAID는 사용할수 없어도 두개의 미러링된 것중 하나에는 마운트가 가능하다.

      Other reasonable choices for partitions might be /usr or /opt. In fact, /opt and /home make great choices for RAID-5 partitions, if we had more disks. A word of caution: DO NOT put /usr in a RAID-5 partition. If a serious fault occurs, you may find that you cannot mount /usr, and that you want some of the tools on it (e.g. the networking tools, or the compiler.) With RAID-1, if a fault has occurred, and you can't get RAID to work, you can at least mount one of the two mirrors. You can't do this with any of the other RAID levels (RAID-5, striping, or linear append).

    그래서 질문에 대한 완성된 답은:

    • 첫번째 디스크의 첫번째 파티션에 운영체제를 설치하고 다른 파티션들은 마운트하지 말아라.

      install the OS on disk 1, partition 1. do NOT mount any of the other partitions.

    • 명령단위로 RAID를 설치하라.

      install RAID per instructions.

    • md0md1. 설정하라.

      configure md0 and md1.

    • 디스크 오류가 일어났을 때 무엇을 해야 하는 지 준비해라. 관리자가 지금 실수하는지 찾아보고, 타격을 입게 놔두지 마라. 그리고 경험을 쌓아라. (우리는 디스크가 작동하고 있는 동안, 전원을 꺼보았다. 이것은 멍청해보이지만, 정보를 얻을 수 있다.)

      convince yourself that you know what to do in case of a disk failure! Discover sysadmin mistakes now, and not during an actual crisis. Experiment! (we turned off power during disk activity — this proved to be ugly but informative).

    • /var/dev/md1으로 옮기는 중, 어느 정도 잘못된 mount/copy/unmount/rename/reboot 을 해보라. 조심히만 한다면, 위험하지는 않을 것이다.

      do some ugly mount/copy/unmount/rename/reboot scheme to move /var over to the /dev/md1. Done carefully, this is not dangerous.

    • 그리고, 그것들을 즐겨라.
  2. Q: mdadd, mdrun 등의 명령과 raidadd, raidrun 명령의 다른 점이 뭔가요?
    A: raidtools 패키지의 0.5 버젼부터 이름이 바뀌었다. md로 이름이 붙는 것은 0.43 이전버젼이고 raid로 이름이 붙는 것은 0.5 버젼과 더 새버젼들이다..

    The names of the tools have changed as of the 0.5 release of the raidtools package. The md naming convention was used in the 0.43 and older versions, while raid is used in 0.5 and newer versions.

  3. Q: 가지고 있는 2.0.34 커널에서 RAID-linear 와 RAID-0 를 사용하고 싶다. RAID-linear 와 RAID-0 을 위해서 패치가 필요하지 않기 때문에. raid 패치는 하고 싶지 않다. 어디에 가면, 이것들을 위한 raid-tool 을 구할수 있나?
    A: 과겨한 질문이다. 사실, 최신의 raid tool들은 컴파일 하기 위해 RAID-1,4,5 커널 패치를 필요로 한다. 현재 raid tool의 컴파일된 바이너리 버젼찾지 못했다. 하지만, 2.1.100 커널에서 컴파일된 바이너리가 2.0.34 커널에서 RAID-0/linear 파티션을 만드는 것을 잘 수행하는 것을 보았다. 그래서, 나는 http://linas.org/linux/Software-RAID/ 에 mdadd,mdcreate등의 바이너리를 임시적으로 올린다.

    This is a tough question, indeed, as the newest raid tools package needs to have the RAID-1,4,5 kernel patches installed in order to compile. I am not aware of any pre-compiled, binary version of the raid tools that is available at this time. However, experiments show that the raid-tools binaries, when compiled against kernel 2.1.100, seem to work just fine in creating a RAID-0/linear partition under 2.0.34. A brave soul has asked for these, and I've temporarily placed the binaries mdadd, mdcreate, etc. at http://linas.org/linux/Software-RAID/ You must get the man pages, etc. from the usual raid-tools package.

  4. Q: 루트 파티션에 RAID를 적용할 수 있는가? 왜 md 디스크로 직접 부팅할 수 없는가?
    A: LILO와 Loadlin 모두 RAID 파티션에서 커널이미지를 읽어올 수 없다. 루트 파티션에 RAID를 적용하고 싶다면, 커널을 저장할 RAID가 아닌 파티션을 만들어야 할것이다. (일반적으로 이 파티션의 이름은 /boot이다.) < HarryH@Royal.Net> 로부터 받은 initial ramdisk (initrd) 또는, 패치는 RAID 디스크를 root 디바이스로 사용가능하게 해 줄것이다. (이 패치는 최근 2.1.x커널에는 기본적으로 채택되어있다.)

    Both LILO and Loadlin need an non-stripped/mirrored partition to read the kernel image from. If you want to strip/mirror the root partition (/), then you'll want to create an unstriped/mirrored partition to hold the kernel(s). Typically, this partition is named /boot. Then you either use the initial ramdisk support (initrd), or patches from Harald Hoyer < HarryH@Royal.Net> that allow a stripped partition to be used as the root device. (These patches are now a standard part of recent 2.1.x kernels)

    거기에는 사용할 수 있는 몇가지 방법이 있는데, 하나는 Bootable RAID mini-HOWTO: ftp://ftp.bizsystems.com/pub/raid/bootable-raid에 자세히 설명되어 있다.

    There are several approaches that can be used. One approach is documented in detail in the Bootable RAID mini-HOWTO: ftp://ftp.bizsystems.com/pub/raid/bootable-raid.

    또는, 아래처럼 mkinitrd 를 사용해 ramdisk image를 만들수도 있다.

    Alternately, use mkinitrd to build the ramdisk image, see below.

    Edward Welbon < welbon@bga.com> writes:

    • ... all that is needed is a script to manage the boot setup. To mount an md filesystem as root, the main thing is to build an initial file system image that has the needed modules and md tools to start md. I have a simple script that does this.
    • For boot media, I have a small cheap SCSI disk (170MB I got it used for $20). This disk runs on a AHA1452, but it could just as well be an inexpensive IDE disk on the native IDE. The disk need not be very fast since it is mainly for boot.
    • This disk has a small file system which contains the kernel and the file system image for initrd. The initial file system image has just enough stuff to allow me to load the raid SCSI device driver module and start the raid partition that will become root. I then do an
      echo 0x900 > /proc/sys/kernel/real-root-dev
                    
      
      (0x900 is for /dev/md0) and exit linuxrc. The boot proceeds normally from there.
    • I have built most support as a module except for the AHA1452 driver that brings in the initrd filesystem. So I have a fairly small kernel. The method is perfectly reliable, I have been doing this since before 2.1.26 and have never had a problem that I could not easily recover from. The file systems even survived several 2.1.4[45] hard crashes with no real problems.
    • At one time I had partitioned the raid disks so that the initial cylinders of the first raid disk held the kernel and the initial cylinders of the second raid disk hold the initial file system image, instead I made the initial cylinders of the raid disks swap since they are the fastest cylinders (why waste them on boot?).
    • The nice thing about having an inexpensive device dedicated to boot is that it is easy to boot from and can also serve as a rescue disk if necessary. If you are interested, you can take a look at the script that builds my initial ram disk image and then runs LILO.
      http://www.realtime.net/~welbon/initrd.md.tar.gz
      It is current enough to show the picture. It isn't especially pretty and it could certainly build a much smaller filesystem image for the initial ram disk. It would be easy to a make it more efficient. But it uses LILO as is. If you make any improvements, please forward a copy to me. 8-)
  5. Q: striping 위에 미러링이 가능하다고 들었는데, 사실인가? loopback 장치로 미러링할 수 있는가?
    A: 그렇다. 하지만, 그 반대로는 안된다.

    Yes, but not the reverse. That is, you can put a stripe over several disks, and then build a mirror on top of this. However, striping cannot be put on top of mirroring.

    간단히 기술적인 설명을 덧붙이자면, linear 와 stripe는 자체적으로 ll_rw_blk 루틴을 사용하는 데 이것은 block 를 사용하지 않고 디스크 device와 sector를 사용해 정식적으로, 그리고 저수준의 access를 한다, 때문에, 다른 미러링위에 위치시킬수 없다.

    A brief technical explanation is that the linear and stripe personalities use the ll_rw_blk routine for access. The ll_rw_blk routine maps disk devices and sectors, not blocks. Block devices can be layered one on top of the other; but devices that do raw, low-level disk accesses, such as ll_rw_blk, cannot.

    현재 (1997년 11월) RAID는 loopback device를 지원하지 않지만, 곧 지원할 것이다.

    Currently (November 1997) RAID cannot be run over the loopback devices, although this should be fixed shortly.

  6. Q: 두개의 작은 디스크와 세개의 큰 디스크를 가지고 있을때, 작은 디스크 두개를 RAID-0으로 묶은 후, 나머지 디스크들과, RAID-5를 만들수 있는가?
    A: 1997년 11월 현재, RAID-5로 묶을 수는 없다. 묶여진 디스크들로는 RAID-1(미러링)만 가능하다.

    Currently (November 1997), for a RAID-5 array, no. Currently, one can do this only for a RAID-1 on top of the concatenated drives.

  7. Q: 두개의 디스크로 RAID-1 을 설정하는 것과, RAID-5를 설정하는 것이 어떻게 다른가?
    A: 데이터의 저장율에는 차이가 없다. 디스크를 더 붙힌다고 저장율이 늘어가는 것도 아니다.

    There is no difference in storage capacity. Nor can disks be added to either array to increase capacity (see the question below for details).

    RAID-1 은 각 드라이브에서 두 섹터를 동시에 읽는 분산 기술을 사용하기 때문에 두배의 읽기 성능을 보여준다.

    RAID-1 offers a performance advantage for reads: the RAID-1 driver uses distributed-read technology to simultaneously read two sectors, one from each drive, thus doubling read performance.

    RAID-5는 많은 것들을 포함하지만, 1997년 9월 현재 까지는, 데이터 디스크가 parity 디스크로 실제적으로 미러링되지는 않는다. 때문에 데이터를 병렬로 읽지는 않는다.

    The RAID-5 driver, although it contains many optimizations, does not currently (September 1997) realize that the parity disk is actually a mirrored copy of the data disk. Thus, it serializes data reads.

  8. Q: 두개의 디스크가 망가졌을때에는 어떻게 대비하죠?
    A: 몇몇의 RAID 는 알고리즘은 여러개의 디스크가 망가졌을 때를 대비할 수 있다. 하지만, 현재 리눅스에서 지원되지는 않는다. 그러나, RAID위에 RAID를 구축함으로써, Linux Software RAID로도, 그런 상황에 대비할 수 있다. 예를 들면,9개의 디스크로 3개의 RAID-5를 만들고 다시 그것을 하나의 RAID-5 로 만드는 것이다. 이런 설정은 3개의 디스크가 망가졌을때까지 대비할 수 있지만, 많은 공간이 ''낭비''된다는 것을 주목하라.

    Some of the RAID algorithms do guard against multiple disk failures, but these are not currently implemented for Linux. However, the Linux Software RAID can guard against multiple disk failures by layering an array on top of an array. For example, nine disks can be used to create three raid-5 arrays. Then these three arrays can in turn be hooked together into a single RAID-5 array on top. In fact, this kind of a configuration will guard against a three-disk failure. Note that a large amount of disk space is ''wasted'' on the redundancy information.

        For an NxN raid-5 array,
        N=3, 5 out of 9 disks are used for parity (=55%)
        N=4, 7 out of 16 disks
        N=5, 9 out of 25 disks
        ...
        N=9, 17 out of 81 disks (=~20%)
                
    
    일반적으로, MxN 개로 만들어진 RAID를 위해 M+N-1 개의 디스크가 parity 로 사용되고, M = N 일때 버려지는 양이 최소가 될 것이다.

    In general, an MxN array will use M+N-1 disks for parity. The least amount of space is "wasted" when M=N.

    다른 방법은 세개의 디스크(RAID-5로 설정된)로 RAID-1을 만드는 것이다. 그것은, 세개의 디스크중 같은 데이터를 가지는 2/3을 낭비하게 될 것이다.

    Another alternative is to create a RAID-1 array with three disks. Note that since all three disks contain identical data, that 2/3's of the space is ''wasted''.

  9. Q: 파티션이 제대로 unmount 되지 않았을 때 fsck가 실행되어서 파일시스템을 스스로 고치는 것이 어떻게 가능한지 알고 싶다. RAID 시스템을 ckraid --fix 로 고칠수 있는데 왜 그것을 자동으로 하지 않는가?

    I'd like to understand how it'd be possible to have something like fsck: if the partition hasn't been cleanly unmounted, fsck runs and fixes the filesystem by itself more than 90% of the time. Since the machine is capable of fixing it by itself with ckraid --fix, why not make it automatic?

    A: /etc/rc.d/rc.sysinit 에 아래와 같이 추가함으로써 할수 있다.

    This can be done by adding lines like the following to /etc/rc.d/rc.sysinit:

        mdadd /dev/md0 /dev/hda1 /dev/hdc1 || {
            ckraid --fix /etc/raid.usr.conf
            mdadd /dev/md0 /dev/hda1 /dev/hdc1
        }
                
    
    or
        mdrun -p1 /dev/md0
        if [ $? -gt 0 ] ; then
                ckraid --fix /etc/raid1.conf
                mdrun -p1 /dev/md0
        fi
                
    
    좀더 완벽한 스크립트를 만들기 이전에 시스템이 어떻게 켜지는지 보도록 하자.

    Before presenting a more complete and reliable script, lets review the theory of operation.

    정상적으로 종료되지 않았다면, 리눅스는 아래와 같은 상태중의 하나일 꺼라고 Gadi Oxman은 말했다.

    Gadi Oxman writes: In an unclean shutdown, Linux might be in one of the following states:

    RAID-1을 사용한다면, 위의 첫번째 경우에서, 어느정도만 미러링됐을 경우가 생긴다. 이런 경우, 다음 부팅때, 미러링된 데이터가 서로 같지 않을 것이다.

    이런경우에 미러링이 다른걸 무시한다면, 읽기시 미러링된 것중 하나를 선택할 것이고, 모순된 결과를 출력할 것이다.

    Suppose we were using a RAID-1 array. In (2a), it might happen that before the crash, a small number of data blocks were successfully written only to some of the mirrors, so that on the next reboot, the mirrors will no longer contain the same data.

    If we were to ignore the mirror differences, the raidtools-0.36.3 read-balancing code might choose to read the above data blocks from any of the mirrors, which will result in inconsistent behavior (for example, the output of e2fsck -n /dev/md0 can differ from run to run).

    RAID 는 비정상적인 shutdown을 위해 설계된 것이 아니고, 일반적으로 미러링된 데이터가 다를 때나, 파일시스템이 고장났을 때의 완벽한 해결책도 없다.

    Since RAID doesn't protect against unclean shutdowns, usually there isn't any ''obviously correct'' way to fix the mirror differences and the filesystem corruption.

    For example, by default ckraid --fix will choose the first operational mirror and update the other mirrors with its contents. However, depending on the exact timing at the crash, the data on another mirror might be more recent, and we might want to use it as the source mirror instead, or perhaps use another method for recovery.

    아래의 스크립트를 rc.raid.init 에 추가하고, 그 디렉토리에 path를 걸어라. 그것은 좀더 안전한 부팅을 지원할 것이고, 특히, 일치하지 않는 디스크나, 콘트롤러, 콘트롤러 드라이버등이 있으면, 질고 반복적으로 chraid를 실행할 것이다. rc.raid.initfsck로 루트파티션이 체크되고 Read Write 마운트 된 상태에서 작동할 것이다.

    The following script provides one of the more robust boot-up sequences. In particular, it guards against long, repeated ckraid's in the presence of uncooperative disks, controllers, or controller device drivers. Modify it to reflect your config, and copy it to rc.raid.init. Then invoke rc.raid.init after the root partition has been fsck'ed and mounted rw, but before the remaining partitions are fsck'ed. Make sure the current directory is in the search path.

        mdadd /dev/md0 /dev/hda1 /dev/hdc1 || {
            rm -f /fastboot             # force an fsck to occur  
            ckraid --fix /etc/raid.usr.conf
            mdadd /dev/md0 /dev/hda1 /dev/hdc1
        }
        # if a crash occurs later in the boot process,
        # we at least want to leave this md in a clean state.
        /sbin/mdstop /dev/md0
    
        mdadd /dev/md1 /dev/hda2 /dev/hdc2 || {
            rm -f /fastboot             # force an fsck to occur  
            ckraid --fix /etc/raid.home.conf
            mdadd /dev/md1 /dev/hda2 /dev/hdc2
        }
        # if a crash occurs later in the boot process,
        # we at least want to leave this md in a clean state.
        /sbin/mdstop /dev/md1
    
        mdadd /dev/md0 /dev/hda1 /dev/hdc1
        mdrun -p1 /dev/md0
        if [ $? -gt 0 ] ; then
            rm -f /fastboot             # force an fsck to occur  
            ckraid --fix /etc/raid.usr.conf
            mdrun -p1 /dev/md0
        fi
        # if a crash occurs later in the boot process,
        # we at least want to leave this md in a clean state.
        /sbin/mdstop /dev/md0
    
        mdadd /dev/md1 /dev/hda2 /dev/hdc2
        mdrun -p1 /dev/md1
        if [ $? -gt 0 ] ; then
            rm -f /fastboot             # force an fsck to occur  
            ckraid --fix /etc/raid.home.conf
            mdrun -p1 /dev/md1
        fi
        # if a crash occurs later in the boot process,
        # we at least want to leave this md in a clean state.
        /sbin/mdstop /dev/md1
    
        # OK, just blast through the md commands now.  If there were
        # errors, the above checks should have fixed things up.
        /sbin/mdadd /dev/md0 /dev/hda1 /dev/hdc1
        /sbin/mdrun -p1 /dev/md0
        
        /sbin/mdadd /dev/md12 /dev/hda2 /dev/hdc2
        /sbin/mdrun -p1 /dev/md1
    
                
    
    아래와 같이 rc.raid.halt를 추가하고 싶다면 추가하라.

    In addition to the above, you'll want to create a rc.raid.halt which should look like the following:

        /sbin/mdstop /dev/md0
        /sbin/mdstop /dev/md1
                
    
    rc.sysinitinit.d/halt 스크립ㅌ중 시스템의 halt/roboot를 위한 모든 unmount 전에 위 파일을 첨부시켜라. ( rc.sysinit에는 fsck가 실패했을때, 디스크를 unmount 하고 reboot 하는 루틴이 있다.)

    Be sure to modify both rc.sysinit and init.d/halt to include this everywhere that filesystems get unmounted before a halt/reboot. (Note that rc.sysinit unmounts and reboots if fsck returned with an error.)

  10. Q: 현재 가진 하나의 디스크로 반쪽짜리 RAID-1을 구성후, 나중에 디스크를 추가할수 있나요?
    A: 현재의 도구들로는 불가능하고, 어떤 쉬운 방법도 없다. 특히, 디스크의 내용을 단지 복사함으로써, 미러링은 이루어지지 않는다. RAID 드라이버는 피티션끝의 작은 공간을 superblock로 사용하기 때문이다. 이것은 작은 공간만을 차지하지만, 이미 존재하는 파일 시스테에 단순히 복사하려 할경우, superblock은 파일 시스템을 덮어씌울 것이고, 데이터를 엉망으로 만들것이다. ext2fs 파일시스템은 파일들이 조각나는 것을 막기위해, 파일들을 무작위로 배치시켜왔기 때문에, 디스크를 모두 사용하기 전에, 파티션의 끝부분이 충분히 사용될 수 있다.

    With the current tools, no, not in any easy way. In particular, you cannot just copy the contents of one disk onto another, and then pair them up. This is because the RAID drivers use glob of space at the end of the partition to store the superblock. This decreases the amount of space available to the file system slightly; if you just naively try to force a RAID-1 arrangement onto a partition with an existing filesystem, the raid superblock will overwrite a portion of the file system and mangle data. Since the ext2fs filesystem scatters files randomly throughput the partition (in order to avoid fragmentation), there is a very good chance that some file will land at the very end of a partition long before the disk is full.

    당신이 유능하다면, superblock이 어느정도의 공간을 차지하는지 계산해서, 파일시스템을 조금 작게 만들것을 제안한다. 그리고, 디스크를 추가할때, RAID 툴을 당신에 맞게 고쳐서 사용해야 할것이다. (그 툴들이 끔찍하게 복잡하지는 않다.)

    If you are clever, I suppose you can calculate how much room the RAID superblock will need, and make your filesystem slightly smaller, leaving room for it when you add it later. But then, if you are this clever, you should also be able to modify the tools to do this automatically for you. (The tools are not terribly complex).

    주의깊게 읽은 사람이라면, 아래와 같은 것이 작동할것이라고 지적했을 것이다. 나는 이것을 시도해보거나 증명해보지는 못했다. /dev/null을 하나의 기기로써 mkraid에 이용하는 것이다. 진짜 디스크 하나를 가지고 mdadd -r 를 실행시킨후, mkraid로 RAID 배열을 만들수 있을 것이고, 디스크 하나가 깨졌을 때처럼 "degraded" 모드로 작동시킬수 있을것이다.

    Note:A careful reader has pointed out that the following trick may work; I have not tried or verified this: Do the mkraid with /dev/null as one of the devices. Then mdadd -r with only the single, true disk (do not mdadd /dev/null). The mkraid should have successfully built the raid array, while the mdadd step just forces the system to run in "degraded" mode, as if one of the disks had failed.


다음 이전 차례