Odd behavior with volume labels and gmirror

Ben Schumacher me at benschumacher.com
Fri Jan 8 18:08:24 UTC 2010


Hey-

I haven't search the list, so this could be covered already, but I've
seen odd behavior with volume labels and gmirror.

First some background.

Here's my uname:

$ uname -a
FreeBSD filer.sats.internal 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 #1:
Mon Dec 21 10:21:37 MST 2009
ben at filer.sats.internal:/usr/obj/data/FreeBSD/RELENG_8_0/src/sys/FILER
 i386

I have a 4-way gmirror:

$ gmirror status
       Name    Status  Components
 mirror/root  COMPLETE  ad6s1
                       ad12s1
                       ad14s1
                       ad18s1

With multiple labeled slices:

$ tunefs -p /dev/mirror/roota
tunefs: ACLs: (-a)                                         disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  2048
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 root

$ tunefs -p /dev/mirror/rootf
tunefs: ACLs: (-a)                                         disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  2048
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 usr

And used these in my /etc/fstab for mounting:

$ cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/mirror/rootb.eli   none            swap    sw              0       0
/dev/da0b               none            swap    sw              1       0
/dev/ufs/root       /               ufs     rw              1       1
/dev/ufs/tmp       /tmp            ufs     rw,nosuid       2       2
/dev/ufs/usr       /usr            ufs     rw              2       2
/dev/ufr/var       /var            ufs     rw              2       2

The issue I experienced last night is that after a power outage, the
system detected the labelled filesystems names from some of the GEOM
providers of the mirror -- specifically they appear to all be mapped
to "/dev/ad18s1[adef]" and the machine never managed to fully boot
without some manual intervention to change /etc/fstab back to using
the mirror devices instead of the labels.

Insult to injury, I *may* have a drive going bad (ad18), but given
what was happening with the mounting, I'm not really sure. I used
recoverdisk to dup that disk to the others and it seemed to work fine,
but during the label problem I was getting some READ_DMA errors trying
to rebuild the mirror. I guess my question is, is using labels on
mirrors unreliable since the labels write through and apparently can
get detected from the devices before the mirror is loaded? Or is this
a bug that I should file a pr for?

Thanks for your attention.

Cheers,
Ben


More information about the freebsd-questions mailing list