Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Oct 2004 21:54:28 +0200
From:      John Hay <jhay@icomtek.csir.co.za>
To:        freebsd-current@freebsd.org
Subject:   geom mirror problem
Message-ID:  <20041006195428.GA8886@zibbi.icomtek.csir.co.za>

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

I have been trying to setup a geom mirror on this machine but each time
I reboot geom gives an error and only use one disk. Anybody know where
I should look? I have two other machines that work properly. :-/

Anyway here are some more detail. I'm running the latest RELENG_5 with
Pawel's with g_mirror.c v 1.34 and 1.35 from current applied. After
syncing and rebooting I see these messages:

#####################################################
ad0: 114473MB <ST3120022A/8.54> [232581/16/63] at ata0-master UDMA100
ad2: 114473MB <ST3120022A/8.54> [232581/16/63] at ata1-master UDMA100
GEOM_MIRROR: Device gm0 created (id=861616013).
GEOM_MIRROR: Device gm0: provider ad0 detected.
GEOM_MIRROR: Device gm0: provider ad2 detected.
GEOM_MIRROR: Device gm0: provider ad2 activated.
GEOM_MIRROR: Cannot update metadata on disk ad0 (error=1).
GEOM_MIRROR: Device gm0: provider ad0 activated.
GEOM_MIRROR: Device gm0: provider mirror/gm0 launched.
GEOM_MIRROR: Cannot update metadata on disk ad0 (error=1).
GEOM_MIRROR: Device gm0: provider ad0 disconnected.
Mounting root from ufs:/dev/mirror/gm0s1a
#####################################################

What is error=1 and how can I find out why it happens?

A sysctl -b kern.geom.conftxt lookslike this:
#####################################################
0 DISK ad2 120034123776 512 hd 16 sc 63
1 MIRROR mirror/gm0 120034123264 512
2 MBR mirror/gm0s1 120031478784 512 i 0 o 32256 ty 165
3 BSD mirror/gm0s1f 118984074240 512 i 5 o 1047404544 ty 7
3 BSD mirror/gm0s1e 268435456 512 i 4 o 778969088 ty 7
3 BSD mirror/gm0s1d 268435456 512 i 3 o 510533632 ty 7
3 BSD mirror/gm0s1c 120031478784 512 i 2 o 0 ty 0
3 BSD mirror/gm0s1b 242098176 512 i 1 o 268435456 ty 1
3 BSD mirror/gm0s1a 268435456 512 i 0 o 0 ty 7
0 DISK ad0 120034123776 512 hd 16 sc 63
1 MBR ad0s1 120031478784 512 i 0 o 32256 ty 165
2 BSD ad0s1f 118984074240 512 i 5 o 1047404544 ty 7
2 BSD ad0s1e 268435456 512 i 4 o 778969088 ty 7
2 BSD ad0s1d 268435456 512 i 3 o 510533632 ty 7
2 BSD ad0s1c 120031478784 512 i 2 o 0 ty 0
2 BSD ad0s1b 242098176 512 i 1 o 268435456 ty 1
2 BSD ad0s1a 268435456 512 i 0 o 0 ty 7
#####################################################

And gmirror list looks like this:
#####################################################
Geom name: gm0
State: DEGRADED
Components: 2
Balance: split
Slice: 4096
Flags: NONE
SyncID: 11
ID: 861616013
Providers:
1. Name: mirror/gm0
   Mediasize: 120034123264 (112G)
   Sectorsize: 512
   Mode: r5w5e2
Consumers:
1. Name: ad2
   Mediasize: 120034123776 (112G)
   Sectorsize: 512
   Mode: r5w5e3
   State: ACTIVE
   Priority: 0
   Flags: DIRTY, HARDCODED
   SyncID: 11
   ID: 3011562079

Geom name: gm0.sync

#####################################################

If I do a "gmirror activate -v gm0 ad0" it is activated and starts
synchronising and to my eye everything looks ok, but if I wait until
it finish syncing and then reboots, the same thing happens. This is
with and without Pawel's patch. I have also tried his other patch
that waits vfs_mountroot(), but that didn't make a difference.

After the activate command, sysctl -b kern.geom.conftxt looks like
this:
#####################################################
0 DISK ad2 120034123776 512 hd 16 sc 63
1 MIRROR mirror/gm0 120034123264 512
2 MBR mirror/gm0s1 120031478784 512 i 0 o 32256 ty 165
3 BSD mirror/gm0s1f 118984074240 512 i 5 o 1047404544 ty 7
3 BSD mirror/gm0s1e 268435456 512 i 4 o 778969088 ty 7
3 BSD mirror/gm0s1d 268435456 512 i 3 o 510533632 ty 7
3 BSD mirror/gm0s1c 120031478784 512 i 2 o 0 ty 0
3 BSD mirror/gm0s1b 242098176 512 i 1 o 268435456 ty 1
3 BSD mirror/gm0s1a 268435456 512 i 0 o 0 ty 7
0 DISK ad0 120034123776 512 hd 16 sc 63
1 MIRROR mirror/gm0 120034123264 512
2 MBR mirror/gm0s1 120031478784 512 i 0 o 32256 ty 165
3 BSD mirror/gm0s1f 118984074240 512 i 5 o 1047404544 ty 7
3 BSD mirror/gm0s1e 268435456 512 i 4 o 778969088 ty 7
3 BSD mirror/gm0s1d 268435456 512 i 3 o 510533632 ty 7
3 BSD mirror/gm0s1c 120031478784 512 i 2 o 0 ty 0
3 BSD mirror/gm0s1b 242098176 512 i 1 o 268435456 ty 1
3 BSD mirror/gm0s1a 268435456 512 i 0 o 0 ty 7
#####################################################

And gmirror list looks like this:
#####################################################
Geom name: gm0
State: DEGRADED
Components: 2
Balance: split
Slice: 4096
Flags: NONE
SyncID: 11
ID: 861616013
Providers:
1. Name: mirror/gm0
   Mediasize: 120034123264 (112G)
   Sectorsize: 512
   Mode: r6w5e2
Consumers:
1. Name: ad2
   Mediasize: 120034123776 (112G)
   Sectorsize: 512
   Mode: r6w5e3
   State: ACTIVE
   Priority: 0
   Flags: DIRTY, HARDCODED
   SyncID: 11
   ID: 3011562079
2. Name: ad0
   Mediasize: 120034123776 (112G)
   Sectorsize: 512
   Mode: r0w1e1
   State: SYNCHRONIZING
   Priority: 0
   Flags: DIRTY, HARDCODED, SYNCHRONIZING
   SyncID: 11
   Synchronized: 4%
   ID: 460446288

Geom name: gm0.sync
Consumers:
1. Name: mirror/gm0
   Mediasize: 120034123264 (112G)
   Sectorsize: 512
   Mode: r1w0e0

#####################################################

John
-- 
John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org



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