Installing Disksuite

  1. Insert disksuite cdrom and cd /cdrom/disksuite_version

  2. pkgadd -d pwd

  3. reboot

Building Disksuite Databases

At least 50% of the metadatabases are required for a successful boot. If only one disk is available to hold the metadatabases, 3 should be created (i.e.use flag -c 3 with metadb command). If two disks are available, 2 metadatabases should be on each disk. If three disks are available, create 1 on each disk. It is not normally necessary to spread the metadatabases over more than three disks.

  1. create small partitions (around 3mb) on your disks as required using format command (NOTE:You may need to partition the disk as described in the next section if the disk is to be used as a mirror)

  2. Initialise meta database by entering: >/usr/opt/SUNWmd/sbin/metadb -a -f -c 2 /dev/dsk/device1 /dev/dsk/device2 (where device1 and device2 should be a small disk partitions previously set up). This will create 2 metadatabases on the two disks specified.

Mirroring Disks - Method 1, command line based

The disk which is to be used as a mirror has to have the same underlying partitions as the original disk. This is most easily done as follows:

  1. prtvtoc -h /dev/rdsk/cntndns2 > /tmp/vtoc

  2. Edit /tmp/vtoc removing the last two fields on each line (one if directory not shown)

  3. fmthard -s /tmp/vtoc /dev/dsk/cxtxdxs2

  4. create root mirror

     metainit -f d10 1 1 disk1
     metainit d20 1 1 disk2
     metainit d0 -m d10
     metaroot d0 disk1
     shutdown -y -g0 -i6
     metattach d0 d20 
    
  5. create other mirrors

     metainit -f d11 1 1 disk1
     metainit d21 1 1 disk2
     metainit d1 -m d11
     iedit /etc/vfstab changing entry to use matadevice instead 
     of disk device
     shutdown -y -g0 -i6 (you don't have to reboot after each 
     mirror is created but can wait until you've created all 
     the initial mirror devices you require)
     metattach d1 d21 
    
  6. Repeat the above step until all the required partitions are mirrored

Setting up Disksuite using a file

  1. vi /etc/opt/SUNWmd/md.tab setting up the entries as required. Examples are shown below:

    Concatenating 4 devices: create an entry as below:

    d1 4 1 /dev/dsk/device1 1 /dev/dsk/device2 1 /dev/dsk/device3 1 /dev/dsk/device4

    This will create a metadevice d1 consisting of the 4 disks specified

    Striping 3 devices: create an entry as below:

    d2 1 3 /dev/dsk/device1 /dev/dsk/device2 /dev/dsk/device3 -I 32k

    This will create a metadevice d2 consisting of the 3 components striped with a stripe size of 32Kb

    Mirroring devices:create an entry as below:

    /dev/md/dsk/d12 1 1 /dev/dsk/device1 (create metadevice for existing f/s) /dev/md/dsk/d2 -m /dev/md/dsk/d12 (create meta mirror device) /dev/md/dsk/d22 1 1 /dev/dsk/device2 (create submirror device)

  2. Verify the entry you have is correct by entering metainit -n /dev/md/dsk/dn

  3. If there are no errors, run metainit for real: metainit /dev/md/dsk/dn

  4. For mirrors you need to activate the meta devices first, then metattach the submirror to the metamirror. So for the above example you would need to:

     /usr/opt/SUNWmd/sbin/metainit /dev/md/dsk/d22
     /usr/opt/SUNWmd/sbin/metainit -f /dev/md/dsk/d12 
     (-f is required if the filesystem is mounted)
     /usr/opt/SUNWmd/sbin/metainit /dev/md/dsk/d2
     Either edit /etc/vfstab or if root filesystem enter: 
     metaroot /dev/md/dsk/d2
     reboot
     metattach /dev/md/dsk/d2 /dev/md/dsk/d22 
    
  5. Can check status using metastat

Recovering an existing Disksuite Database

Step 1: Installing Disksuite

  1. Remove the current installation by entering: pkgrm SUNWmd

  2. reboot to reconfigure the kernel without the psuedo devices by Disksuite (need to change /etc/vfstab first!)

  3. cd /etc/opt/SUNWmd

  4. remove unwanted data: rm md.cf mddb.vf

  5. mv md.tab md.tab.orig

  6. Insert disksuite cdrom and cd /cdrom/disksuite_version

  7. Reinstall disksuite: pkgadd -d pwd

8, reboot

Step 2: building Disksuite Databases and Setting Up Mirrors

The exact recovery of the database depends on the original setup, the original devices present and the new devices present (e..g.in a disaster recovery situation). You will need to check the original md.tab file (and df entries if available) to work out the original set up. The procedures below provide general guidelines for a mirrored system but cab be applied to any recovery.

  1. Initialise the meta database: metadb -afc device

  2. cp md.tab.orig md.tab

  3. vi md.tab changing devices to those present on the box

  4. If required mirror the root disk as follows:

     prtvtoc /dev/dsk/device > /tmp/file
     fmthard -s /tmp/file /dev/dsk/rootcopy_device
     metainit the uderlying devices in accordance 
     with the contents of meta.db e.g. metainit -f d1
     metainit the metadevice e.g. metainit d0
     To indicate root volume enter metaroot d0
     vi /etc/vfstab to change the devices to the 
     metadevices for the root file systems 
     (i.e.put back the md in the path, etc)
     reboot
     metattach d0 d2 etc to attach mirrors 
    
  5. Format any disk with the pattern of partitions required

  6. save the vtoc: prtvtoc /tmp/file2

  7. fmthard all the disks using this pattern (except root and mirror!)

  8. metainit hsp001 to metainit the hotspare pool (if required)

  9. metainit the remaining disks e.g. metainit d16; metatinit d17; metainit -f d15