Tag: metadb

Solaris Volume Manager – Delete replicas of the metadevice state database

In this Solaris server, one of the disks needs replacement

root@solaris # echo | format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t2d0 <drive not available>
/pci@1f,0/pci@1,1/scsi@2/sd@2,0
1. c0t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1f,0/pci@1,1/scsi@2/sd@3,0
Specify disk (enter its number): Specify disk (enter its number):

Checking replicas of the metadevice state database

root@solaris # metadb
flags first blk block count
M p 16 unknown /dev/dsk/c0t2d0s4
M p 8208 unknown /dev/dsk/c0t2d0s4
M p 16400 unknown /dev/dsk/c0t2d0s4
M p 16 unknown /dev/dsk/c0t2d0s5
M p 8208 unknown /dev/dsk/c0t2d0s5
M p 16400 unknown /dev/dsk/c0t2d0s5
a m p lu 16 8192 /dev/dsk/c0t3d0s4
a p l 8208 8192 /dev/dsk/c0t3d0s4
a p l 16400 8192 /dev/dsk/c0t3d0s4
a p l 16 8192 /dev/dsk/c0t3d0s5
a p l 8208 8192 /dev/dsk/c0t3d0s5
a p l 16400 8192 /dev/dsk/c0t3d0s5

Deleting metadevice state database on the slices of the bad disk. First slice 4

root@solaris # metadb -d /dev/dsk/c0t2d0s4
metadb: solaris: Bad address

root@solaris # metadb
flags first blk block count
M p 16 unknown /dev/dsk/c0t2d0s5
M p 8208 unknown /dev/dsk/c0t2d0s5
M p 16400 unknown /dev/dsk/c0t2d0s5
a m p lu 16 8192 /dev/dsk/c0t3d0s4
a p l 8208 8192 /dev/dsk/c0t3d0s4
a p l 16400 8192 /dev/dsk/c0t3d0s4
a p l 16 8192 /dev/dsk/c0t3d0s5
a p l 8208 8192 /dev/dsk/c0t3d0s5
a p l 16400 8192 /dev/dsk/c0t3d0s5

And then in slice 5

root@solaris # metadb -d /dev/dsk/c0t2d0s5
metadb: solaris: Bad address

root@solaris # metadb
flags first blk block count
a m p lu 16 8192 /dev/dsk/c0t3d0s4
a p l 8208 8192 /dev/dsk/c0t3d0s4
a p l 16400 8192 /dev/dsk/c0t3d0s4
a p l 16 8192 /dev/dsk/c0t3d0s5
a p l 8208 8192 /dev/dsk/c0t3d0s5
a p l 16400 8192 /dev/dsk/c0t3d0s5

Replacing root disk / root mirror for Solaris server with Solaris Volume Manager

Reviewing metadevice state database

root@solaris10:/ # metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c0t1d0s7
a p luo 8208 8192 /dev/dsk/c0t1d0s7
a p luo 16400 8192 /dev/dsk/c0t1d0s7
a p luo 16 8192 /dev/dsk/c0t0d0s7
a p luo 8208 8192 /dev/dsk/c0t0d0s7
a p luo 16400 8192 /dev/dsk/c0t0d0s7

The disk to replace is the c0t0d0

Deleting metadevice state database from the disk that is being replaced

root@solaris10:/ # metadb -d /dev/dsk/c0t0d0s7

Reviewing metadevices and disk slices

root@solaris10:/ # metastat -c
d40 m 516MB d41 d42
d41 s 516MB c0t0d0s6
d42 s 516MB c0t1d0s6
d20 m 20GB d21 d22
d21 s 20GB c0t0d0s1
d22 s 20GB c0t1d0s1
d30 m 23GB d31 d32
d31 s 23GB c0t0d0s5
d32 s 23GB c0t1d0s5
d10 m 24GB d11 d12
d11 s 24GB c0t0d0s0
d12 s 24GB c0t1d0s0

Splitting mirror

root@solaris10:/ # metadetach d10 d11
d10: submirror d11 is detached
root@solaris10:/ # metadetach d20 d21
d20: submirror d21 is detached
root@solaris10:/ # metadetach d30 d31
d30: submirror d31 is detached
root@solaris10:/ # metadetach d40 d41
d40: submirror d41 is detached

Removing the metadevice

root@solaris10:/ # metaclear d11
d11: Concat/Stripe is cleared
root@solaris10:/ # metaclear d21
d21: Concat/Stripe is cleared
root@solaris10:/ # metaclear d31
d31: Concat/Stripe is cleared
root@solaris10:/ # metaclear d41
d41: Concat/Stripe is cleared

Identifying the disk

root@solaris10:/ # format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@780/pci@0/pci@9/scsi@0/sd@0,0
1. c0t1d0
/pci@780/pci@0/pci@9/scsi@0/sd@1,0
2. c6t60060E8004587800000058780000012Cd0
/scsi_vhci/ssd@g60060e8004587800000058780000012c
3. c6t60060E8004587800000058780000010Ed0 <HITACHI-OPEN-V*4-SUN-5009 cyl 48744 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000010e
4. c6t60060E8004587800000058780000012Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000012e
5. c6t60060E8004587800000058780000011Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000011e
6. c6t60060E8004587800000058780000011Fd0 <HITACHI-OPEN-V*2-SUN-5009 cyl 24371 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000011f
7. c6t60060E80045878000000587800000088d0
/scsi_vhci/ssd@g60060e80045878000000587800000088
8. c6t60060E80045878000000587800000087d0
/scsi_vhci/ssd@g60060e80045878000000587800000087
9. c6t60060E80045878000000587800000084d0
/scsi_vhci/ssd@g60060e80045878000000587800000084
10. c6t60060E80045878000000587800000082d0
/scsi_vhci/ssd@g60060e80045878000000587800000082
11. c6t60060E80045878000000587800000080d0
/scsi_vhci/ssd@g60060e80045878000000587800000080
12. c6t60060E80045878000000587800000013d0
/scsi_vhci/ssd@g60060e80045878000000587800000013
13. c6t60060E80045878000000587800000012d0
/scsi_vhci/ssd@g60060e80045878000000587800000012
14. c6t60060E80045878000000587800000089d0
/scsi_vhci/ssd@g60060e80045878000000587800000089
Specify disk (enter its number):

After selecting the disk, select analyze

Specify disk (enter its number): 0
selecting c0t0d0
[disk formatted]

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
! – execute , then return
quit
format>

Perform a read only test

format> analyze

ANALYZE MENU:
read – read only test (doesn’t harm SunOS)
refresh – read then write (doesn’t harm data)
test – pattern testing (doesn’t harm data)
write – write then read (corrupts data)
compare – write, read, compare (corrupts data)
purge – write, read, write (corrupts data)
verify – write entire disk, then verify (corrupts data)
print – display data buffer
setup – set analysis parameters
config – show analysis parameters
! – execute , then return
quit
analyze>

Type read and go check which disk have the LED blinking. Before unplugging the disk, interrupt the test with CTRL+C

analyze> read
Ready to analyze (won’t harm SunOS). This takes a long time,
but is interruptable with CTRL-C. Continue? y

pass 0
^C 818/4/164 CTRL+C
Total of 0 defective blocks repaired.
analyze>

Quit format

analyze> quit

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
! – execute , then return
quit
format> quit

dmesg shows that the disk has been replaced

