Stephan Fiebrandt | 2 Oct 2004 00:07
Picon

gbde with lesser than 4 keys and different start sectors

Hello everybody,

i've read thru the list and found out, that there was a bug till 
recently using gbde with lesser than 4 keys.
I started to use bde with a different sector start and 2 keys.
I am about to upgrade now to 5.3BETA6 since the pci solts on my new 
mainboard that i spend to my server are not working proper on 5.2.1. 
Well.. i ended up now with latest code at "incorrect superblock" when i 
try to mount the fs on it.
Wanted to know what settings are "safe" to use in the future, since i am 
testing a 300+ GB storage and its pretty anoying to dump and restore 
that :).
I was reading phk's nice doc about GBDE and how it works. But i am still 
unsure.. if 2 or 4 keys would make a difference in the question of security.
For now i will stick with 4 keys, since i might boot 5.2.1.

Greetz,

Stephan
_____________________________________
a false sence of security is worse than insecurity
Allan Fields | 2 Oct 2004 15:36
Picon

Re: gbde with lesser than 4 keys and different start sectors

On Sat, Oct 02, 2004 at 12:07:49AM +0200, Stephan Fiebrandt wrote:
> Hello everybody,
> 
> i've read thru the list and found out, that there was a bug till 
> recently using gbde with lesser than 4 keys.
> I started to use bde with a different sector start and 2 keys.
> I am about to upgrade now to 5.3BETA6 since the pci solts on my new 
> mainboard that i spend to my server are not working proper on 5.2.1. 
> Well.. i ended up now with latest code at "incorrect superblock" when i 
> try to mount the fs on it.

That's due to the recent patch changing sector mapping as phk has
described.

> Wanted to know what settings are "safe" to use in the future, since i am 
> testing a 300+ GB storage and its pretty anoying to dump and restore 
> that :).

I agree it's best not to need to dump/restore large devices.  However,
I wouldn't rule out needing to do so, just in case another serious
bug surfaces.

I'd say at this point gbde is mature enough to avoid bugs like that
absent any major reworking of sector mapping / layout.
A thing to do is test and verify the proper operation before deploying
which gives a better sense of safety.  (Fill up full volume, detach
and reattach, reboot, panic, try all the keys, etc.)

> I was reading phk's nice doc about GBDE and how it works. But i am still 
> unsure.. if 2 or 4 keys would make a difference in the question of security.
(Continue reading)

Chris Elsworth | 4 Oct 2004 10:44

SCSI disk getting disconnected on boot

Hello,

After having a two-way gmirror happily working for a few days, upon
rebooting both machines, they both seem to have lost half the mirror.

Here's the debug output from bootup on one of them:

Waiting 5 seconds for SCSI devices to settle
GEOM_MIRROR[2]: Tasting acd0.
da0 at ahc0 bus 0 target 0 lun 0
da0: <QUANTUM ATLAS10K3_36_SCA 120G> Fixed Direct Access SCSI-3 device 
da0: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabd
da0: 34732MB (71132959 512 byte sectors: 255H 63S/T 4427C)
da1 at ahc0 bus 0 target 1 lun 0
da1: <QUANTUM ATLAS10K3_36_SCA 120G> Fixed Direct Access SCSI-3 device 
da1: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabd
da1: 34732MB (71132959 512 byte sectors: 255H 63S/T 4427C)
GEOM_MIRROR[2]: Tasting da0.
SMP: AP CPU #1 Launched!
     magic: GEOM::MIRROR
   version: 1
      name: gm
       mid: 1573691141
       did: 1965364196
       all: 2
    syncid: 3
  priority: 0
     slice: 4096
   balance: split
 mediasize: 36420074496
(Continue reading)

