SVM Disk Replacement Worksheet_good 1
metastat -c (look for “maint” status)
Make sure all (maint) slices are on same drive (all maint entries are on same cxtxdx), if not, call support before proceeding.
Identify mirrors (m) and submirrors (s)
Affected Mirrors
Identify metadb copies
metadb -i |grep -I cxtxdx (use name of disk to be replaced here)
How many copies? ______ (count number of times the disk you are replacing is listed in the output from the metadb -i command)
What slice are they on? ______ (the s value from the metadb -i command)
You will now delete the meta database copies from the old drive.
metadb -d cxtxdxsx (Use the cxtxdxsx value seen in the metadb -i output)
Identify the type of drive you are replacing (circle one) Fiber SCSI/SAS
For Fiber drives use luxadm to remove and insert the drive.
IMPORTANT NOTE:
You will need to remove the disk from SVM control completely before running the luxadm commands.
metadetach
Repeat the above command until all submirrors are detached from the mirrors. (run metastat -c and see all mirrors now show only one submirror and that they are not in maintenance state)
metaclear
Once all metadevices tied to the disk to be replaced are gone, you can then tell the system that the disk will be removed.
luxadm remove_device /dev/rdsk/cxtxdxs2 (use the cxtxdx value of the disk being replaced) then press Enter
Pull disk when prompted and press Enter.
luxadm insert_device then press Enter.
Physically insert the drive and press Enter.
Run echo |format to verify the new disk is seen.
Make sure that the disk has a valid label on it.
format
Select the number for the disk you just replaced.
It will bring up the format menu for the disk. If the drive needs to be labeled, it will state so now. (Answer “Y” if prompted “do you want to do this now”) If not prompted to label the disk, simply type “q” to exit until you are back at the command prompt.
Now you can copy the VTOC from the “good” half of the mirror to the new disk.
prtvtoc /dev/rdsk/cxtxdxs2 (of_good_disk) |fmthard -s - /dev/rdsk/cxtxdxs2 (of_new_disk)
You should see a statement “Table of contents now in place”
You can now put your state database copies back onto the disk.
metadb -a -c # cxtxdxsx_of_new_disk (be sure to replace the # with the number of copies previously recorded)
Verify the database copies are back on the correct slice
metadb -i
Next we can begin resyncing the data on the mirror slices.
(Refer to the metastat -c output to recall the metadevice names for affected mirrors and devices to resync.)
Since you removed the submirrors on the disk prior to replacement, you will need to recreate them on the new disk so that they can be attached to the mirror and allow the resync to occur.
metainit
Repeat the above for each submirror that needs to be created.
Once all submirrors are created, you can then reattach them to the mirrors (this will automatically cause the data to start resyncing.)
metattach
Once all mirrors are attached, run metastat -c and verify you see all mirrors resyncing (there will be a percentage next them)
If the disk replaced was a boot disk, install the bootblk to the disk using the following command:
installboot /usr/platform/uname -i/lib/fs/ufs/bootblk /dev/rdsk/cxtxdxs0 (be sure to use the cxtxdx value of the disk you just replaced)
It is good practice to do the above to the disk you did not replace as well.
For SCSI and SAS drives use cfgadm to remove and insert the drive.
cfgadm -al (locate the attachment point for the cxtxdx of the drive you are replacing.)
Attachment point: ___
Disconnect the drive using the attachment point.
cfgadm -c unconfigure attachment_point
Verify drive is detached
cfgadm -al (attachment point should now show unconfigured)
Look at LED on drive (it should now be Blue), if not, do not proceed without contacting support.
Remove and replace drive. Wait for the Power (GREEN) LED to go solid.
Run the following to reattach the drive.
cfgadm -c configure attachment_point
Run the following and verify that the status is now configured.
cfgadm -al
Run the following to update the device special files.
devfsadm -C
Make sure that the disk has a valid label on it.
format
Select the number for the disk you just replaced.
It will bring up the format menu for the disk. If the drive needs to be labeled, it will state so now. (Answer Y if prompted “do you want to do this now”) If not prompted to label the disk, simply type “q” to exit until you are back at the command prompt.
Now you can copy the VTOC from the “good” half of the mirror to the new disk.
prtvtoc /dev/rdsk/cxtxdxs2 (of_good_disk) |fmthard -s - /dev/rdsk/cxtxdxs2 (of_new_disk)
You should see a statement “Table of contents now in place”
You can now put your state database copies back onto the disk.
metadb -a -c # cxtxdxsx_of_new_disk (be sure to replace the # with the number of copies previously recorded)
Verify the database copies are back on the correct slice
metadb -i
Next we can begin resyncing the data on the mirror slices.
(Refer to the metastat -c output to recall the metadevice names for affected mirrors and devices to resync.)
You will use the following to resync the mirrors.
metareplace -e d#_of_mirror cxtxdxsx_new_disk
(for example, metareplace -e d0 c1t1d0s0) this will resync the mirror d0 on the device c1t1d0s0.
You will see a message stating the device has been enabled or attached.
You can verify the resync status using the following command:
metastat -c
complete the metareplace for each mirror needing resynchronization.
If the disk replaced was a boot disk, install the bootblk to the disk using the following command:
installboot /usr/platform/uname -i/lib/fs/ufs/bootblk /dev/rdsk/cxtxdxs0 (be sure to use the cxtxdx value of the disk you just replaced)
It is good practice to do the above to the disk you did not replace as well.