Solaris 10: Replace the failed mirrored Boot Disk

I was lucky to identify Disk IO Error in one of our SunFire v215. The Disk contains the boot-able partition. So I have to replace ASAP. Here is the steps, that I followed to replace the failed mirror root disk.

System is having 4 disks. Disks are RAID1 mirrored (1+1). Partitions are UFS. (Not ZFS).

  • Mirror 1 – Boot-able
  • Disk 1 (c0t0d0)
  • Disk 2 (c0t1d0)  <- Failed Disk
  • Mirror 2 – Data
  • Disk 3 (c1t0d0)
  • Disk 4 (c1t0d0)

Steps:

  1. Check the mirror status:
    • metastat -ac — Disk contains the partitions with (maint) are in the trouble.
    • iostat -En — Shows if there is any errors
  2. Important note
    • Don’t reboot, if s0 in “maint” state and md:mirrored_root_flag=1 not set in /etc/system file.
    • If you have chance to reboot the system, then do the following before the reboot
    • echo “set md:mirrored_root_flag=1” >> /etc/system
    • echo “set md_mirror:md_resync_bufsz = 2048” >> /etc/system
  3. Problem is conformed and Replacement disk is ready in the hand
    • metadb -i — Get metadb locations
    • cfgadm -al — Get disk config detail and Note down faulty disk detail
  4. Detach the faulty disk from the mirror
    • metadetach -f  d0 d20 — Detach the sub mirror d20 from mirror d0 and do the same for other mirrored slices (s1, s5, s7)
    • metaclear d20 — Clear sub mirror and do the same for other slices
    • metastat -ac — Just to verify
  5. Remove the faulty disk from the mirror
    • metadb -d c0t1d0s3 — In my case, Metadb in slice 3. you can get this info from metadb -i command
  6. Format the disk
    • As per your company policy, if you need to format the disk. You can do it now. Warning: Format may take 2 Hrs or more.
    • format
  7. Detach the faulty disk from OS
    • cfgadm -c unconfigure c0::dsk/c0t1d0
    • cfgadm -al — Just to conform, check faulty disk is unconfigured
    • Blue light should be ON. Now you can replace the disk.
  8. Attach the new disk to OS
    • cfgadm -c configure c0::dsk/c0t1d0 — Attach the disk
    • cfgadm al — Verify
  9. Copy the partition table to new disk
    • prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s – /dev/rdsk/cot1dos2
    • installboot /usr/platform/`uname -`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
  10. Create meta db in the new disk
    • metadb -c 2 -a c0t1d0s3
  11. Create and attach sub mirrors in the new disk as RAID1
    • metainit d20 1 1 c0t1d0s0 — Do the same for other slices (s1, s5, s7)
    • metattach d0 d20 — Do the same for the other slices (s1, s5, s7)
  12. Now mirror will starts sync the data between disks.
    • metastat -ac

 

Advertisements
Tagged with: , ,
Posted in Uncategorized
3 comments on “Solaris 10: Replace the failed mirrored Boot Disk
  1. vijay says:

    Thank you Bharathi.. this article helped to resolve my issue.

  2. sanrk says:

    it is awesome

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: