Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jan 2005 20:54:02 -0600
From:      Doug Poland <doug@polands.org>
To:        questions@freebsd.org
Subject:   gmirror problem on 5.3-R i386
Message-ID:  <20050113025339.GC1218@polands.org>

next in thread | raw e-mail | index | archive | help
Hello,

I'm having a problem with gmirror.  It would seem that I cannot add my
first disk to the mirror after booting off the second drive.  My current
status is a degraded mirror and I cannot see any of the partitions on
disk one.  

For a guide, I'm using the excellent instructions at:
http://people.freebsd.org/~rse/mirror/

My system has identical WD 80GB SATA drives (ad4 and ad6).  I've
followed the steps in the document that are labeled: 

  "GEOM mirror Approach 2: Single Slice, Preferred, More Flexible"

# dd if=/dev/zero of=/dev/ad6 bs=512 count=79
# fdisk -v -B -I /dev/ad6

# gmirror label -v -n -b round-robin gm0s1 /dev/ad6s1
# gmirror load

# bsdlabel -w -B /dev/mirror/gm0s1
# bsdlabel -e /dev/mirror/gm0s1

# newfs -U /dev/mirror/gm0s1a
# mount /dev/mirror/gm0s1a /mnt
# dump -L -0 -f- / | (cd /mnt; restore -r -v -f-)
# newfs -U /dev/mirror/gm0s1d
# mount /dev/mirror/gm0s1d /mnt/var
# dump -L -0 -f- /var | (cd /mnt/var; restore -r -v -f-)
# newfs -U /dev/mirror/gm0s1e
# mount /dev/mirror/gm0s1e /mnt/tmp
# dump -L -0 -f- /tmp | (cd /mnt/tmp; restore -r -v -f-)
# mount /dev/mirror/gm0s1f /mnt/usr
# dump -L -0 -f- /usr | (cd /mnt/usr; restore -r -v -f-)
# cp -p /mnt/etc/fstab /mnt/etc/fstab.orig

# sed -e 's/dev\/ad4s1/dev\/mirror\/gm0s1/g' </mnt/etc/fstab.orig
# echo 'swapoff="YES"' >>/mnt/etc/rc.conf
# echo 'geom_mirror_load="YES"' >>/mnt/boot/loader.conf
# echo "1:ad(6,a)/boot/loader" >/boot.config

# shutdown -r now

# dd if=/dev/zero of=/dev/ad4 bs=512 count=79

# gmirror configure -a gm0s1
# gmirror insert gm0s1 /dev/ad4s1

At this point I see...

	"Unknown provider ad4s1"

A gmirror list reveals:

Geom name: mirror
State: DEGRADED
Components: 2
Balance: load
Slice: 2048
Flags: NONE
SyncID: 2
ID: 4216140117
Providers:
1. Name: mirror/mirror
   Mediasize: 80026361344 (75G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ad4
   Mediasize: 80026361856 (75G)
   Sectorsize: 512
   Mode: r0w0e0
   State: ACTIVE
   Priority: 0
   Flags: NONE
   SyncID: 2
   ID: 3073402045

Geom name: mirror.sync

Geom name: gm0s1
State: COMPLETE
Components: 1
Balance: round-robin
Slice: 4096
Flags: NONE
SyncID: 1
ID: 3205827760
Providers:
1. Name: mirror/gm0s1
   Mediasize: 80026329088 (75G)
   Sectorsize: 512
   Mode: r5w5e1
Consumers:
1. Name: ad6
   Mediasize: 80026361856 (75G)
   Sectorsize: 512
   Mode: r5w5e2
   State: ACTIVE
   Priority: 0
   Flags: DIRTY
   SyncID: 1
   ID: 1606771156

Geom name: gm0s1.sync

Here's a snippet of /var/log/messages after the first reboot:

Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1 created (id=3205827760).
Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 detected.
Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 activated.
Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider mirror/gm0s1 launched.
Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device mirror created (id=4216140117).
Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 detected.
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Force device mirror start due to timeout.
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Cannot update metadata on disk ad4 (error=1).
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 activated.
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider mirror/mirror launched.
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Cannot update metadata on disk ad4 (error=1).
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 disconnected.
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider mirror/mirror destroyed.
Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror destroyed.
Jan 12 17:57:32 webhost02 syslogd: kernel boot file is /boot/kernel/kernel

Subsequent reboots reveal:

Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror created (id=4216140117).
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 detected.
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1 created (id=3205827760).
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 detected.
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 activated.
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider mirror/gm0s1 launched.
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Force device mirror start due to timeout.
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 activated.
Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror: provider mirror/mirror launched.
Jan 12 17:57:32 webhost02 kernel: Mounting root from ufs:/dev/mirror/gm0s1a


Here's my bsdlabels, if that helps:

webhost02# bsdlabel /dev/mirror/gm0s1
# /dev/mirror/gm0s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   524288        0    4.2BSD     2048 16384 32776 
  b:  4142160   524288      swap                    
  c: 156301424        0    unused        0     0         # "raw" part, don't edit
  d: 16777216  4666448    4.2BSD     2048 16384 28552 
  e:  2097152 21443664    4.2BSD     2048 16384 28552 
  f: 132755506 23540816    4.2BSD     2048 16384 28552 

webhost02# bsdlabel /dev/ad6
# /dev/ad6:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   524288        0    4.2BSD     2048 16384 32776 
  b:  4142160   524288      swap                    
  c: 156301424        0    unused        0     0         # "raw" part, don't edit
  d: 16777216  4666448    4.2BSD     2048 16384 28552 
  e:  2097152 21443664    4.2BSD     2048 16384 28552 
  f: 132755506 23540816    4.2BSD     2048 16384 28552 
bsdlabel: partition c doesn't cover the whole unit!
bsdlabel: An incorrect partition c may cause problems for standard system utilities

webhost02# bsdlabel /dev/ad4
bsdlabel: /dev/ad4: no valid label found

Thanks for your help!

-- 
Regards,
Doug



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050113025339.GC1218>