One of my pet peeves has been with Sun’s smaller sparc based servers not having simple onboard raid1 mirroring for their boot drives. You have to muck around with a great number of prone-to-fumble-finger commands to both build the mirror, and to recover if one of the two drives goes down.
Compare to what HP (Dell, IBM and even Sun on their x86 kit) have done for years. Hardware mirroring available via a bios setting. Set it and forget it.
Drive goes bad? Pull out the one with the fault LED lit, put new one in, walk away.
Cloning a new system? Bring the master system down cleanly, replace one drive with a blank, power it on. Wait 10 min for the mirror to rebuild.
Once you are happy that the master is 100% mirrored, go to your new machine and insert just the drive from the master. Boot to single-user and fix the hostname/ip/etc. Go multiuser. Insert a blank in the other bay. Watch it mirror.
Really fall-off-log simple and something Sun needs for their sparc systems.
Now, I have to get back to recovering a Sun V210 that had one of it’s two boot disks go bad.
Hope I don’t fuck it up; It’s a live system.
Update: I appear to have successfully initiated the rebuild.
Logs follow :
http://sysunconfig.net/unixtips/Disk.Replacement.Procedure-SDS4.2.pdf
c1t1d0 is the bad disk
c1t0d0 is the good disk and has this configuration
Part Tag Flag Cylinders Size Blocks
0 root wm 207 - 1237 5.00GB (1031/0/0) 10491456
1 swap wu 0 - 206 1.00GB (207/0/0) 2106432
2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 1238 - 1239 9.94MB (2/0/0) 20352
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 1240 - 14086 62.34GB (12847/0/0) 130731072
------------------------------------------------------------
bash-3.00# metastat
d30: Mirror
Submirror 0: d31
State: Needs maintenance
Submirror 1: d32
State: Needs maintenance
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 130731072 blocks (62 GB)
d31: Submirror of d30
State: Needs maintenance
Invoke: metasync d30
Size: 130731072 blocks (62 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s7 0 No Okay Yes
d32: Submirror of d30
State: Needs maintenance
Invoke: metareplace d30 c1t1d0s7
Size: 130731072 blocks (62 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s7 0 No Maintenance Yes
d20: Mirror
Submirror 0: d21
State: Needs maintenance
Submirror 1: d22
State: Needs maintenance
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2106432 blocks (1.0 GB)
d21: Submirror of d20
State: Needs maintenance
Invoke: metasync d20
Size: 2106432 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s1 0 No Okay Yes
d22: Submirror of d20
State: Needs maintenance
Invoke: metareplace d20 c1t1d0s1
Size: 2106432 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s1 0 No Maintenance Yes
d10: Mirror
Submirror 0: d11
State: Needs maintenance
Submirror 1: d12
State: Needs maintenance
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 10491456 blocks (5.0 GB)
d11: Submirror of d10
State: Needs maintenance
Invoke: metasync d10
Size: 10491456 blocks (5.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s0 0 No Okay Yes
d12: Submirror of d10
State: Needs maintenance
Invoke: metareplace d10 c1t1d0s0
Size: 10491456 blocks (5.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Maintenance Yes
Device Relocation Information:
Device Reloc Device ID
c1t0d0 Yes id1,sd@SFUJITSU_MAP3735N_SUN72G_00Q0FHNW____
————————————————————
bash-3.00# metastat -p
d30 -m d31 d32 1
d31 1 1 c1t0d0s7
d32 1 1 c1t1d0s7
d20 -m d21 d22 1
d21 1 1 c1t0d0s1
d22 1 1 c1t1d0s1
d10 -m d11 d12 1
d11 1 1 c1t0d0s0
d12 1 1 c1t1d0s0
————————————————————
bash-3.00# metadb -i
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s3
a p luo 8208 8192 /dev/dsk/c1t0d0s3
r - replica does not have device relocation information
o - replica active prior to last mddb configuration change
u - replica is up to date
l - locator for this replica was read successfully
c - replica’s location was in /etc/lvm/mddb.cf
p - replica’s location was patched in kernel
m - replica is master, this is replica selected as input
W - replica has device write errors
a - replica is active, commits are occurring to this replica
M - replica had problem with master blocks
D - replica had problem with data blocks
F - replica had format problems
S - replica is too small to hold current data base
R - replica had device read errors
————————————————————
bash-3.00# dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t1d0s2 count=16
c1t0d0
Part Tag Flag Cylinders Size Blocks
0 root wm 207 - 1237 5.00GB (1031/0/0) 10491456
1 swap wu 0 - 206 1.00GB (207/0/0) 2106432
2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 1238 - 1239 9.94MB (2/0/0) 20352
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 1240 - 14086 62.34GB (12847/0/0) 130731072
c1t1d0
Part Tag Flag Cylinders Size Blocks
0 root wm 207 - 1237 5.00GB (1031/0/0) 10491456
1 swap wu 0 - 206 1.00GB (207/0/0) 2106432
2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 1238 - 1239 9.94MB (2/0/0) 20352
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 1240 - 14086 62.34GB (12847/0/0) 130731072
————————————————————
bash-3.00# metadb -i
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s3
a p luo 8208 8192 /dev/dsk/c1t0d0s3
bash-3.00# metadb -a -f -c 2 /dev/dsk/c1t1d0s3
bash-3.00# metadb -i
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s3
a p luo 8208 8192 /dev/dsk/c1t0d0s3
a u 16 8192 /dev/dsk/c1t1d0s3
a u 8208 8192 /dev/dsk/c1t1d0s3
r - replica does not have device relocation information
o - replica active prior to last mddb configuration change
u - replica is up to date
l - locator for this replica was read successfully
c - replica’s location was in /etc/lvm/mddb.cf
p - replica’s location was patched in kernel
m - replica is master, this is replica selected as input
W - replica has device write errors
a - replica is active, commits are occurring to this replica
M - replica had problem with master blocks
D - replica had problem with data blocks
F - replica had format problems
S - replica is too small to hold current data base
R - replica had device read errors
————————————————————
bash-3.00# metastat | grep replace
Invoke: metareplace d30 c1t1d0s7
Invoke: metareplace d20 c1t1d0s1
Invoke: metareplace d10 c1t1d0s0
bash-3.00# metareplace -e d30 c1t1d0s7
metareplace: pod11fw: d30: resync in progress
bash-3.00# metareplace -e d20 c1t1d0s1
metareplace: pod11fw: d20: resync in progress
bash-3.00# metareplace -e d10 c1t1d0s0
metareplace: pod11fw: d10: resync in progress
————————————————————
bash-3.00# metasync d30
bash-3.00# metasync d20
bash-3.00# metasync d10
bash-3.00# metareplace -e d30 c1t1d0s7
d30: device c1t1d0s7 is enabled
bash-3.00# metareplace -e d20 c1t1d0s1
d20: device c1t1d0s1 is enabled
bash-3.00# metareplace -e d10 c1t1d0s0
d10: device c1t1d0s0 is enabled
————————————————————
bash-3.00# metastat | grep -i progress
Resync in progress: 2 % done
Resync in progress: 75 % done
Resync in progress: 10 % done
I’d really rather have simple hardware mirroring instead of the above bullshit.