Solaris 10: Adding new disk and mirroring it to existing disk

Salam, i would like to share how to add new disk and mirroring it to existing disk.  Here i will show adding it by using vmware and it will demonstrate real situation. At the end of this, i also demonstrate how to detach the disk in case of replacing disk.

zpool_status_after_before_add_disk

Figure 1: zpool status shows current single disk which is c0d0s0

 

vm_edit_settings

Figure 2: In order to make changes, we have to edit virtual machine settings.

 

add_hw_wizard

Figure 3: Choose hard disk

 

add_hw_wizard_ide

Figure 4: Select disk type, in this case we will use IDE.

 

add_hw_wizard_finish

Figure 5: Please rename the vmdk formatted file if you want to and finish the wizard.

 

newly_added_disk

Figure 6: Click ok to close the settings dialog box.

 

echo_format_after_add_new_disk

Figure 7: Image above shows the newly added disk that system has been detected.  The command is echo | format

 

 

prtvtoc_current_slice_table

Figure 8: Display current vtoc table for existing slice. prtvtoc /dev/rdsk/c0d0s0

 

copy_current_vtoc_table_to_new_slice_table

Figure 9: Copy current vtoc table to new slice vtoc table. prtvtoc /dev/rdsk/c0d0s0 | fmthard -s – /dev/rdsk/c0d1s0

 

zpool_attach_f_rpool_c0d0s0_c0d1s0

Figure 10: Atatch newly added disk to current disk as a mirrored disk. zpool attach -f rpool c0d0s0 c0d1s0

 

zpool_status_after_attach_resilvering1

Figure 10: View the status for the zpool. It shows new disk has been attached and mirrored to current pool. zpool status

 

zpool_status_after_attach

Figure 11: The status for mirroring is still resilvering and it takes time before we can make any changes.

 

zpool_status_after_attach_resilvered

Figure 12: Resilvering the disk has completed.

 

zpool_detach

Figure 13: To replace one of the disk, we have to detach first from its mirror. The command we can use is zpool detach rpool c0d1s0

 

zpool_status_after_before_add_disk

Figure 14: After detach the disk to be replaced, please verify it zpool status and supposedly it will shows as above, just one disk.