Metadata info.

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Jan 17 04:10:01 PST 2006


On Sat, Jan 14, 2006 at 01:19:02PM -0800, Brent Hostetler wrote:
+> Hello,
+> 
+>   I am trying to understand how metadata works properly within the
+> geom framework. I have been having varying problems which I
+> believe are metadata related.
+> 
+>   I assume from the following quote from gmirro man page
+> that metadata is stored on the last sector of the provider --
+> ie /dev/ad4, /dev/ad4s1, /dev/stripe1, or /dev/stripe1a -- and not
+> necessarily the last sector of the disk.
+> 
+> <quote> The gmirror utility uses on-disk metadata (stored in
+> the provider's last sector) to store all needed information.
+> Since the last sector is used for this purpose,it is possible
+> to place a root file system on a mirror.</quote>
+> 
+> Because of this I notice that when setting up a mirror of a
+> slice you will get error from bsdlabel /dev/ad4 saying
+> bsdlabel: partition c doesn't cover the whole unit!... If you
+> bsdlabel the actual /dev/mirror/data1 it will not issue the
+> warning. The is correct behavior right?
+> 
+> So if you are mirroring /dev/ad4 then you would make sure that
+> the last slice that is created is one sector smaller then the media
+> size in sectors such as example 1.
+> 
+> Example 1:
+> 
+> gmirror label -v -n -b round-robin data1 /dev/ad4
+> 
+> [------ ad4 ------]
+> [-----ad4s1------]*
+> [ad4s1a][-ad4s1d-]*
+> 
+> or
+> 
+> [----------ad4------------]
+> [-----ad4s1----][--ad4s2-]*
+> [ad4s1a][ad4s1b][-ad4s2a-]*

That's correct.

+> If you are operating on slices then you would make sure the last
+> partition in the mirrored slice would be one sector smaller then
+> the slice size in sectors such as example 2 and 3.
+> 
+> Example 2:
+> 
+> gmirror label -v -n -b round-robin data1 /dev/ad4s1
+> 
+> [----------- ad4 --------------]
+> [----ad4s1-----]*[---ad4s2-----]
+> [ad4s1d][ad4s1e]*[---ad4s2a----]
+> 
+> 
+> Example 3:
+> 
+> gmirror label -v -n -b round-robin data1 /dev/ad4s1
+> gmirror label -v -n -b round-robin data2 /dev/ad4s2
+> 
+> [----------- ad4 --------------]
+> [----ad4s1-----]*[---ad4s2----]*
+> [ad4s1d][ad4s1e]*[---ad4s2a---]*

No, example 2:

[----------- ad4 --------------]
[----ad4s1------][---ad4s2-----]
[ad4s1d][ad4s1e]*[---ad4s2a----]

Example 3:

[----------- ad4 --------------]
[----ad4s1------][---ad4s2-----]
[ad4s1d][ad4s1e]*[---ad4s2a---]*


+> If operating on geom's class providers it works the same way
+> correct?
+> 
+> Example 4:
+> 
+> gmirror label -v -n -b round-robin data1 /dev/stripe/stripe1
+> 
+> [------------stripe1-----------]
+> [------stripe1s1--------------]*
+> [------stripe1s1a-------------]*

That's correct.

But the more correct pictures are:

Disk mirroring:
[------------ ad4 ------------]
[-------- mirror/foo --------]*
[------- mirror/foos1 -------]*
[mirror/foos1s][mirror/foos1d]*

Slice mirroring:
[------------ ad4 ------------]
[---- ad4s1 ----][--- ad4s2 --]
[- mirror/foo -]*[-- ad4s2a --]
[ mirror/fooa -]*

Partition mirroring:
[------------ ad4 ------------]
[---- ad4s1 ----][--- ad4s2 --]
[---- ad4s1a ---][-- ad4s2a --]
[- mirror/foo -]*

Stripe mirroring:
[--- stripe/foo ---]
[--- mirror/bar --]*
[-- mirror/bars1 -]*
[- mirror/bars1a -]*

Remember that you can setup slices/partitions on mirror device, you
don't have to do it on plain disk.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20060117/6c7b089f/attachment.bin


More information about the freebsd-geom mailing list