mirroring with disksuite

hi all,
i want to mirror two disks with disksuite under solaris 9 , doses smeone can explain me Briefly the essential steps to do that plz ?

Mirroring disks with DiskSuite Example

The current partition table of c0t0d0:

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 812 400.15MB (813/0/0) 819504
1 swap wu 813 - 1333 256.43MB (521/0/0) 525168
2 backup wm 0 - 17659 8.49GB (17660/0/0) 17801280
3 unassigned wm 1334 - 1354 10.34MB (21/0/0) 21168
4 var wm 1355 - 8522 3.45GB (7168/0/0) 7225344
5 usr wm 8523 - 14764 3.00GB (6242/0/0) 6291936
6 unassigned wm 14765 - 16845 1.00GB (2081/0/0) 2097648
7 home wm 16846 - 17658 400.15MB (813/0/0) 819504

  1. Copy the partition table of the first disk to its mirror.
    # prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2

  2. Create at least 2 DiskSuite state database replicas on each disk. A state database replica contains DiskSuite configuration and state information.
    # metadb -a -f -c2 /dev/dsk/c0t0d0s3 /dev/dsk/c0t1d0s3

Description of metadb flags:
-a -- adding
-f -- force (needed the first time creating databases)
-c2 -- create 2 databases in each slice

  1. Mirror the root slice.
    # metainit -f d10 1 1 c0t0d0s0
    # metainit -f d20 1 1 c0t1d0s0
    # metainit d0 -m d10
    # metaroot d0 (Use this command only on the root slice!)

  2. Mirror the swap slice.
    # metainit -f d11 1 1 c0t0d0s1
    # metainit -f d21 1 1 c0t1d0s1
    # metainit d1 -m d11

  3. Mirror the var slice.
    # metainit -f d14 1 1 c0t0d0s4
    # metainit -f d24 1 1 c0t1d0s4
    # metainit d4 -m d14

  4. Mirror the usr slice.
    # metainit -f d15 1 1 c0t0d0s5
    # metainit -f d25 1 1 c0t1d0s5
    # metainit d5 -m d15

  5. Mirror the opt slice.
    # metainit -f d16 1 1 c0t0d0s6
    # metainit -f d26 1 1 c0t1d0s6
    # metainit d6 -m d16

  6. Mirror the home slice.
    # metainit -f d17 1 1 c0t0d0s7
    # metainit -f d27 1 1 c0t1d0s7
    # metainit d7 -m d17

Run metastat metadevice for information on a metadevice. If you wish to delete a metadevice, run metaclear metadevice.

  1. Update /etc/vfstab to mount the mirrors after boot.

/etc/vfstab before changes:

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/md/dsk/d30 /dev/md/rdsk/d30 / ufs 1 no logging
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /usr ufs 1 no ro,logging
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 1 no nosuid,logging
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /home ufs 2 yes nosuid,logging
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /opt ufs 2 yes nosuid,logging
swap - /tmp tmpfs - yes -

/etc/vfstab after changes:

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no logging
/dev/md/dsk/d5 /dev/md/rdsk/d5 /usr ufs 1 no ro,logging
/dev/md/dsk/d4 /dev/md/rdsk/d4 /var ufs 1 no nosuid,logging
/dev/md/dsk/d7 /dev/md/rdsk/d7 /home ufs 2 yes nosuid,logging
/dev/md/dsk/d6 /dev/md/rdsk/d6 /opt ufs 2 yes nosuid,logging
swap - /tmp tmpfs - yes -

  1. Reboot the system.
    # lockfs -fa
    # init 6

  2. Attach the second submirror to the mirror. This will cause the data from the boot disk to be synchronized with the mirrored drive.

# metattach d0 d20
# metattach d1 d21
# metattach d4 d24
# metattach d5 d25
# metattach d6 d26
# metattach d7 d27

You can run metastat to track the mirroring progress.

  1. Change the crash dump device to the DiskSuite swap metadevice (Solaris 7 and later).
    # dumpadm -d `swap -l | tail -1 | awk '{print $1}'`

  2. Determine the physical device path of the mirror disk.
    $ ls -l /dev/dsk/c0t1d0s0
    lrwxrwxrwx 1 root root 50 Jan 16 10:20 /dev/rdsk/c0t1d0s0 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@1,0:a

Replace the major name (e.g. dad) in the physical device path with disk when creating the device alias below.

  1. Create a mirror device alias for the mirror disk:
    # eeprom "nvramrc=devalias mirror /pci@1f,0/pci@1,1/ide@3/disk@1,0:a"
    # eeprom "use-nvramrc?=true"

You can also configure the device alias from the Open Boot (ok) prompt:
nvalias mirror /pci@1f,0/pci@1,1/ide@3/disk@1,0:a

You may want to add the mirror device alias to the boot-device Open Boot parameter in case of a problem with the standard boot device.

Example:

# eeprom boot-device
boot-device=disk net

In case of a problem with the disk device alias, the system will attempt to boot from the mirror device alias and then the network with the following change.
# eeprom "boot-device=disk mirror net"

From the Open Boot prompt, type boot mirror to boot from the mirror disk.

  1. If you only have two internal disks (i.e. the boot disk and mirror disk), consider adding the following parameter to /etc/system to bypass the SVM/DiskSuite "quorum" rule.

set md:mirrored_root_flag = 1

Without this parameter, the system will not boot in multiuser mode if half or fewer of its state database replicas are available.

thank you very much you are the best

Grate incredible...... Good info......
Really appriciate.....:b:

Thanks....:smiley: