Find it

Tuesday, November 24, 2009

Hook up the second drive to SVM to have 2nd submirror to existing SVM configuration.

I have SVM filesystems/partitions with 1-way submirror and I need to add 2nd disk to existing SVM configuration and have 2-way submirror. Below procedure talks about it.

This can be scripted however be honest I'm really bad @ scripting... one of the important area I lacking into!!!

Lets start - below are the available internal disks where all OS data is hosted.

Available disks -

AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w2100000c507bd610,0
1. c1t1d0
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf9985c7,0


Current metastat -p output -

# metastat -p
d0 -m d10 1
d10 1 1 c1t0d0s0
d3 -m d13 1
d13 1 1 c1t0d0s3
d1 -m d11 1
d11 1 1 c1t0d0s1
d30 -p d4 -o 2097216 -b 2097152
d4 -m d14 1
d14 1 1 c1t0d0s4
d31 -p d4 -o 32 -b 2097152

Current metadbs -

# metadb -i
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s7
a p luo 8208 8192 /dev/dsk/c1t0d0s7
a p luo 16400 8192 /dev/dsk/c1t0d0s7


Time to get our hands dirty! Let's add 2nd disk as a mirror to SVM

We start with slicing the second drive in the same way as our first drive, the master.

# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
fmthard: New volume table of contents now in place.


No need to newfs the second drive slices here, that will automaticaly done by the mirror syncing later.

We can now setup our metadbs on 2nd disk which needs to added.

# metadb -a -f -c3 c1t1d0s7

Now you can see metadbs looks like as follows -

# metadb -i
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s7
a p luo 8208 8192 /dev/dsk/c1t0d0s7
a p luo 16400 8192 /dev/dsk/c1t0d0s7
a u 16 8192 /dev/dsk/c1t1d0s7
a u 8208 8192 /dev/dsk/c1t1d0s7
a u 16400 8192 /dev/dsk/c1t1d0s7

PS: I'm not sure why metadb for 2nd disk has flags like this? replica's location not patched in kernel somehow.  Later update!!! Humm.... After sync & reboot metadb's for 2nd disk has flags same like 1st disk...

Now we go to setup the initial metadevices.

# metainit -f d20 1 1 c1t1d0s0
# metainit -f d21 1 1 c1t1d0s1
# metainit -f d23 1 1 c1t1d0s3
# metainit -f d24 1 1 c1t1d0s4


# metastat -p
d0 -m d10 1
d10 1 1 c1t0d0s0
d3 -m d13 1
d13 1 1 c1t0d0s3
d1 -m d11 1
d11 1 1 c1t0d0s1
d24 1 1 c1t1d0s4
d23 1 1 c1t1d0s3
d21 1 1 c1t1d0s1
d20 1 1 c1t1d0s0
d30 -p d4 -o 2097216 -b 2097152
d4 -m d14 1
d14 1 1 c1t0d0s4
d31 -p d4 -o 32 -b 2097152


Now its time to hook up the second drive so we have actualy mirrored slices.

# metattach d0 d20
# metattach d1 d21
# metattach d3 d23
# metattach d4 d24


Now see the metastat -p out put -

#metastat -p
d0 -m d10 d20 1
d10 1 1 c1t0d0s0
d20 1 1 c1t1d0s0
d3 -m d13 d23 1
d13 1 1 c1t0d0s3
d23 1 1 c1t1d0s3
d1 -m d11 d21 1
d11 1 1 c1t0d0s1
d21 1 1 c1t1d0s1
d30 -p d4 -o 2097216 -b 2097152
d4 -m d14 d24 1
d14 1 1 c1t0d0s4
d24 1 1 c1t1d0s4
d31 -p d4 -o 32 -b 2097152

This will take considereble amount of time. Use metastat to check on the progress of the syncing.

All done!

No comments:

Post a Comment