Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jun 2008 12:45:55 -0700
From:      Mark Boolootian <booloo@ucsc.edu>
To:        freebsd-questions@freebsd.org
Subject:   gmirror metadata: end of slice or end of disk?
Message-ID:  <20080627194555.GA42681@root.ucsc.edu>

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

Hi folks,

I'm trying to understand exactly where on disk gmirror is going to write
its metadata, and was hoping I could elicit comments on whether I have
this right or not.

Assume my disk, da1, has a single slice, and I partition it as follows 
(i'm making up sector sizes for the sake of simplicity):

   length   start
a:   100     16     4.2BSD
b:    10     116    swap
c:   626      0
d:   500     126    4.2BSD

If I then use 'gmirror label -v -b round-robin gm0 /dev/da1s1', my
belief is that gmirror will write its metadata into sector 499 (the 
last sector in the slice, which falls in partition 'd').  Thus, the
disk I want to mirror (da0) should have a 'd' partition that is 499
sectors in size.  If it were 500, I would be asking for trouble down
the road.  

Taking a slightly different approach, consider the recommendations here:

  http://lantech.geekvenue.net/chucktips/jason/chuck/1175552464/index_html

where the command to establish the metadata is

  gmirror label -v -b round-robin gm0 /dev/da0

I believe that means the metadata will be written in the last sector of 
the disk.  Presumably this is part of the space left when fdisk is used
to set up the FreeBSD slice (assuming a single slice - and i'm assuming
there is virtually always space left), so the recommendation (setting up 
gmirror on your live system disk) should work.  Have I got that right?

Assuming a single slice configuration, is there a reason to prefer
one approach over the other?  (i.e. metadata at end of slice versus
at end of disk)?

thanks in advance,
mark



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