Solaris: Operating System Disk Replacement Procedure

4

SUN Operating System Disk Replacement Procedure

Even though it seems to be a easy task to replace the OS Disk there are often issues on the correct replacement.

Follow this rough guideline for Disk replacement.

This procedure assumes that the main disk (c1t0d0) has failed and the mirror disk (c1t1d0) is working properly.

 

1. Log into the server console as root.

2. Check the current metadevices configuration

metastat -t

metastat -p >> /etc/lvm/md.tab

metadb -i

3. Detach the failed disk from the mirror. On this case all metadevices pointing to c1t0d0 disk.

metadetach -f d1 d10

metadetach -f d2 d20

metadetach -f d3 d30

metadetach -f d4 d40

metadetach -f d5 d50

metadetach -f d6 d60

4. Clear the metadevices of the failed disk

metaclear d10

metaclear d20

metaclear d30

metaclear d40

metaclear d50

metaclear d60

5. Remove the replicas from the bad disk

metadb -d /dev/dsk/c1t0d0s3

6. Unconfigure the faulted disk from the HW and OS

cfgadm -c unconfigure c1::dsk/c1t0d0

 

 

NOTE:

After executing step 6 you may get the following error, so please follow the next steps before executing step 7 if you get this error:

cfgadm: Component system is busy, try again: failed to offline:

Resource Information

—————— ————————-

/dev/dsk/c1t0d0s2 Device being used by VxVM

This error prevents us to proceed to the next step for the disk replacement procedure and the “-f” should NOT be used to remove the failed disk. If you use the “-f” option to unconfigure the OS disk the server WILL REBOOT caused by an XIR signal right after replacing the disk.

Starting vxvm 4.0, DMP claims all disks automatically so we need to disable DMP first before we try to unconfigure the failed disk.

 


6.a vxdmpadm listctlr all

CTLR-NAME ENCLR-TYPE STATE ENCLR-NAME

=====================================================

c1 Disk ENABLED Disk

cx xxxxxxx ENABLED xxxxxx

6.b vxdmpadm getsubpaths ctlr=c1

NAME STATE[A] PATH-TYPE[M] DMPNODENAME ENCLR-TYPE ENCLR-NAME ATTRS

===================================================================

c1t0d0s2 ENABLED(A) – Disk_0 Disk Disk –

c1t2d0s2 ENABLED(A) – Disk_3 Disk Disk –

c1t1d0s2 ENABLED(A) – Disk_2 Disk Disk –

c1t3d0s2 ENABLED(A) – Disk_1 Disk Disk –

6.c vxdmpadm -f disable path=c1t0d0s2

 

6.d vxdmpadm getsubpaths ctlr=c1

NAME STATE[A] PATH-TYPE[M] DMPNODENAME ENCLR-TYPE ENCLR-NAME ATTRS

===================================================================

c1t0d0s2 DISABLED – Disk_0 Disk Disk –

c1t2d0s2 ENABLED(A) – Disk_3 Disk Disk –

c1t1d0s2 ENABLED(A) – Disk_2 Disk Disk –

c1t3d0s2 ENABLED(A) – Disk_1 Disk Disk –

6.e cfgadm -c unconfigure c1::dsk/c1t0d0 à         The unconfigure will now work!

*** If the above still does not work, it may be necessary to completely remove the disk from VxVM view as follows:

1)       vxdisk rm cxtxdx

2)       vxdiskadm -> option 17 ->  option 2 -> enter path e.g. c1t0d0

3)       Retry the cfgadm -c unconfigure command again and it should work.

/usr/sbin/cfgadm -c unconfigure c1::dsk/c1t0d0

*** If for some reason we are still facing problems to unconfigure the disk follow the next steps:

1) Run the following command to rename ‘es_rcm.pl’ script.

mv /etc/rcm/scripts/es_rcm.pl /etc/rcm/scripts/DONTUSE

NOTE: VxVM 4.1 and above ‘es_rcm.pl’ script is under /usr/lib/rcm/scripts

mv /usr/lib/rcm/scripts/es_rcm.pl /usr/lib/rcm/scripts/DONTUSE

2) Run “/usr/sbin/cfgadm -c unconfigure ……” again. This command will finish successfully.

/usr/sbin/cfgadm -c unconfigure c1::dsk/c1t0d0

3) After that, rename back file “DONTUSE” to the original name.

mv /etc/rcm/scripts/DONTUSE /etc/rcm/scripts/es_rcm.pl

NOTE: VxVM 4.1 and above ‘es_rcm.pl’ script is under /usr/lib/rcm/scripts

mv /usr/lib/rcm/scripts/DONTUSE /usr/lib/rcm/scripts/es_rcm.pl

7. replace the faulted disk (c1t0d0).

 

8. Configure the new disk and confirm it’s been configured

cfgadm -c configure c1::dsk/c1t0d0

cfgadm -al | grep dsk/c1

Note: You may have to run devfsadm command if  above command fails.

9. Format the disk and keep the slices similar to c1t1d0 and install bootblock to the new disk.

prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s – /dev/rdsk/c1t0d0s2

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s0

10. Recreate the metareplicas in the failed disk

metadb -a -c 3 c1t0d0s3

11. Recreate the deleted metadevices and attach them to recreate the mirror

metainit d10; metainit d20; metainit d30; metainit d40; metainit d50; metainit d60

metattach d1 d10

metattach d2 d20

metattach d3 d30

metattach d4 d40

metattach d5 d50

metattach d6 d60

12. Wait for the resyncing to finish

4 thoughts on “Solaris: Operating System Disk Replacement Procedure

  1. hi , when issue this command to

    installboot /usr/platform/’uname -i’/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
    /usr/platform/uname -i/lib/fs/ufs/bootblk: File not found
    it’s show file not founf , kindly please advice

  2. in installboot /usr/platform/’uname -i’/lib/fs/ufs/bootblk /
    the uname is in signel quote and reflecting the output of uname -i
    try either to fill the data manually from uname -i or make sure you have the single quote in it.

Leave a Reply