Q: Fixing misconfigured mirror

From: Steve Edberg (sbedberg@ucdavis.edu)
Date: Thu Jun 02 2005 - 04:55:11 EDT


Hi -

I have a Sparc/Solaris 8 system with some mirror metadevices set up
using Solaris Disksuite. However, some of the filesystems were
mounted via /etc/vfstab onto one of the physical disk slices that
made up the mirror, rather than the mirror metadevice.

To remedy this, I first tested by unmounting the /opt filesystem
(because my /opt was small, I had a current verified backup and there
was nothing critical there), and remounting it onto the mirror
device. In summary:

/opt originally mounted on /dev/dsk/c1t0d0s5
c1t0d0s5 one part of mirror d5; metastat -i d5 reports all ok
umount /opt
mount -F ufs /dev/md/dsk/d5 /opt

Now, I took a quick look at /opt and things *seemed* ok. However,
problems soon became evident; eg, ls and ls -l reported different
files/directories, trying to cd into some subdirectories of /opt gave
me an IO error, recent files disappeared. I remounted /opt back onto
the physical partition c1t0d0s5, and everything was OK again. It was
as if the directory structure of the metadevice had not been updated,
so anything (directories & files) that was older than approximately a
year was visible. I am currently unable to trace things back to *why*
the metadevice directory was updated then; it was over a year since
the metadevices had been created, and much older than the last
reboot; it *may* have been about the same time that the filesystems
last needed fscking (thank <deity> for UFS logging!).

I had checked metastat -i, and mirror were reported all ok, so I
assumed that things would be fine. I was wrong. I tried again doing a
metadetach and metattach in hopes that would resync the mirror's
directory, that didn't help either.

My question is: is there an easy way to refresh a metadevice from a
physical slice so that I can simply remount onto the mirror device? I
know I could simply do a newfs on the d5 metadevice and restore the
backup, but I'd like to avoid that (especially since the /usr
partition is misconfigured this way as well). I assume pointing swap
at a metadevice will be no problem by editing /etc/vfstab & rebooting
will not be a problem since there's nothing persistent on swap, but
perhaps I'm missing something.

Thanks in advance; will summarize -

        steve edberg

Some details:

uname -a
========
SunOS pgfjupiter 5.8 Generic_117000-03 sun4u sparc SUNW,Sun-Fire-280R

Excerpt from current /etc/vfstab:
=================================
# device device mount FS fsck mount mount
# to mount to fsck point type pass at boot options
################# ################## ############ ##### # ###
#############
/dev/dsk/c1t0d0s1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no logging
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /usr ufs 1 no logging
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /opt ufs 2 yes logging

metastat -p d5
==============
d5 -m d15 d25 1
d15 1 1 c1t0d0s5
d25 1 1 c1t1d0s5

(swap, /, /opt and /usr were all intended to be mounted on mirrors
d1, d0, d5 & d6 respectively; only / is actually currently running on
the mirror metadevice).

metastat -i
===========
d0: Mirror
     Submirror 0: d10
       State: Okay
     Submirror 1: d20
       State: Okay
     Pass: 1
     Read option: roundrobin (default)
     Write option: parallel (default)
     Size: 8389656 blocks

d10: Submirror of d0
     State: Okay
     Size: 8389656 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t0d0s0 0 No Okay

d20: Submirror of d0
     State: Okay
     Size: 8389656 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t1d0s0 0 No Okay

d1: Mirror
     Submirror 0: d11
       State: Okay
     Submirror 1: d21
       State: Okay
     Pass: 1
     Read option: roundrobin (default)
     Write option: parallel (default)
     Size: 1048707 blocks

d11: Submirror of d1
     State: Okay
     Size: 1048707 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t0d0s1 0 No Okay

d21: Submirror of d1
     State: Okay
     Size: 1048707 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t1d0s1 0 No Okay

d3: Mirror
     Submirror 0: d13
       State: Okay
     Submirror 1: d23
       State: Okay
     Pass: 1
     Read option: roundrobin (default)
     Write option: parallel (default)
     Size: 2889 blocks

d13: Submirror of d3
     State: Okay
     Size: 2889 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t0d0s3 2889 Yes Okay

d23: Submirror of d3
     State: Okay
     Size: 2889 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t1d0s3 2889 Yes Okay

d4: Mirror
     Submirror 0: d14
       State: Okay
     Submirror 1: d24
       State: Okay
     Pass: 1
     Read option: roundrobin (default)
     Write option: parallel (default)
     Size: 2889 blocks

d14: Submirror of d4
     State: Okay
     Size: 2889 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t0d0s4 2889 Yes Okay

d24: Submirror of d4
     State: Okay
     Size: 2889 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t1d0s4 2889 Yes Okay

d5: Mirror
     Submirror 0: d15
       State: Okay
     Submirror 1: d25
       State: Okay
     Pass: 1
     Read option: roundrobin (default)
     Write option: parallel (default)
     Size: 8389656 blocks

d15: Submirror of d5
     State: Okay
     Size: 8389656 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t0d0s5 0 No Okay

d25: Submirror of d5
     State: Okay
     Size: 8389656 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t1d0s5 0 No Okay

d6: Mirror
     Submirror 0: d16
       State: Okay
     Submirror 1: d26
       State: Okay
     Pass: 1
     Read option: roundrobin (default)
     Write option: parallel (default)
     Size: 53287605 blocks

d16: Submirror of d6
     State: Okay
     Size: 53287605 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t0d0s6 0 No Okay

d26: Submirror of d6
     State: Okay
     Size: 53287605 blocks
     Stripe 0:
         Device Start Block Dbase State Hot Spare
         c1t1d0s6 0 No Okay
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:48 EDT