Thursday, May 7, 2009

disk mirror

#!/bin/sh

BOOT_DISK=c1t0d0
MIRROR_DISK=c1t1d0
METAINIT=/usr/sbin/metainit
METAROOT=/usr/sbin/metaroot

# Slice 0 (root slice)
$METAINIT -f d10 1 1 ${BOOT_DISK}s0
$METAINIT -f d20 1 1 ${MIRROR_DISK}s0
$METAINIT d30 -m d10
$METAROOT d30

# Slice 1
$METAINIT -f d11 1 1 ${BOOT_DISK}s1
$METAINIT -f d21 1 1 ${MIRROR_DISK}s1
$METAINIT d31 -m d11

# Slice 2 will not be mirrored (represents entire disk)

# Slice 3 is initially commented out; slice containing DiskSuite
# database replicas in our environment
#$METAINIT -f d13 1 1 ${BOOT_DISK}s3
#$METAINIT -f d23 1 1 ${MIRROR_DISK}s3
#$METAINIT d33 -m d13

# Slice 4
$METAINIT -f d14 1 1 ${BOOT_DISK}s4
$METAINIT -f d24 1 1 ${MIRROR_DISK}s4
$METAINIT d34 -m d14

# Slice 5
$METAINIT -f d15 1 1 ${BOOT_DISK}s5
$METAINIT -f d25 1 1 ${MIRROR_DISK}s5
$METAINIT d35 -m d15

# Slice 6
$METAINIT -f d16 1 1 ${BOOT_DISK}s6
$METAINIT -f d26 1 1 ${MIRROR_DISK}s6
$METAINIT d36 -m d16

# Slice 7
#$METAINIT -f d17 1 1 ${BOOT_DISK}s7
#$METAINIT -f d27 1 1 ${MIRROR_DISK}s7
#$METAINIT d37 -m d17

# Make the mirror disk bootable
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/${MIRROR_DISK}s0

No comments:

Post a Comment