root@solaris10:/ # dmesg
Nov 24 05:00:01 solaris10 xntpd[10967]: [ID 266339 daemon.notice] using kernel phase-lock loop 0041, drift correction -239.18301
Nov 24 10:52:18 solaris10 scsi: [ID 107833 kern.warning] WARNING: /pci@780/pci@0/pci@9/scsi@0 (mpt0):
Nov 24 10:52:18 solaris10 scsi: [ID 107833 kern.warning] WARNING: /pci@780/pci@0/pci@9/scsi@0 (mpt0):
Nov 24 10:52:18 solaris10 mpt_handle_event_sync : SAS target 0 not responding.
Nov 24 10:52:18 solaris10 mpt_handle_event_sync : SAS target 0 not responding.
Nov 24 10:52:23 solaris10 SC Alert: [ID 209909 daemon.error] DISK at HDD0 has been removed.
Nov 24 10:52:23 solaris10 SC Alert: [ID 209909 daemon.error] DISK at HDD0 has been removed.
Nov 24 10:52:39 solaris10 scsi: [ID 107833 kern.warning] WARNING: /pci@780/pci@0/pci@9/scsi@0 (mpt0):
Nov 24 10:52:39 solaris10 scsi: [ID 107833 kern.warning] WARNING: /pci@780/pci@0/pci@9/scsi@0 (mpt0):
Nov 24 10:52:39 solaris10 mpt_handle_event_sync : SAS target 0 added.
Nov 24 10:52:39 solaris10 mpt_handle_event_sync : SAS target 0 added.
Nov 24 10:52:39 solaris10 scsi: [ID 107833 kern.warning] WARNING: /pci@780/pci@0/pci@9/scsi@0 (mpt0):
Nov 24 10:52:39 solaris10 scsi: [ID 107833 kern.warning] WARNING: /pci@780/pci@0/pci@9/scsi@0 (mpt0):
Nov 24 10:52:39 solaris10 wwn for target has changed
Nov 24 10:52:39 solaris10 wwn for target has changed
Nov 24 10:52:41 solaris10 SC Alert: [ID 735619 daemon.error] DISK at HDD0 has been inserted.
Nov 24 10:52:41 solaris10 SC Alert: [ID 735619 daemon.error] DISK at HDD0 has been inserted.

Force Solaris to rescan the disk. You can skip these steps

root@solaris10:/ # format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@780/pci@0/pci@9/scsi@0/sd@0,0
1. c0t1d0
/pci@780/pci@0/pci@9/scsi@0/sd@1,0
2. c6t60060E8004587800000058780000012Cd0
/scsi_vhci/ssd@g60060e8004587800000058780000012c
3. c6t60060E8004587800000058780000010Ed0 <HITACHI-OPEN-V*4-SUN-5009 cyl 48744 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000010e
4. c6t60060E8004587800000058780000012Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000012e
5. c6t60060E8004587800000058780000011Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000011e
6. c6t60060E8004587800000058780000011Fd0 <HITACHI-OPEN-V*2-SUN-5009 cyl 24371 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000011f
7. c6t60060E80045878000000587800000088d0
/scsi_vhci/ssd@g60060e80045878000000587800000088
8. c6t60060E80045878000000587800000087d0
/scsi_vhci/ssd@g60060e80045878000000587800000087
9. c6t60060E80045878000000587800000084d0
/scsi_vhci/ssd@g60060e80045878000000587800000084
10. c6t60060E80045878000000587800000082d0
/scsi_vhci/ssd@g60060e80045878000000587800000082
11. c6t60060E80045878000000587800000080d0
/scsi_vhci/ssd@g60060e80045878000000587800000080
12. c6t60060E80045878000000587800000013d0
/scsi_vhci/ssd@g60060e80045878000000587800000013
13. c6t60060E80045878000000587800000012d0
/scsi_vhci/ssd@g60060e80045878000000587800000012
14. c6t60060E80045878000000587800000089d0
/scsi_vhci/ssd@g60060e80045878000000587800000089
Specify disk (enter its number):

Select the disk 0 – c0t0d0

Specify disk (enter its number): 0
selecting c0t0d0
[disk formatted]

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
! – execute , then return
quit
format>

Select type and Auto configure

format> t

AVAILABLE DRIVE TYPES:
0. Auto configure
1. Quantum ProDrive 80S
2. Quantum ProDrive 105S
3. CDC Wren IV 94171-344
4. SUN0104
5. SUN0207
6. SUN0327
7. SUN0340
8. SUN0424
9. SUN0535
10. SUN0669
11. SUN1.0G
12. SUN1.05
13. SUN1.3G
14. SUN2.1G
15. SUN2.9G
16. Zip 100
17. Zip 250
18. Peerless 10GB
19. SUN72G
20. FUJITSU-MAY2073RCSUN72G-0501
21. HITACHI-OPEN-V-SUN-5009
22. HITACHI-OPEN-V*2-SUN-5009
23. HITACHI-OPEN-V*4-SUN-5009
24. other
Specify disk type (enter its number)[19]: 0
c0t0d0: configured with capacity of 68.35GB

selecting c0t0d0
[disk formatted]
format> label
Ready to label disk, continue? y

format> quit

Verifying disk partition

root@solaris10:/ # format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@780/pci@0/pci@9/scsi@0/sd@0,0
1. c0t1d0
/pci@780/pci@0/pci@9/scsi@0/sd@1,0
2. c6t60060E8004587800000058780000012Cd0
/scsi_vhci/ssd@g60060e8004587800000058780000012c
3. c6t60060E8004587800000058780000010Ed0 <HITACHI-OPEN-V*4-SUN-5009 cyl 48744 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000010e
4. c6t60060E8004587800000058780000012Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000012e
5. c6t60060E8004587800000058780000011Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000011e
6. c6t60060E8004587800000058780000011Fd0 <HITACHI-OPEN-V*2-SUN-5009 cyl 24371 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000011f
7. c6t60060E80045878000000587800000088d0
/scsi_vhci/ssd@g60060e80045878000000587800000088
8. c6t60060E80045878000000587800000087d0
/scsi_vhci/ssd@g60060e80045878000000587800000087
9. c6t60060E80045878000000587800000084d0
/scsi_vhci/ssd@g60060e80045878000000587800000084
10. c6t60060E80045878000000587800000082d0
/scsi_vhci/ssd@g60060e80045878000000587800000082
11. c6t60060E80045878000000587800000080d0
/scsi_vhci/ssd@g60060e80045878000000587800000080
12. c6t60060E80045878000000587800000013d0
/scsi_vhci/ssd@g60060e80045878000000587800000013
13. c6t60060E80045878000000587800000012d0
/scsi_vhci/ssd@g60060e80045878000000587800000012
14. c6t60060E80045878000000587800000089d0
/scsi_vhci/ssd@g60060e80045878000000587800000089
Specify disk (enter its number):

Selecting disk c0t0d0

Specify disk (enter its number): 0
selecting c0t0d0
[disk formatted]

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
! – execute , then return
quit
format> p

Printing disk partitions

PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
! – execute , then return
quit
partition> p

The most important thing to check is disk slice 2 – backup

Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 25 129.19MB (26/0/0) 264576
1 swap wu 26 – 51 129.19MB (26/0/0) 264576
2 backup wu 0 – 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 52 – 14086 68.10GB (14035/0/0) 142820160
7 unassigned wm 0 0 (0/0/0) 0

Check the other mirror side – c0t1d0

format> disk

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@780/pci@0/pci@9/scsi@0/sd@0,0
1. c0t1d0
/pci@780/pci@0/pci@9/scsi@0/sd@1,0
2. c6t60060E8004587800000058780000012Cd0
/scsi_vhci/ssd@g60060e8004587800000058780000012c
3. c6t60060E8004587800000058780000010Ed0 <HITACHI-OPEN-V*4-SUN-5009 cyl 48744 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000010e
4. c6t60060E8004587800000058780000012Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000012e
5. c6t60060E8004587800000058780000011Ed0
/scsi_vhci/ssd@g60060e8004587800000058780000011e
6. c6t60060E8004587800000058780000011Fd0 <HITACHI-OPEN-V*2-SUN-5009 cyl 24371 alt 2 hd 15 sec 512>
/scsi_vhci/ssd@g60060e8004587800000058780000011f
7. c6t60060E80045878000000587800000088d0
/scsi_vhci/ssd@g60060e80045878000000587800000088
8. c6t60060E80045878000000587800000087d0
/scsi_vhci/ssd@g60060e80045878000000587800000087
9. c6t60060E80045878000000587800000084d0
/scsi_vhci/ssd@g60060e80045878000000587800000084
10. c6t60060E80045878000000587800000082d0
/scsi_vhci/ssd@g60060e80045878000000587800000082
11. c6t60060E80045878000000587800000080d0
/scsi_vhci/ssd@g60060e80045878000000587800000080
12. c6t60060E80045878000000587800000013d0
/scsi_vhci/ssd@g60060e80045878000000587800000013
13. c6t60060E80045878000000587800000012d0
/scsi_vhci/ssd@g60060e80045878000000587800000012
14. c6t60060E80045878000000587800000089d0
/scsi_vhci/ssd@g60060e80045878000000587800000089
Specify disk (enter its number)[0]: 1

