Replacing a disk with different geometry in DiskSuite
In this example, c0t1d0 failed and was replaced with a disk with the same product identification, but different geometry.
# iostat -En
c0t0d0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE Product: ST318203LC Revision: 0002 Serial No:
Size: 18.11GB <18110967808 bytes>
c0t1d0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE Product: ST318203LC Revision: 0002 Serial No:
Size: 18.19GB <18190006272 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
# prtvtoc /dev/rdsk/c0t0d0s2
* /dev/rdsk/c0t0d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 248 sectors/track
* 19 tracks/cylinder
* 4712 sectors/cylinder
* 7508 cylinders
* 7506 accessible cylinders
# prtvtoc /dev/rdsk/c0t1d0s2
* /dev/rdsk/c0t1d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 303 sectors/track
* 12 tracks/cylinder
* 3636 sectors/cylinder
* 9772 cylinders
* 9770 accessible cylinders
It is possible to mirror data using Solaris Volume Manager/DiskSuite on
disks with different geometry, provided the submirrors on the mirror
disk are at least as large as the submirrors on the original disk.
Here is the partition table of the original disk:
partition> p
Current partition table (original):
Total disk cylinders available: 7506 + 2 (reserved cylinders)
Part Tag
Flag
Cylinders
Size
Blocks
0 root
wm 891 -
2226 3.00GB
(1336/0/0) 6295232
1 swap
wu 0 -
890 2.00GB
(891/0/0) 4198392
2 backup
wm 0 -
7505 16.86GB
(7506/0/0) 35368272
3
var wm 2227 -
2672 1.00GB
(446/0/0) 2101552
4 unassigned wm 2673 -
2674 4.60MB
(2/0/0) 9424
5 unassigned wm 2675 -
7490 10.82GB
(4816/0/0) 22692992
6 unassigned wm 7491 -
7505 34.51MB
(15/0/0) 70680
7 unassigned
wu
0
0
(0/0/0) 0
First, I create a partition table on the mirror disk that slice sizes similar to those of the original disk.
partition> p
Current partition table (unnamed):
Total disk cylinders available: 9770 + 2 (reserved cylinders)
Part Tag
Flag
Cylinders
Size
Blocks
0 root
wm 1160 -
2896 3.01GB
(1737/0/0) 6315732
1 swap
wu 0 -
1159 2.01GB
(1160/0/0) 4217760
2 backup
wu 0 -
9769 16.94GB
(9770/0/0) 35523720
3
var wm 2897 -
3479 1.01GB
(583/0/0) 2119788
4 unassigned wm 3480 -
3483 7.10MB
(4/0/0) 14544
5 unassigned wm 3484 -
9730 10.83GB
(6247/0/0) 22714092
6 unassigned wm 9731 -
9769 69.24MB
(39/0/0) 141804
7 unassigned
wm
0
0
(0/0/0) 0
Next, I create state database replicas on the mirror disk.
# metadb
flags first
blk block count
a m p
luo
16
8192
/dev/dsk/c0t0d0s6
a p
luo
8208
8192
/dev/dsk/c0t0d0s6
# metadb -a -c 2 /dev/dsk/c0t1d0s6
# metadb
flags first
blk block count
a m p
luo
16
8192
/dev/dsk/c0t0d0s6
a p
luo
8208
8192
/dev/dsk/c0t0d0s6
a
u
16
8192
/dev/dsk/c0t1d0s6
a
u
8208
8192
/dev/dsk/c0t1d0s6
I then remove and clear the submirror in "Needs maintenance" state from
each mirror, and recreate the submirrors on the mirror disk.
# metadetach -f d0 d20
d0: submirror d20 is detached
# metadetach -f d3 d23
d3: submirror d23 is detached
# metadetach -f d5 d25
d5: submirror d25 is detached
# metaclear d20
d20: Concat/Stripe is cleared
# metaclear d23
d23: Concat/Stripe is cleared
# metaclear d25
d25: Concat/Stripe is cleared
# metainit d20 1 1 c0t1d0s0
d20: Concat/Stripe is setup
# metainit d23 1 1 c0t1d0s3
d23: Concat/Stripe is setup
# metainit d25 1 1 c0t1d0s5
d25: Concat/Stripe is setup
The submirrors on the mirror disk are then attached.
# metattach d0 d20
d0: submirror d20 is attached
# metattach d3 d23
d3: submirror d23 is attached
# metattach d5 d25
d5: submirror d25 is attached
If the submirror on the mirror disk is not at least as large as the submirror on the original disk, you will receive an error.
# metattach d0 d20
metattach: hostname: d20: submirror too small to attach
# metastat d10
d10: Concat/Stripe
Size: 6295232 blocks (3.0 GB)
Stripe 0:
Device Start Block
Dbase State Reloc Hot Spare
c0t0d0s0
0
No
Okay Yes
# metastat d20
d20: Concat/Stripe
Size: 6293916 blocks (3.0 GB)
Stripe 0:
Device Start Block Dbase Reloc
c0t1d0s0
0 No Yes
More information:
http://www.sunmanagers.org/pipermail/summaries/2005-August/006676.html
Back to brandonhutchinson.com.
Last modified: 2006/11/20