HOWTO: Create RAID 1+0 using Solstice DiskSuite

시스템운영/Solaris|2011.08.08 23:42

HOWTO: Create RAID 1+0 using Solstice DiskSuiteDiskSuite (SDS)

    Solstice DiskSuite is bundled as a seperate product for Solaris 2.5 - Solaris 8 (See http://web.archive.org/web/20050206005720/http://web.archive.org/web/20050206005720/http://sunsolve.sun.com/ for specific version compatability). Starting with Solaris 9, it is bundled with the OS and installed during OS installation as SUNWmdr and SUNWmdu.

    According to Sun's documentation, DiskSuite (as of 4.2) will automatically create RAID 1+0 if you specify 0+1 (the conventional method of doing striping and mirroring). It is with that assumption that this method works.

    The following examples (in blue) assume we are using (nearly) the entire disk (partitioned as slice 0), and that we want to end up with 5 mirrors (c1txd0 mirrored to c2txd0, etc) that are striped together. I have included slice 7 for the meta state database. If you have sufficient meta state databases elsewhere, this is not necessary.

    Make sure the system is healthy and all filesystems are healthy before attempting any of this. This guideline is provided as a convenience only.

    NOT FULLY UNDERSTANDING WHAT THESE COMMANDS DO MAY RESULT IN SYSTEM FAILURE AND/OR DATA LOSS. I ASSUME NO RESPONSIBILITY FOR ANY DAMAGE OR LOSS AS A RESULT OF THIS DOCUMENT.

    In other words, please make sure you know what you are doing! I have made a decent effort to make sure this document is accurate and complete, but I cannot be held responsible for commands that you inevitably do to your server.

  1. Create slice 0 and slice 7 on the first disk (c1t1d0 in our example). 10MB is sufficient for slice 7, use remaining disk for slice 0:
    # format
    (use format to change partitions/slices)

    It's a good idea to make slice 7 unmountable (by changing the permission flag to "wu":

    Enter partition permission flags[wm]: wu
    
  2. Copy the partition table of the first disk to the other nine disks:
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t2d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t3d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t4d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t5d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c2t2d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c2t3d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c2t4d0s2
    # prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c2t5d0s2
    
  3. If there is no existing meta state database (or if you just have two existing state databases, such as with a mirrored root disk), create/add the database with 1 replica* on each disk:
    # metadb -a -f /dev/dsk/c1t1d0s7 /dev/dsk/c1t2d0s7 /dev/dsk/c1t3d0s7 /dev/dsk/c1t4d0s7 \
    /dev/dsk/c1t5d0s7 /dev/dsk/c2t1d0s7 /dev/dsk/c2t2d0s7 /dev/dsk/c2t3d0s7 /dev/dsk/c2t4d0s7 \
    /dev/dsk/c2t5d0s7
    

    * Disksuite requires 1/2 of all db replicas remain available in order for the volume to keep running (i.e. if one disk fails while the OS is running). It also requires that > 50% (a quorum) of db replicas are present in order to boot without manual intervention. Plan accordingly, so that in the event of a controller failure or disk failure, you will still have greater than 50% of all the replicas available.

    Verify the databases exist (there will be one line for every database replica, so some disks may have two lines):

    # metadb
    ...
    
  4. Edit /etc/lvm/md.tab (or /etc/opt/SUNWmd/md.tab for older versions of SDS) and add the following entries (this is an example only for the assumptions above - it constructs what looks like RAID 0+1, but DiskSuite automatically creates it as RAID 1+0):
    # Set up first striped device (using interlace of 128 kilobytes in this example)
    # Interlace is the amount of data written to one disk before moving on to next disk/column in stripe
    d110 1 5 /dev/dsk/c1t1d0s0 \
             /dev/dsk/c1t2d0s0 \
             /dev/dsk/c1t3d0s0 \
             /dev/dsk/c1t4d0s0 \
             /dev/dsk/c1t5d0s0 -i 128k
    
    # Set up second striped device (make sure interlace is same as above)
    d120 1 5 /dev/dsk/c2t1d0s0 \
             /dev/dsk/c2t2d0s0 \
             /dev/dsk/c2t3d0s0 \
             /dev/dsk/c2t4d0s0 \
             /dev/dsk/c2t5d0s0 -i 128k
    
    # Set up mirrors (but do not do resynchronization)
    d100 -m d110 d120
    
  5. Initialize the metadevices:
    # metainit d110
    # metainit d120
    # metainit d100
    
    It is safe to ignore any warnings about the mirror data being inconsistent (because we are creating a new filesystem on them later, they do not need to be in sync right now)

  6. Add the following line to the /etc/vfstab (this is a good time to turn on logging/journalling):
    /dev/md/dsk/d100  /dev/md/rdsk/d100  /<mount-point>     ufs    3  yes   logging
    
    Make sure the line beginning with "swap" is placed LAST in the file (this is recommended and documented by Sun on their website - technically, all it has to do is be placed somewhere below the line that defines the swap device).

  7. DOUBLE-CHECK the /etc/vfstab for accuracy and run metastat to verify mirrors and stripes are set up.

  8. Create a filesystem on /dev/md/rdsk/d100 (THIS IS AN EXAMPLE ONLY - MAKE SURE YOU KNOW WHAT THESE OPTIONS ARE BEFORE YOU USE THEM!):
    # newfs -b 8192 -f 8192 -m 1 -o time /dev/md/rdsk/d100
    
  9. Check and mount the filesystem:
    # fsck /dev/md/rdsk/d100
    # mount /dev/md/dsk/d100
    

댓글()