gmirror disks vs partitions
lists at jnielsen.net
Wed Jan 17 16:04:29 UTC 2007
On Wednesday 17 January 2007 06:29, Andrew Pantyukhin wrote:
> On 1/17/07, Josef Karthauser <joe at freebsd.org> wrote:
> > A poll for opinions if I may?
> > I've got a few gmirrors running on various machines, all of which
> > pair up two drives at the physical level (i.e. mirror /dev/ad0s1
> > with /dev/ad1s1). Of course there are other ways of doing it to,
> > like mirroring at the partition level, ie pairing /dev/ad0s1a with
> > /dev/ad1s1a, /dev/ad0s1e with /dev/ad0s1e, etc.
> > Apart from potentially avoiding a whole disk from being copied
> > during a resync after a crash, are there any other advantages to
> > using partition level mirroring instead of drive level mirroring?
> I can imagine people using partition-level raid to
> implement a popular configuration:
> You divide a couple of identical drives proportionally
> in two partitions each, place a couple of the first
> partitions into gmirror and a couple of the second
> ones into gstripe. This way you get both reliable and
> fast storage with just two drives. Some strings are
The reduced likelihood of needing to rebuild a given volume is usually enough
of an argument for me to mirror at the partition level. Of course, the other
side of the coin is that if more than one volume on a given pair of disks
needs to be rebuilt, the disks will be twice (or more) as hammered (and less
efficient due to the greater number of seeks) during the rebuild(s).
If you want to be creative/exotic then it's sometimes useful to use partitions
as building blocks for odd (or "advanced") volume configurations. For
instance, let's say you're trying to get some disk redundancy for your
workstation but you're limited to whatever drives you can scrounge up. (Have
_I_ ever been in this position? nah... :) ) You have a 40GB disk, a 60GB
disk, and an 80GB disk. If you partition them up right and use gmirror with
gstripe, it's possible to use all of the space and still be able to survive
the failure of any one disk. Divide everything up into partitions of equal
sizes. For an even number of disks you can use the GCD of the sizes as the
partition size, but since there's an odd number of disks in this example
we'll use GCD/2 or ~10GB. Pair one partition on the 40GB disk with one on the
60GB disk. Then pair all of the partitions on the 80GB disk with the
remaining partitions on the 40 and 60 GB disks. Make each pair into a gmirror
volume. If you need to boot from the array, pick one pair to be your system
volume. The rest of the gmirrors can all be added into a gstripe volume, so
you end up with 90GB (or 80+10) of redundant storage with quite good
performance (not that I would know, of course). You can use the leftover bits
for swap, etc. The two drawbacks to this approach vs a two-disk mirror are
increased likelihood of drive failure (due to the greater number of disks)
and a more complex recovery procedure if a drive fails (especially if you
don't have a spare identical to or slightly larger than the one that failed).
Just some thoughts..
More information about the freebsd-fs