RAID 1 in Solaris

Hardware :
1. Ultra 60
2. 512 Mhz
3. Compaq 72 GB (2 pcs)
a.c0t0d0
b.c0t1d0
4. Solaris 9


Step-by-step:

1. Look at the configuration for each mount-point.
# more /etc/vfstab

#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/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /usr ufs 1 no -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /export/home ufs 2 yes -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -

4. Look at the partition that to be mirrored
# format

Part Tag Flag Cylinders Size Block 0 root wm 0 - 1362 3.30GB (1363/0/0) 6924040
1 swap wu 1363 - 1775 1.00GB (413/0/0) 2098040 2 backup wm 0 - 28001 67.83GB (28002/0/0) 142250160 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 1776 - 1781 14.88MB (6/0/0) 30480 5 usr wm 1782 - 3064 3.11GB (1283/0/0) 6517640 6 home wm 3065 - 27920 60.21GB (24856/0/0) 126268480
7 unassigned wm 27921 – 28001 200.92MB (81/0/0) 411480

5. Make a copy of the VTOC (Volume Table of Content) containing information about the partition of the first disk.
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard –s - /dev/rdsk/c0t1d0s2

6. Create metadb (file that will handle all the configuration of the mirror) Usually on the 7th slice
# metadb –a –c 3 –f c0t0d0s7 c0t1d0s7

7.Create virtual devices on every slices.
# metainit -f d11 1 1 c0t0d0s0
d11: Concat/Stripe is setup
# metainit -f d12 1 1 c0t1d0s0
d12: Concat/Stripe is setup
# metainit d10 -m d11
d10: Mirror is setup
# metainit -f d21 1 1 c0t0d0s1
d21: Concat/Stripe is setup
# metainit -f d22 1 1 c0t1d0s1
d22: Concat/Stripe is setup
# metainit d20 -m d21
d20: Mirror is setup
# metainit -f d31 1 1 c0t0d0s5
d31: Concat/Stripe is setup
# metainit -f d32 1 1 c0t1d0s5
d32: Concat/Stripe is setup
# metainit d30 -m d31
d30: Mirror is setup
# metainit -f d41 1 1 c0t0d0s6
d41: Concat/Stripe is setup
# metainit -f d42 1 1 c0t1d0s6
d42: Concat/Stripe is setup
# metainit d40 -m d41
d40: Mirror is setup

8. We need to inform the OS that the root is on virtual device not on the disk anymore.
# metaroot d10

9. Restart the server
# init 6

10. Add virtual device from disk number two to the appropriate mirror.
# metattach d10 d12
d10: submirror d12 is attached
# metattach d20 d22
d20: submirror d22 is attached
# metattach d30 d32
d30: submirror d32 is attached
# metattach d40 d42
d40: submirror d42 is attached

11. Look at the status
# metastat

d40: Mirror
Submirror 0: d41
State: Okay
Submirror 1: d42
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 126268480 blocks (60 GB)

d41: Submirror of d40
State: Okay
Size: 126268480 blocks (60 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s6 0 No Okay Yes


d42: Submirror of d40
State: Resyncing
Size: 126268480 blocks (60 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s6 0 No Okay Yes


d30: Mirror
Submirror 0: d31
State: Okay
Submirror 1: d32
State: Resyncing
Resync in progress: 1 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 6517640 blocks (3.1 GB)

d31: Submirror of d30
State: Okay
Size: 6517640 blocks (3.1 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s5 0 No Okay Yes


d32: Submirror of d30
State: Resyncing
Size: 6517640 blocks (3.1 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s5 0 No Okay Yes


d20: Mirror
Submirror 0: d21
State: Okay
Submirror 1: d22
State: Resyncing
Resync in progress: 9 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2098040 blocks (1.0 GB)

d21: Submirror of d20
State: Okay
Size: 2098040 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes


d22: Submirror of d20
State: Resyncing
Size: 2098040 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s1 0 No Okay Yes


d10: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d12
State: Resyncing
Resync in progress: 5 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 6924040 blocks (3.3 GB)

d11: Submirror of d10
State: Okay
Size: 6924040 blocks (3.3 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes


d12: Submirror of d10
State: Resyncing
Size: 6924040 blocks (3.3 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c0t1d0 Yes id1,sd@w0004cffffee08628
c0t0d0 Yes id1,sd@w0004cffffee045be

12. Takes time until all the process done.

13. Look at the /etc/vfstab
# more /etc/vfstab
#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/d10 /dev/md/rdsk/d10 / ufs 1 no -
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /usr ufs 1 no -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /export/home ufs 2 yes -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -

No comments:

Post a Comment