March 5, 2008

Mirror Available On Solaris 10

————-SNIP————
#!/bin/sh
#Mirrorme.sh
prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s – /dev/rdsk/c1t1d0s2
metadb -a -f -c2 /dev/dsk/c1t0d0s3 /dev/dsk/c1t1d0s3
metadb -a -f -c2 /dev/dsk/c1t0d0s4 /dev/dsk/c1t1d0s4 (UPDATED “Problems With Multiple MetaDB Partitions“)

# / Filesystem
metainit -f d10 1 1 c1t0d0s0
metainit d20 1 1 c1t1d0s0
metainit d30 -m d10
metaroot d30

# Swap Filesystem
metainit -f d11 1 1 c1t0d0s1
metainit d21 1 1 c1t1d0s1
metainit d31 -m d11

# /usr filesystem:
metainit -f d12 1 1 c1t0d0s5
metainit d22 1 1 c1t1d0s5
metainit d32 -m d12

# /var filesystem:
metainit -f d13 1 1 c1t0d0s6
metainit d23 1 1 c1t1d0s6
metainit d33 -m d13

# /opt filesystem:
metainit -f d14 1 1 c1t0d0s7
metainit d24 1 1 c1t1d0s7
metainit d34 -m d14
metainit hsp001

echo “Do a lockfs -fa, and then an init 6?
————-SNIP————
If you are unsure of what these commands are doing, please read the man pages on them. Change the drive and controller numbers based on your server, run this script, and reboot the system.
After the system has come back up, it’s time to attach the mirror partitions to the metadevices. This next script will take care of that for you.

————-SNIP————
#!/bin/sh
#Mirrormemore.sh
metattach d30 d20
metattach d31 d21
metattach d32 d22
metattach d33 d23
metattach d34 d24

echo “Don’t forget to make the new mirror bootable”echo ” # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0?echo “Making darn sure this is pointed towards the mirror drive!”
————-SNIP————