How do I gmirror slices?

Hansa mythtv at logic-q.nl
Sun Jan 28 21:04:39 UTC 2007


> > > Van: R. B. Riddick [mailto:arne_woerner at yahoo.com]
> > > > Offset       Size(ST)        End     Name  PType       Desc  Subtype
> > > > Flags
> > > >
> > > >          0         63         62        -     12     unused        0
> > > >         63   12578832   12578894    ad4s1      8    freebsd      165
> > > >   12578895  147814065  160392959    ad4s2      8    freebsd      165
> > > >  160392960  425706435  586099394    ad4s3      8    freebsd      165
> > > >  586099395      15309  586114703        -     12     unused        0
> > > >
> > Considder my setup below:
> > [----------------------- ad4 ----------------------] (disk)
> > [--------- s1 ---------][---- s2 ----][---- s3 ----] (slices)
> > [[--a--][--b--][--d--]*][[--- d ---]*][[--- d ---]*] (partitions)
> >
> > I think the metadata is stored at '*'
> > Is it one sector (512Bytes?) smaller than size(a) + size(b) +
> size(d) (same
> > for s2d and s3d).
> >
> I would say: s1 is one sector larger than size(a)+size(b)+size(d).
> And s2 is 1 sector (512B most likely; depends on ur disks) larger
> than size(d).
> And s3 dito...
Your o so right. Twas late you know :)

> > # /dev/ad4s1:
> > 8 partitions:
> > #        size   offset    fstype   [fsize bsize bps/cpg]
> >   a:  4192256        0    4.2BSD        0     0     0
> >   b:  4192256  4192256      swap
> >   c: 12578832        0    unused        0     0         # "raw" part,
don't edit
> >   d:  4194320  8384512    4.2BSD        0     0     0
> >
> Here we see, that d ends on the last sector of slice 1 (s1).
> So u need to shrink partition d by one sector.
> Since UFS might use that sector, u need an all new file system
> for partition
> d...
How do you determine that it's on the last sector?

> Maybe u want to it like this:
> 1. fdisk ur new disk first
Should I create the the new disk (ad6) slice size exactly as on ad4?

> 2. then setup the gmirror-s on the new disk (1. gmirror with only
> one slice per
> mirror; 2. bsdlabel on the gmirror devices (u can use the full
> area, because
> gmirror hides the last sector of the slice)).
> 3. then copy ad4s3d to some backup media.
> 4. then setup the gstripe or gconcat.
> 5. then copy the filesystems ad4s1a, ad4s1d and ad4s2d to the gmirror-ed
> partitions mirror1a, mirror1d, mirror2d
> 6. then restore the backup for the gstripe
> 7. add the slices ad4s1 and ad4s2 to the gmirror
> 8. ready... :-)
Hmm.. I'm already stuck at 1. Since I've never done this before, can you
help me on my way by specifying the correct commands? Here's what I've come
up with so far:
1. Using fdisk in /stand/sysinstall presuming same slice size as ad4.
2. # gmirror label -v -b round-robin gm0 /dev/ad6s1
   # gmirror label -v -b round-robin gm0 /dev/ad6s2
3. # dd if=/dev/ad4s3d of=/mnt/netwshare/ad4s3d.backup
4. Have not dug into that yet.
5. I guess you mean copying ad4s1a, ad4s1b, ad4s1d and ad4s2d to te
gmirror-ed. Can I use dd for that?
6. dd or tar the backup on the stripe
7. Eh..
8. ...

Tnx. - Hansa




More information about the freebsd-geom mailing list