Monday, March 3, 2008

Howto Unmirror a File System that can be unmounted Solaris 10

Use this procedure to unmirror a file system that can be unmounted while the system is running.
To unmirror root (/), /var, /usr, or swap, or any other file system that cannot be unmounted while the system is running

  1. Make sure that you have root privilege and that you have a current backup of all data.
  2. Verify that at least one submirror is in the Okay state.
  3. # metastat mirror
  4. Unmount the file system.
  5. # umount /file-system
  6. Detach the submirror that will continue to be used for the file system.
  7. # metadetach mirror submirror
  8. Clear the mirror and remaining subcomponents.
  9. # metaclear -r mirror
  10. Edit the /etc/vfstab file to use the component detached in Step4 , if necessary.
  11. Remount the file system.
# mount /file-system

Example : Unmirroring the /opt File System

# metastat d3
d3: Mirror
Submirror 0: d13
State: Okay
Submirror 1: d23
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 31464192 blocks (15 GB)

d13: Submirror of d3
State: Okay
Size: 31464192 blocks (15 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s3 0 No Okay Yes

d23: Submirror of d3
State: Okay
Size: 31464192 blocks (15 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s3 0 No Okay Yes
# umount /opt
# metadetach d3 d13
d3: submirror d13 is detached
# metaclear -r d3
d3: Mirror is cleared
d23: Concat/Stripe is cleared
Edit the /etc/vfstab file so that the entry for /opt is changed from d3 to the underlying slice or volume
# mount /opt