Stuf I have found to work over the years
Prep work - Backup the entire system :
Flar , ufsdump , networker , etc
I find flar the fastest as it will give you an option for complete recovery in the event of a total abort
a good practice is to copy your /etc/system file somewhere save , I would also grab the metastat -p , metastat , metadb and eeprom , outputs and keep them off the machine
metastat -p |mailx -s "meta db for target x" me@company
repeat for any metasets !
and while we are at it .. grab the /etc/lvm directory too!
Verify Quorum flag in /etc/system
set md:mirrored_root_flag=1
backup metadb's
metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s3
a p luo 8208 8192 /dev/dsk/c1t0d0s3
a p luo 16 8192 /dev/dsk/c1t0d0s4
a p luo 8208 8192 /dev/dsk/c1t0d0s4
a p luo 16 8192 /dev/dsk/c1t1d0s4
a p luo 8208 8192 /dev/dsk/c1t1d0s4
dd if=/dev/rdsk/c1t0d0s3 of=/<path>/metadb.c1t0d0s3 bs=2048k
dd if=/dev/rdsk/c1t0d0s4 of=/<path>/metadb.c1t0d0s4 bs=2048k
dd if=/dev/rdsk/c1t1d0s3 of=/<path>/metadb.c1t1d0s3 bs=2048k
DETACH ROOT MIRROR DISK
Check which is the root meta device: df –k /
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d10 66419890 8134395 57621297 13% /
# metastat -p d10
a grab the second copy
# metadetach d10 d12
d10: submirror d12 is detached
verify with a metastat command the detach successful
remove disk from metadb
# metadb -d /dev/dsk/c1t1d0s7
You are now ready to patch , i find localcopy to work best as Solaris 10 had some issues wth patching accross nfs!
Patching is Successful
resilver the submirror
# metattach d10 d12
Add disk back into metadb
# metadb -a -c3 /dev/dsk/c1t1d0s7
resilver will take a while , you can monitor in the usual way
DISASTER - Patching has Failed , total recal required
(you need to back out the patches patchrm them one by one)
Boot using corrupt/patched environment. If the patched environment is not bootable, boot using net , cdrom.
now mount the basic device file from the old mirror disk and replace the rootdev entry in the /etc/system file (remember to edit the correct etc/system file)
vi system
details are from your saved eeprom outputs!
The details of below can be seen in step 3 output (add whatever 100,blk comes after the disk id)
example :
rootdev:/pseudo/md@0:0,100,blk
change to:
rootdev:/ssm@0,0/pci@18,600000/scsi@2/disk@1,0:a,100,blk
revert your vfstab back to pre svm
Replace disk entries of / with the new disk (comment out the original and make a copy with the following)
/dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no logging
change to
/dev/dsk/c1t1d0s0 /dev/rdsk/c1t1d0s0 / ufs 1 no logging
lockfs -fa;sync;sync;reboot
now boot from your mirror disk
if there are any remaning metadevices remove them
system will now be in a svm less pre patch state
rebuild the svm state from scratch using the now new boot disk as the primary mirror drive
Recover Metadb from backup
if all copies of the metadb have a problem, use dd to restore the dd backup.
Example:
dd if= /opt/sun/sdsbackup/metadb.c0t0d0s7.dd of=/dev/rdsk/c0t0d0s7 bs=2048k