To the Brass 
Cannon Webboard
Established 1986

Kevin Martin - PO Box 82783 - Portland, OR 97282

Install DiskSuite and Mirror the System Disk

  1. Disksuite is on the "Easy Access" CD for Solaris 7 and on the "Intranet Tools" CD for 2.6. (For Solaris 8 it's in "Solaris 8 Software CD 2 of 2" in the EA/products directory). In 2.6 and 7, at least, it installs into the /usr/opt/SUNWmd/sbin directory. To make the command line tools more accessible, you can create symlinks in a directory that's on the PATH:
    	cd /usr/opt/SUNWmd/sbin
    	for i in * ; do \
    	ln -s /usr/opt/SUNWmd/sbin/$i  /opt/bin/$i ;
    	done
    
    

  2. We're assuming you have already formatted the primary disk and installed the OS on it. (Have to start with something from which to make a mirror.) Format the second disk so that each slice is the same size as the one on the primary. If c0t0d0 is the primary and c0t8d0 is the secondary, then:
    	prtvtoc /dev/rdsk/c0t0d0 | fmthard -s - /dev/rdsk/c0t8d0
    

    This one command will save you a half-hour of trying to make the second drive look exactly like the first one.

    prtvtoc prints the VTOC or Volume Table Of Contents, the existing partitioning scheme. We pipe that to fmthard which saves (-s) the input it receives from stdin (-) and applies it to the new disk. Just a little basic Unix and knowing that there are these two tools that work together.

    e.g. Using a pair of 18GB drives as an example:
        c0t0d0s#                            c0t8d0s#
        ----------------------------------- -------------
    	s0    0 - 86   /                  unassigned
    	s1   87 - 505  /usr                  "
    	s2    0 - 7505 (backup/overlap)   backup
    	s3  506 - 766  /opt               unassigned
    	s4  767 - 1114 /var                  " 
    	s5 1115 - 1549 swap               swap
    	s6 1550 - 7392 unassigned*        unassigned*
    	s7 7393 - 7505 unassigned            "
    
    
    *Because the format command only recognizes reserved partition names, our /app partition must be created as 'unassigned' and added to /etc/vfstab manually (don't forget to create a mount point for it). Don't mount slice 7 (don't add it to vfstab), because we are saving it for Disksuite's use.

  3. Create TWO metadb replicas on each disk using slice 7:
     # metadb -a -f -c 2 c0t0d0s7 c0t8d0s7
    

  4. Mirror the root slice:
     # metainit -f d11 1 1 c0t0d0s0  # Create submirror of original root
     d11: Concat/Stripe is setup
     # metainit d12 1 1 c0t8d0s0  # Create submirror for copy
     d12: Concat/Stripe is setup
     # metainit d10 -m d11  # Create mirror
     d10: Mirror is setup
     # metaroot d10   # Create pseudo root on mirror
     # lockfs -fa     # lock filesystem to allow safe reboot
     # reboot 
     ...
     # metattach d10 d12  # Attach submirror copy to main mirror
     d10: submirror d12 is attached
    

  5. Mirror the remaining slices: /usr:
     # metainit -f d21 1 1 c0t0d0s1
     # metainit d22 1 1 c0t8d0s1
     # metainit d20 -m d21
    
    /opt:
     # metainit -f d31 1 1 c0t0d0s3
     # metainit d32 1 1 c0t8d0s3
     # metainit d30 -m d31
    
    /var:
     # metainit -f d41 1 1 c0t0d0s4
     # metainit d42 1 1 c0t8d0s4
     # metainit d40 -m d41
    
    /app (rename to reflect the dedicated purpose of this machine)
     # metainit -f d51 1 1 c0t0d0s6
     # metainit d52 1 1 c0t8d0s6
     # metainit d50 -m d51
    

  6. Mirror the swap slice:
     # metainit -f d61 1 1 c0t0d0s5 
     # metainit d62 1 1 c0t8d0s5
     # metainit d60 -m d61
    

  7. Edit /etc/vfstab:
     /dev/md/dsk/d20 /dev/md/rdsk/d20 /usr      ufs 1  yes    -
     /dev/md/dsk/d30 /dev/md/rdsk/d30 /opt      ufs 2  yes    -
     /dev/md/dsk/d40 /dev/md/rdsk/d40 /var      ufs 1  no     -
     /dev/md/dsk/d50 /dev/md/rdsk/d50 /weblogic ufs 2  yes    -
     /dev/md/dsk/d60 - - swap - no -
    

  8. Reboot and attach the submirrors:
     # reboot
     ...
     # metattach d20 d22
     # metattach d30 d32
     # metattach d40 d42
     # metattach d50 d52
     # metattach d60 d62
    

    Wait for them all to resync and you're done (about 40 minutes for the really big slice, less for the others. You can monitor its progress using the GUI "metatool" -- that's about all it's good for).


Please Note

If a search engine dropped you directly into this document, you should go to the index page to find out what you're reading. This document is a record of a project from 1999-2000 -- it is not a current guide to installing any software product.