How to break mirror disk using SVM



Prerequisite-Step Work
=================

Run the explorer tool
# cd /opt/SUNWexplo/bin
# ./explorer

Capture the following output files
# cp -p /etc/vfstab /etc/vfstab.backup
# cp -p /etc/system /etc/system.backup
# cat netstat -rn
# dk -h
# echo|format
# eeprom
# cfgadm -al
# raidctl
# ifconfig -a
# prtdiag -v | more
# metadb -i
# metastat -p
# metastat
# metastat -s ahc590 -p
# metaset -s ahc590


Implementation Step
-------------------

Inform database and application team to shutdown the services

Use console access method and verify the root password

Follow the step as below
# metastat -p
d35 -m d15 d25 1
d15 1 1 c0t0d0s3
d25 1 1 c0t2d0s3
d34 -m d14 d24 1
d14 1 1 c0t0d0s6
d24 1 1 c0t2d0s6
d33 -m d13 d23 1
d13 1 1 c0t0d0s5
d23 1 1 c0t2d0s5
d32 -m d12 d22 1
d12 1 1 c0t0d0s4
d22 1 1 c0t2d0s4
d36 -m d16 d26 1
d16 1 1 c0t0d0s1
d26 1 1 c0t2d0s1
d31 -m d11 d21 1
d11 1 1 c0t0d0s0
d21 1 1 c0t2d0s0

Make sure the OS disk mirroring completed

Detach the mirror disk (c0t2d0) as below
# metadetach d35 d25
# metadetach d34 d24
# metadetach d33 d23
# metadetach d32 d22
# metadetach d36 d26
# metadetach d31 d21

Run file system check the detached mirrors
# fsck /dev/md/rdsk/d25
# fsck /dev/md/rdsk/d24
# fsck /dev/md/rdsk/d23
# fsck /dev/md/rdsk/d22
# fsck /dev/md/rdsk/d26
# fsck /dev/md/rdsk/d21
Notes: d25 and d26 are swap volume and fsck is not necessary

Mount the root file system c0t2d0s0(d21)
# mount /dev/md/dsk/d21 /mnt

Remove following line from /mnt/etc/system
# vi /mnt/etc/system
rootdev:/pseudo/md@0:0,31,blk
- save and exit

Change following lines in /mnt/etc/vfstab and remove the hash from the lines and comment out the metadevice
# vi /mnt/etc/vfstab
---
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -

#/dev/dsk/c0t0d0s1 - - swap - no -
/dev/md/dsk/d36 - - swap - no -
/dev/md/dsk/d35 - - swap - no -
#/dev/dsk/c0t0d0s3 - - swap - no -
/dev/md/dsk/d31 /dev/md/rdsk/d31 / ufs 1 no -
#/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 1 no -
/dev/md/dsk/d32 /dev/md/rdsk/d32 /var ufs 1 no -
#/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /home ufs 2 yes -
/dev/md/dsk/d34 /dev/md/rdsk/d34 /home ufs 2 yes -
#/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /opt ufs 2 yes -
/dev/md/dsk/d33 /dev/md/rdsk/d33 /opt ufs 2 yes -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -

- change to

device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -

/dev/dsk/c0t2d0s1 - - swap - no -
#/dev/md/dsk/d36 - - swap - no -
#/dev/md/dsk/d35 - - swap - no -
/dev/dsk/c0t2d0s3 - - swap - no -
/dev/dsk/c0t2d0s0 /dev/rdsk/c0t2d0s0 / ufs 1 no -
#/dev/md/dsk/d31 /dev/md/rdsk/d31 / ufs 1 no -
/dev/dsk/c0t2d0s4 /dev/rdsk/c0t2d0s4 /var ufs 1 no -
#/dev/md/dsk/d32 /dev/md/rdsk/d32 /var ufs 1 no -
/dev/dsk/c0t2d0s6 /dev/rdsk/c0t2d0s6 /home ufs 2 yes -
#/dev/md/dsk/d34 /dev/md/rdsk/d34 /home ufs 2 yes -
/dev/dsk/c0t2d0s5 /dev/rdsk/c0t2d0s5 /opt ufs 2 yes -
#/dev/md/dsk/d33 /dev/md/rdsk/d33 /opt ufs 2 yes -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -

Unmount /mnt after /mnt/etc/vfstab edited
# umount /mnt

Check the eeprom before reboot"
# eeprom

Create nvalias for boot-device and use device name rootdisk, mirrordisk and change parameter use-nvramrc to true
# eeprom "use-nvramrc?=true"
# eeprom nvramrc="devalias rootdisk /pci@400/pci@0/pci@1/scsi@0/disk@0,0:a devalias mirrordisk /pci@400/pci@0/pci@1/scsi@0/sd@2,0:a"
# eeprom "boot-device=rootdisk mirrordisk"

Shutdown the containers and follow the step as below
# zoneadm -z ahc594 halt

Check the zones status and ensure the zones are in "installed" state
# zoneadm list -vc

Shutdown global server
# shutdown -y -g0 -i0

Perform test boot from mirror disk
ok> boot mirrordisk

Once the system come up, you will see root devices dev/dsk/c0t2d0s0 and other devices as well
# df -h
# prtconf -vp | grep bootpath

Verify all the file systems and the containers
# df -h | grep
# zoneadm list -cv


Shutdown the containers and follow the step as below
# zoneadm -z ahc594 halt



Check the container status and ensure all the zones are in "installed" state
# zoneadm list -vc


Shutdown the Global and boot from rootdisk
# shutdown -y -g0 -i0
ok> boot rootdisk

Once Global boot up successfully, verify boot disk, file system and containers