cancel
Showing results for 
Search instead for 
Did you mean: 

rootdisk associated with the wrong disk

Veritas_Novice
Level 2
Here is the vxdisk list output:

DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 sliced - - online
c1t1d0s2 sliced rootdisk rootdg online

I want the disk c1t0d0s2 to be my rootdisk and c1t1d0s2 to be my rootmirror. What are the proper steps to fix this ? I would like to prevent having to rebuild the system.
3 REPLIES 3

Tyler_Robinson
Level 2
It's kind of a complicated process, but what you need to do is establish a true mirror of the root disk on your spare disk (nameing the spare/mirror something). Then, once you've established that you have a true mirror, you need to break the plexes, and remove the rootdisk from the disk group. Change the name of the current disk (spare/mirror) to rootdisk. then reinitialize the old root disk as a new disk in the disk group.

what version of vxvm are you running?

Veritas_Novice
Level 2
I am using version 3.5.

Tyler_Robinson
Level 2
Here is the procedure that I use to fix broken mirrors. There might be some troubleshooting along the way, but for the most part this is what you will need to do.

** NOTE ** - read completely through before completeing!

Run the following script to mirror the rootdisk as rootmirror.


#!/usr/bin/bash
#
# Name:vxremirror
# Version:4.1
# Release:3
# Written By:Tyler Robinson
# Date:11/17/2005
# Description: This script initializes and mirrors a new disk under Veritas VxVM.

vxdctl enable

vxdisk list | grep rootdisk > /dev/null; diskStatus=$?

if ; then
primaryDiskName="rootmirror"
mirrorDiskName="rootdisk"
primaryDisk="`/usr/sbin/vxdisk list | grep -v rootdisk | tail -1 | cut -ds -f1 | cut -b1-6`"
mirrorDisk="`/usr/sbin/vxdisk list | grep -v rootmirror | tail -1 | cut -ds -f1 | cut -b1-6`"
else
primaryDiskName="rootdisk"
mirrorDiskName="rootmirror"
primaryDisk="`/usr/sbin/vxdisk list | grep -v rootmirror | tail -1 | cut -ds -f1 | cut -b1-6`"
mirrorDisk="`/usr/sbin/vxdisk list | grep -v rootdisk | tail -1 | cut -ds -f1 | cut -b1-6`"
fi

echo "PrimaryDisk=${primaryDisk}"
echo "MirrorDisk=${mirrorDisk}"
echo "MirrorDiskName=${mirrorDiskName}"

VXDISKSETUP=/usr/lib/vxvm/bin/vxdisksetup

FORMAT="`vxdisk -g rootdg list ${primaryDisk} | grep "info:" | awk -F, '{print $1}' | cut -d= -f2`"
PUBSLICE="`vxdisk -g rootdg list ${primaryDisk} | grep "info:" | awk -F, '{print $3}' | cut -d= -f2`"
PRIVSLICE="`vxdisk -g rootdg list ${primaryDisk} | grep "info:" | awk -F, '{print $4}' | cut -d= -f2`"
PRIVLEN="`vxdisk -g rootdg list ${primaryDisk} | grep "private:" | awk '{print $4}' | cut -d= -f2`"

echo "Initializing the ${mirrorDiskName} disk."
${VXDISKSETUP} -f -i ${mirrorDisk} format=${FORMAT} pubslice=${PUBSLICE} \
privslice=${PRIVSLICE} privlen=${PRIVLEN} noreserve noconfig; setupStatus=$?

if ; then
echo "Error: Failed to initialize the mirror disk ${mirrorDisk}...aborting!"
exit ${setupStatus}
fi


Once the mirroring is complete, follow steps below:

vxprint | grep ^pl | grep '\-01' #(these are the plexes that needs to be broken)
vxplex -g rootdg dis rootvol-01 swapvol-01
vxedit -g rootdg -fr rm rootvol-01 swapvol-01

vxdg -g rootdg rmdisk rootdisk
vxdisk rm c1t1d0s2

vxedit -g rootdg rename rootmirror rootdisk

** Re-run above script for new remirroring **

If your not comfortable with the following procedure, I would suggest that you do this on a test box first.