Mirroring Disks

****************************************************************************
After create parition your slice should be identical
****************************************************************************
Disk 1: Frist Hard Disk Parition table

c3t2d0s0: / 4000
c3t2d0s1: /usr 15006
c3t2d0s2: overlap 69868
c3t2d0s3: /var 8001
c3t2d0s4: /export 25007
c3t2d0s5: swap 16002
c3t2d0s6: unassigned
c3t2d0s7: unassigned 1g

Disk 2: Format second hard disk create the same parition

c3t3d0s0: / 4000
c3t3d0s1: /usr 15006
c3t3d0s2: overlap 69868
c3t3d0s3: /var 8001
c3t3d0s4: /export 25007
c3t3d0s5: swap 16002
c3t3d0s6: unassigned
c3t3d0s7: unassigned 1g

****************************************************************************
The Database State Replicas
****************************************************************************

The database state replicas serve a very important function in DiskSuite.
They are the repositories of information on the state and configuration of each metadevice
A logical device created through DiskSuite is known as a metadevice). Having multiple replicas is critical to the proper operation of DiskSuite.

There must be a minimum of three replicas. DiskSuite requires at least half of the replicas to be present in order to continue to operate.
51% of the replicas must be present in order to reboot.
Replicas should be spread across disks and controllers where possible.
In a three drive configuration, at least one replica should be on each disk, thus allowing for a one disk failure.
In a two drive configuration, such as the one we present here, there must be at least two replicas per disk.
If there were only three and the disk which held two of them failed, there would not be enough information for DiskSuite to function and the system would panic.
Here we will create our state replicas using the metadb command:

Before creating metadb please take a backup of /etc/system & /etc/vfstab for safer side.
#cp -p /etc/system /etc/system.orig.011207
#cp -p /etc/vfstab /etc/vfstab.orig.011207

Create a parition for boot block on c3t2d0s7: 1gb
Note: the boot block parition should not be in use

bash-3.00# metadb -a -f -c 4 c3t3d0s7

Once you are done with creating metadb your metadb table structure will look as below figure.

bash-3.00# metadb
flags first blk block count
a u 16 8192 /dev/dsk/c3t2d0s7
a u 8208 8192 /dev/dsk/c3t2d0s7
a u 16400 8192 /dev/dsk/c3t2d0s7
a u 24592 8192 /dev/dsk/c3t2d0s7
a u 16 8192 /dev/dsk/c3t3d0s7
a u 8208 8192 /dev/dsk/c3t3d0s7
a u 16400 8192 /dev/dsk/c3t3d0s7
a u 24592 8192 /dev/dsk/c3t3d0s7

***************************************************************************

Now let us start creating mirror paritions for all slices
will show you how to create single slice in both hard disk

#metainit -f d10 1 1 c3t2d0s0
#metainit -f d20 1 1 c3t3d0s0

# Slice 2 will not be mirrored (represents entire disk)

Here is the template for creating other slices in both hard disk
***************************************************
Template for other slices in both HDD
***************************************************

#metainit -f d10 1 1 c3t2d0s0
#metainit -f d11 1 1 c3t2d0s2
#metainit -f d12 1 1 c3t2d0s3
#metainit -f d13 1 1 c3t2d0s4
#metainit -f d14 1 1 c3t2d0s5

#metainit -f d20 1 1 c3t3d0s0
#metainit -f d21 1 1 c3t3d0s2
#metainit -f d22 1 1 c3t3d0s3
#metainit -f d23 1 1 c3t3d0s4
#metainit -f d24 1 1 c3t3d0s5

Once you are done with creating mirror parition now its time to attach the both disks
first you have to attach d10 to d0 which will look like

#metainit d0 -m d10

d0
/
/
d10

now we have to make changes in vfstab to take effect
we have to use the below mentioned command which is only used for root parition

#metaroot d0 {to take effect in /etc/vfstab}

#init 6 {reboot the machine to take effect}

   d0
  /
 /  
d10  d20

#metainit d1 -m d11

#metattach d1 d21

#metainit d2 -m d12

#metattach d2 d22

#metainit d3 -m d13

#metattach d3 d23

#metainit d4 -m d14

#metattach d4 d24

      d1
    /  
  /        
d11   d21
    

       d2
     /   
   /         

d12     d22

     d3
    /   
  /       
d13    d23

     d4
    /    
  /        
d14   d24

now edit /etc/vfstab to make it permanment

before mirroring disk vfstab will look
*************************************************************************

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd – /dev/fd fd – no –
/proc – /proc proc – no –
/dev/dsk/c0t0d0s1 – – swap – no –
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no –
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /usr ufs 1 no –
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 1 no –
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /export ufs 2 yes –
/devices – /devices devfs – no –
ctfs – /system/contract ctfs – no –
objfs – /system/object objfs – no –
swap – /tmp tmpfs – yes –

Vfstab should look like this
***********************************************************************

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd – /dev/fd fd – no –
/proc – /proc proc – no –
/dev/md/dsk/d1 /dev/md/rdsk/d1 – swap – no –
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no –
/dev/md/dsk/d2 /dev/md/rdsk/d2 /usr ufs 1 no –
/dev/md/dsk/d4 /dev/md/rdsk/d4 /var ufs 1 no –
/dev/md/dsk/d5 /dev/md/rdsk/d5 /export ufs 2 yes –
/devices – /devices devfs – no –
ctfs – /system/contract ctfs – no –
objfs – /system/object objfs – no –
swap – /tmp tmpfs – yes –

bash-3.00# metastat
d10: Concat/Stripe
Size: 8193150 blocks (3.9 GB)
Stripe 0:
Device Start Block Dbase Reloc
c3t2d0s0 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c3t2d0 Yes id1,sd@n5000c50003d90efb
bash-3.00# metainit -f d20 1 1 c3t2d0s0
metainit: airweb1: c3t2d0s0: has appeared more than once in the specification of d10

bash-3.00# metainit -f d20 1 1 c3t3d0s0
d20: Concat/Stripe is setup
bash-3.00# metastat
d20: Concat/Stripe
Size: 8193150 blocks (3.9 GB)
Stripe 0:
Device Start Block Dbase Reloc
c3t3d0s0 0 No Yes

d10: Concat/Stripe
Size: 8193150 blocks (3.9 GB)
Stripe 0:
Device Start Block Dbase Reloc
c3t2d0s0 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c3t3d0 Yes id1,sd@n5000c50003d9617b
c3t2d0 Yes id1,sd@n5000c50003d90efb

This example shows a two-way mirror, /dev/md/dsk/d50, con-
sisting of two submirrors. This mirror does not contain any
existing data.

# metainit d51 1 1 c0t1d0s0
# metainit d52 1 1 c0t2d0s0
# metainit d50 -m d51
# metattach d50 d52

In this example, two submirrors, d51 and d52, are created
with the metainit command. These two submirrors are simple
concatenations. Next, a
one-way mirror, d50, is created
using the -m option with d51. The second submirror is
attached later using the metattach command. When creating a
mirror, any combination of stripes and concatenations can be
used. The default read and write options in this example are
a round-robin read algorithm and parallel writes to all sub-
mirrors.
Feedbacks: We appreciate feedbacks and suggestions about our website info@techgyaan.org