Check disk partition

selecting c0t1d0
[disk formatted]
format> p

PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
! – execute , then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 5031 24.42GB (5032/0/0) 51205632
1 swap wu 5032 – 9153 20.00GB (4122/0/0) 41945472
2 backup wm 0 – 14086 68.35GB (14087/0/0) 143349312
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 0 0 (0/0/0) 0
5 var wm 9154 – 13951 23.28GB (4798/0/0) 48824448
6 unassigned wm 13952 – 14055 516.75MB (104/0/0) 1058304
7 unassigned wm 14056 – 14086 154.03MB (31/0/0) 315456

partition>

Compare partition table for the two disks. Both have the same block number
====================================================================================================

partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 25 129.19MB (26/0/0) 264576
1 swap wu 26 – 51 129.19MB (26/0/0) 264576
2 backup wu 0 – 14086 68.35GB ( 14087/0/0) 143349312
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 52 – 14086 68.10GB (14035/0/0) 142820160
7 unassigned wm 0 0 (0/0/0) 0

partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 5031 24.42GB (5032/0/0) 51205632
1 swap wu 5032 – 9153 20.00GB (4122/0/0) 41945472
2 backup wm 0 – 14086 68.35GB ( 14087/0/0) 143349312
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 0 0 (0/0/0) 0
5 var wm 9154 – 13951 23.28GB (4798/0/0) 48824448
6 unassigned wm 13952 – 14055 516.75MB (104/0/0) 1058304
7 unassigned wm 14056 – 14086 154.03MB (31/0/0) 315456

====================================================================================================

Even if the brand is different, same number of blocks, proceeding

0. c0t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@780/pci@0/pci@9/scsi@0/sd@0,0
1. c0t1d0 <FUJITSU-MAY2073RCSUN72G-0501 cyl 14087 alt 2 hd 24 sec 424>
/pci@780/pci@0/pci@9/scsi@0/sd@1,0

Copying disk partitioning to the newly inserted disk

root@solaris10:/ # prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s – /dev/rdsk/c0t0d0s2
fmthard: New volume table of contents now in place.

Now c0t0d0 have the same partitions as c0t1d0

partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 5031 24.42GB (5032/0/0) 51205632
1 swap wu 5032 – 9153 20.00GB (4122/0/0) 41945472
2 backup wm 0 – 14086 68.35GB (14087/0/0) 143349312
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 0 0 (0/0/0) 0
5 var wm 9154 – 13951 23.28GB (4798/0/0) 48824448
6 unassigned wm 13952 – 14055 516.75MB (104/0/0) 1058304
7 unassigned wm 14056 – 14086 154.03MB (31/0/0) 315456

Recreating metadevice state database

root@solaris10:/ # metadb -a -f -c3 c0t0d0s7
root@solaris10:/ # metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c0t1d0s7
a p luo 8208 8192 /dev/dsk/c0t1d0s7
a p luo 16400 8192 /dev/dsk/c0t1d0s7
a u 16 8192 /dev/dsk/c0t0d0s7
a u 8208 8192 /dev/dsk/c0t0d0s7
a u 16400 8192 /dev/dsk/c0t0d0s7

Recreating metadevices

root@solaris10:/ # metainit d11 1 1 c0t0d0s0
d11: Concat/Stripe is setup
root@solaris10:/ # metainit d21 1 1 c0t0d0s1
d21: Concat/Stripe is setup
root@solaris10:/ # metainit d31 1 1 c0t0d0s5
d31: Concat/Stripe is setup
root@solaris10:/ # metainit d41 1 1 c0t0d0s6
d41: Concat/Stripe is setup

Reattaching metadevices

root@solaris10:/ # metattach d10 d11
d10: submirror d11 is attached
root@solaris10:/ # metattach d20 d21
d20: submirror d21 is attached
root@solaris10:/ # metattach d30 d31
d30: submirror d31 is attached
root@solaris10:/ # metattach d40 d41
d40: submirror d41 is attached

Checking status