Pawel Jakub Dawidek | 4 Oct 2004 11:02
Picon
Favicon

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 09:44:42AM +0100, Chris Elsworth wrote:
+> GEOM_MIRROR[0]: Device gm: provider da1 activated.
+> GEOM_MIRROR[1]: Disk da0 state changed from NEW to SYNCHRONIZING (device gm).
+> GEOM_MIRROR[0]: Device gm: provider mirror/gm launched.
+> GEOM_MIRROR[0]: Device gm: rebuilding provider da0.
+> GEOM_MIRROR[2]: Access da0 r0w1e1 = 1
+> GEOM_MIRROR[1]: Disk da0 state changed from SYNCHRONIZING to DISCONNECTED (devi.
+> GEOM_MIRROR[0]: Device gm: provider da0 disconnected.
+> GEOM_MIRROR[2]: Disk da0 disconnected.
[...]
+> The only explanation I could think of - da0 is the boot device; [...]

I don't understand. You mirror da0 and da1 and still have da0<something>
in your /etc/fstab? Could you provide your /etc/fstab?

+> [...] Would using
+> mirror devices of da0s1 and da1s1 get round this?

If you open some partitions on da0 for writing, it will be disconnected
from the mirror. In that case using daXs1 should help, but the truth is,
that you shouldn't use da0 anymore (use /dev/mirror/gm instead).

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
Chris Elsworth | 4 Oct 2004 11:15

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 11:02:27AM +0200, Pawel Jakub Dawidek wrote:
> On Mon, Oct 04, 2004 at 09:44:42AM +0100, Chris Elsworth wrote:
> +> GEOM_MIRROR[0]: Device gm: provider da1 activated.
> +> GEOM_MIRROR[1]: Disk da0 state changed from NEW to SYNCHRONIZING (device gm).
> +> GEOM_MIRROR[0]: Device gm: provider mirror/gm launched.
> +> GEOM_MIRROR[0]: Device gm: rebuilding provider da0.
> +> GEOM_MIRROR[2]: Access da0 r0w1e1 = 1
> +> GEOM_MIRROR[1]: Disk da0 state changed from SYNCHRONIZING to DISCONNECTED (devi.
> +> GEOM_MIRROR[0]: Device gm: provider da0 disconnected.
> +> GEOM_MIRROR[2]: Disk da0 disconnected.
> [...]
> +> The only explanation I could think of - da0 is the boot device; [...]
> 
> I don't understand. You mirror da0 and da1 and still have da0<something>
> in your /etc/fstab? Could you provide your /etc/fstab?

No, I don't have da0 in fstab.. here it is:

# cat /etc/fstab 
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/mirror/gmb         none            swap    sw              0       0
/dev/mirror/gma         /               ufs     rw              1       1
/dev/mirror/gmd         /tmp            ufs     rw              2       2
/dev/mirror/gme         /var            ufs     rw              2       2
/dev/mirror/gmf         /usr            ufs     rw              2       2
/dev/mirror/gmg         /jail           ufs     rw              2       2
/dev/mirror/gmh         /dump           ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0

When I say da0 is the boot device, I mean that's the device that
(Continue reading)

Pawel Jakub Dawidek | 4 Oct 2004 12:24
Picon
Favicon

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 10:15:09AM +0100, Chris Elsworth wrote:
+> GEOM_MIRROR[1]: Disk da0 state changed from NEW to ACTIVE (device gm).
+> GEOM_MIRROR[2]: Access da0 r0w1e1 = 1
+> GEOM_MIRROR[0]: Cannot update metadata on disk da0 (error=1).

I haven't seen this error before.
Simlar race was reported earlier. Could you try this patch:

	http://people.freebsd.org/~pjd/patches/gmirror.patch

(You need to recompile you kernel and geom_mirror.ko module.)

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
Chris Elsworth | 4 Oct 2004 13:06

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 12:24:11PM +0200, Pawel Jakub Dawidek wrote:
> On Mon, Oct 04, 2004 at 10:15:09AM +0100, Chris Elsworth wrote:
> +> GEOM_MIRROR[1]: Disk da0 state changed from NEW to ACTIVE (device gm).
> +> GEOM_MIRROR[2]: Access da0 r0w1e1 = 1
> +> GEOM_MIRROR[0]: Cannot update metadata on disk da0 (error=1).
> 
> I haven't seen this error before.
> Simlar race was reported earlier. Could you try this patch:
> 
> 	http://people.freebsd.org/~pjd/patches/gmirror.patch
> 
> (You need to recompile you kernel and geom_mirror.ko module.)

Hello Pawel,

Oh dear - this seems to have made it worse :(
My boot procedure is now as follows (started from the first
GEOM_MIRROR output)

GEOM_MIRROR[2]: Tasting fd0.
acd0: CDROM <SAMSUNG CD-ROM SN-124/q009> at ata0-master PIO4
Waiting 5 seconds for SCSI devices to settle
GEOM_MIRROR[2]: Tasting acd0.
da0 at ahc0 bus 0 target 0 lun 0
da0: <QUANTUM ATLAS10K3_36_SCA 120G> Fixed Direct Access SCSI-3 device 
da0: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabd
da0: 34732MB (71132959 512 byte sectors: 255H 63S/T 4427C)
da1 at ahc0 bus 0 target 1 lun 0
da1: <QUANTUM ATLAS10K3_36_SCA 120G> Fixed Direct Access SCSI-3 device 
da1: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabd
(Continue reading)

Chris Elsworth | 4 Oct 2004 15:12

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 12:06:37PM +0100, Chris Elsworth wrote:
> On Mon, Oct 04, 2004 at 12:24:11PM +0200, Pawel Jakub Dawidek wrote:
> > On Mon, Oct 04, 2004 at 10:15:09AM +0100, Chris Elsworth wrote:
> > +> GEOM_MIRROR[1]: Disk da0 state changed from NEW to ACTIVE (device gm).
> > +> GEOM_MIRROR[2]: Access da0 r0w1e1 = 1
> > +> GEOM_MIRROR[0]: Cannot update metadata on disk da0 (error=1).
> > 
> > I haven't seen this error before.
> > Simlar race was reported earlier. Could you try this patch:
> > 
> > 	http://people.freebsd.org/~pjd/patches/gmirror.patch
> > 
> > (You need to recompile you kernel and geom_mirror.ko module.)
> 
> Hello Pawel,
> 
> Oh dear - this seems to have made it worse :(

Replying to myself, but I've managed to get it working. I've applied 
http://people.freebsd.org/~pjd/patches/root_mount.patch

and set
mount_root_delay="10"
and it has now booted three times without disconnecting da0 :)

So I look forward to the merging of both those patches :)

--

-- 
Chris
(Continue reading)

Pawel Jakub Dawidek | 4 Oct 2004 15:30
Picon
Favicon

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 02:12:22PM +0100, Chris Elsworth wrote:
+> Replying to myself, but I've managed to get it working. I've applied 
+> http://people.freebsd.org/~pjd/patches/root_mount.patch
+> 
+> and set
+> mount_root_delay="10"
+> and it has now booted three times without disconnecting da0 :)
+> 
+> So I look forward to the merging of both those patches :)

Ah, you were using RELENG_5, ok.
Does it work without gmirror.patch?

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
Chris Elsworth | 4 Oct 2004 16:08

Re: SCSI disk getting disconnected on boot

On Mon, Oct 04, 2004 at 03:30:01PM +0200, Pawel Jakub Dawidek wrote:
> On Mon, Oct 04, 2004 at 02:12:22PM +0100, Chris Elsworth wrote:
> +> Replying to myself, but I've managed to get it working. I've applied 
> +> http://people.freebsd.org/~pjd/patches/root_mount.patch
> +> 
> +> and set
> +> mount_root_delay="10"
> +> and it has now booted three times without disconnecting da0 :)
> +> 
> +> So I look forward to the merging of both those patches :)
> 
> Ah, you were using RELENG_5, ok.

Oh, yes, sorry. I thought I'd said. It was 5.3-BETA6 as of October 2nd.

> Does it work without gmirror.patch?

I supped the source tree to BETA7 to clean out the old patches, then
re-applied root_mount.patch - and yes, it still works! Up until now
I'd only ever booted a mirror device with one half, and that was
working fine with 5.3 tree and no additional patches. It seems you
need root_mount.patch to boot with more than one device.

--

-- 
Chris

Gmane