root@solaris10:/ # metastat -c
d40 m 516MB d42 d41 (resync-1%)
d42 s 516MB c0t1d0s6
d41 s 516MB c0t0d0s6
d20 m 20GB d22 d21 (resync-0%)
d22 s 20GB c0t1d0s1
d21 s 20GB c0t0d0s1
d30 m 23GB d32 d31 (resync-0%)
d32 s 23GB c0t1d0s5
d31 s 23GB c0t0d0s5
d10 m 24GB d12 d11 (resync-0%)
d12 s 24GB c0t1d0s0
d11 s 24GB c0t0d0s0

Setup a SVM mirror in Solaris 10

In a Solaris server there are two local disks

root@solaris10:~ # echo | format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@0,600000/pci@0/scsi@1/sd@0,0
1. c0t1d0
/pci@0,600000/pci@0/scsi@1/sd@1,0
Specify disk (enter its number): Specify disk (enter its number):

Specify disk (enter its number): 1

Verify partition table

selecting c0t1d0
[disk formatted]

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
!<cmd> – execute , then return
quit
format> p

Display disk partitions

PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
!<cmd> – execute , then return
quit
partition> p

Partition 0 is /
Partition 1 is swap
Partition 3 is /var
Partition 7 is where metadevice state database

Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 2061 – 4121 20.00GB (2061/0/0) 41945472
1 swap wu 4122 – 10716 64.00GB (6595/0/0) 134221440
2 backup wm 0 – 14086 136.71GB (14087/0/0) 286698624
3 var wm 0 – 2060 20.00GB (2061/0/0) 41945472
4 unassigned wm 10717 – 11026 3.01GB (310/0/0) 6309120
5 unassigned wm 11027 – 11233 2.01GB (207/0/0) 4212864
6 usr wm 11234 – 11749 5.01GB (516/0/0) 10501632
7 unassigned wm 11750 – 11755 59.62MB (6/0/0) 122112

partition>

Checking metadevice state database

root@solaris10:~ # metadb
metadb: solaris10: there are no existing databases

In the example below I’m going to create three copies on partition 7 of disk c0t1d0

root@solaris10:~ # metadb -a -f -c3 /dev/dsk/c0t1d0s7

Checking metadevice state database

root@solaris10:~ # metadb
flags first blk block count
a u 16 8192 /dev/dsk/c0t1d0s7
a u 8208 8192 /dev/dsk/c0t1d0s7
a u 16400 8192 /dev/dsk/c0t1d0s7

Creating the metadevice with disk partitions

root@solaris10:~ # metainit -f d12 1 1 c0t1d0s0
d12: Concat/Stripe is setup
root@solaris10:~ # metainit -f d22 1 1 c0t1d0s1
d22: Concat/Stripe is setup
root@solaris10:~ # metainit -f d32 1 1 c0t1d0s3
d32: Concat/Stripe is setup

Metadevices created

root@solaris10:~ # metastat -p
d32 1 1 c0t1d0s3
d22 1 1 c0t1d0s1
d12 1 1 c0t1d0s0

Setting up Solaris Volume Manager mirror.

root@solaris10:~ # metainit d10 -m d12
d10: Mirror is setup

Setting up to boot with the mirror

root@solaris10:~ # metaroot d10

Setting up the rest of metadevices as mirror as well

root@solaris10:~ # metainit d30 -m d32
d30: Mirror is setup

root@solaris10:~ # metainit d20 -m d22
d20: Mirror is setup

Checking the status

root@solaris10:~ # metastat -p
d20 -m d22 1
d22 1 1 c0t1d0s1
d30 -m d32 1
d32 1 1 c0t1d0s3
d10 -m d12 1
d12 1 1 c0t1d0s0

root@solaris10:~ # shutdown -y -g0 -i0

After the reboot, check if the server is using the metadevice using df -h

Then create the metadevices for the other side of the mirror and attach them

metainit -f d11 1 1 c0t0d0s0
metainit -f d21 1 1 c0t0d0s1
metainit -f d31 1 1 c0t0d0s3

metattach d10 d11
metattach d20 d21
metattach d30 d31

Create the database replicas on the other disk as well

metadb -a -f -c3 /dev/dsk/c0t0d0s7