Re: Newbie gmirror questions

2010-02-05 Thread Mike Clarke
On Sunday 17 January 2010, Matthew Seaman wrote:

 However, one of the really amazingly brilliant things about geom is
 that just about any disk / storage related thing can be a geom
 provider, and geom constructs will nest very happily.  Here's a howto
 for setting up gmirror across a pair of slices:

 http://people.freebsd.org/~rse/mirror/

Thanks for all the advice, my mirrors are now up and running on 2 of the 
4 slices without any problems.

But just one last dumb question. Does gmirror consider one of the 
consumers to act as a master for the pair? The reason I ask is that 
earlier today I needed to disconnect a few cables inside the PC to get 
better access to a bit of internal hardware and then realised that 
although I knew which two SATA connectors to use for the mirror drives 
I'd failed to make a note of which order the drives were connected. I 
felt about 75% sure I'd paired them up the same way as before so went 
ahead, everything started up OK and gmirror status shows the status 
for both mirrors as COMPLETE. Now I'm wondering if I was just lucky 
or if it just doesn't matter if the order of mirror consumers is 
interchanged after creation.

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie gmirror questions

2010-02-05 Thread Modulok
 Does gmirror consider one of the consumers to act as a master for the pair?

No. The order doesn't matter. You could take out your hard drives and
shuffle them like cards and it wouldn't matter. All metadata is stored
in the last sector of the drives themselves. Cable order is
irrelevant.

-Modulok-


On 2/5/10, Mike Clarke jmc-freeb...@milibyte.co.uk wrote:
 On Sunday 17 January 2010, Matthew Seaman wrote:

 However, one of the really amazingly brilliant things about geom is
 that just about any disk / storage related thing can be a geom
 provider, and geom constructs will nest very happily.  Here's a howto
 for setting up gmirror across a pair of slices:

 http://people.freebsd.org/~rse/mirror/

 Thanks for all the advice, my mirrors are now up and running on 2 of the
 4 slices without any problems.

 But just one last dumb question. Does gmirror consider one of the
 consumers to act as a master for the pair? The reason I ask is that
 earlier today I needed to disconnect a few cables inside the PC to get
 better access to a bit of internal hardware and then realised that
 although I knew which two SATA connectors to use for the mirror drives
 I'd failed to make a note of which order the drives were connected. I
 felt about 75% sure I'd paired them up the same way as before so went
 ahead, everything started up OK and gmirror status shows the status
 for both mirrors as COMPLETE. Now I'm wondering if I was just lucky
 or if it just doesn't matter if the order of mirror consumers is
 interchanged after creation.

 --
 Mike Clarke
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie gmirror questions

2010-01-18 Thread Mike Clarke
On Sunday 17 January 2010, Matthew Seaman wrote:

 However, one of the really amazingly brilliant things about geom is
 that just about any disk / storage related thing can be a geom
 provider, and geom constructs will nest very happily.  Here's a howto
 for setting up gmirror across a pair of slices:

 http://people.freebsd.org/~rse/mirror/

That's a very interesting article. Since I'll be able to configure the 
mirror on the new drives before installing any software my approach can 
be a bit simpler.

In the example he's using a single partition for the whole disk but 
reduces the size if the partition by one block so that the mirror's 
meta data doesn't get misinterpreted as whole disk meta data. Since I 
anticipate using only the first 2 partitions for a couple of mirrors 
and using the rest of the disk as plain partitions then I don't think I 
need to do this but might it still be a good idea to reduce the last 
partition by one block anyway in case my usage changes in the future?

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie gmirror questions

2010-01-17 Thread Mike Clarke
On Saturday 16 January 2010, Pieter de Goeje wrote:

 On Saturday 16 January 2010 00:34:52 Mike Clarke wrote:
  I'm about to upgrade to more disk space and I'm tempted use this as
  an opportunity to get two disks and implement gmirror. Before I go
  ahead there's a few aspects of mirroring I'm not sure about and
  would appreciate some advice.
 
  I'm using grub for multi booting. Does this introduce any problems
  if I want to boot into Windows or Linux on one of the other
  partitions?

 Gmirror stores the metadata at the last sector of each disk. So this
 shouldn't be a problem. But other operating systems might overwrite
 this data if you're not careful during the paritioning.

I'll make sure that the last stripe on the disk isn't used by 
any alien OS then.

Actually I was more concerned about what happens when I boot into 
another OS like Windows or Linux on one of the spare slices - I'm 
assuming that I have to apply gmirror to the whole disk rather than 
just selected slices?

My main reason for multibooting with grub is to have a spare slice where 
I can install a spare copy of FreeBSD. I find this very useful when I 
do any major upgrade (like trying out your suggestion of going to 
8-STABLE) because I can copy the current system onto the spare slice 
and use that to apply the upgrades, if I hit any major problems I can 
easily revert to booting the original slice until I figure out how to 
fix the problem. I'm assuming that using gmirror won't prevent me from 
doing this.

If I boot into an OS which isn't aware of gmirror, such as Windows, then 
I assume it will just run normally if I point grub to the appropriate 
slice on the primary drive. Next time I boot into FreeBSD then I expect 
gmirror will recognise that the second drive is out of sync with the 
primary and update it in the background. Perhaps this might hit 
performance for a while but on the other hand it provides me with a 
certain amount of backup if the Windows system trashes itself because 
I could try to restore it from the copy on the second drive before 
attempting to reboot FreeBSD. I assume the same logic would also apply 
to running Linux on one of the slices, although Linux has software 
mirror capability it appears to be totally different from gmirror so I 
expect it's a case of running that non-mirrored too. If this approach 
isn't wise then I expect I'll need to keep a spare non-mirrored disk 
for the other systems.

I don't expect to need to boot into Windows or Linux very often. Now 
that I've upgraded from FreeBSD 6.4 to 8.0 I'm able to make use of 
virtualbox for this sort of thing which is generally much more 
convenient but I'd like to keep the ability to run them natively should 
the need arise.

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie gmirror questions

2010-01-17 Thread Matthew Seaman

Mike Clarke wrote:

Actually I was more concerned about what happens when I boot into 
another OS like Windows or Linux on one of the spare slices - I'm 
assuming that I have to apply gmirror to the whole disk rather than 
just selected slices?


You can't do this.  gmirror is FreeBSD specific, and other OSes can't
deal with it.  You can take your two drives, partition them (fdisk) and
then create a gmirror across the slices you assign to FreeBSD.  Similarly
you could set up md to mirror the slice(s) used for Linux.  As far as I
know, Windows doesn't come with OS level mirroring software -- it can use
hostraid[*], or I believe there are some commercial solutions you can
purchase.  Or just treat your Windows partitions as two separate drives,
and live without resilience for that OS.

As far as booting the system goes, Grub should be able to boot each OS
from either mirror as if it was a plain installation on a single drive.

Wilder suggestions would be to install Linux, Open Solaris or NetBSD as a
Xen dom0, and then install your other OSes as domU guests.  In this case,
you'ld mirror the storage within the dom0 instance and export a device to
each of the client OSes.  [Open Solaris particularly interesting for this
purpose, as you could use ZFS.]  This is substantially more complex to set
up than your current plan, but does have the very handy advantage that you
can run all of your OSes simultaneously.

Cheers,

Matthew


[*] FreeBSD can use this too -- the disks appear as an ar device (see ata(4))
-- and presumably so can Linux, but I can't confirm that.  Hostraid is
generally second best to OS based RAIDs.  Apart from anything else, you tend
to have to bring the system down to the BIOS level to do anything to the
RAIDs.

--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Newbie gmirror questions

2010-01-17 Thread Mike Clarke
On Sunday 17 January 2010, Matthew Seaman wrote:

 Mike Clarke wrote:
  Actually I was more concerned about what happens when I boot into
  another OS like Windows or Linux on one of the spare slices - I'm
  assuming that I have to apply gmirror to the whole disk rather than
  just selected slices?

 You can't do this.  gmirror is FreeBSD specific, and other OSes can't
 deal with it.  You can take your two drives, partition them (fdisk)
 and then create a gmirror across the slices you assign to FreeBSD.

This will make things a lot easier for me. I think all the examples of 
gmirror I've seen used things like /dev/da0 as the provider in label 
commands so I assumed that I had to use the whole physical disk but if 
I can mirror individual slices then I have much more flexibility.

My motherboard has a UDMA133 controller for ata0  ata1 (which I don't 
use) and 2 SATA controllers for ata2 to ata5 so with my 2 SATA drives 
spread between the controllers on channels 2  4 I could have something 
like /dev/mirror/gm1 provided by /dev/ad2s1  /dev/ad4s1 
and /dev/mirror/gm2 provided by /dev/ad2s2  /dev/ad4s2 for a couple of 
FreeBSD systems. That will leave me with 2 spare slices on each drive 
for other purposes. Any Windows or Linux stuff I put on tends to be 
mainly experimental and less long term than my FreeBSD system so don't 
really need the resilience of being mirrored.

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie gmirror questions

2010-01-17 Thread Matthew Seaman

Mike Clarke wrote:

On Sunday 17 January 2010, Matthew Seaman wrote:


Mike Clarke wrote:

Actually I was more concerned about what happens when I boot into
another OS like Windows or Linux on one of the spare slices - I'm
assuming that I have to apply gmirror to the whole disk rather than
just selected slices?

You can't do this.  gmirror is FreeBSD specific, and other OSes can't
deal with it.  You can take your two drives, partition them (fdisk)
and then create a gmirror across the slices you assign to FreeBSD.


This will make things a lot easier for me. I think all the examples of 
gmirror I've seen used things like /dev/da0 as the provider in label 
commands so I assumed that I had to use the whole physical disk but if 
I can mirror individual slices then I have much more flexibility.


My motherboard has a UDMA133 controller for ata0  ata1 (which I don't 
use) and 2 SATA controllers for ata2 to ata5 so with my 2 SATA drives 
spread between the controllers on channels 2  4 I could have something 
like /dev/mirror/gm1 provided by /dev/ad2s1  /dev/ad4s1 
and /dev/mirror/gm2 provided by /dev/ad2s2  /dev/ad4s2 for a couple of 
FreeBSD systems. That will leave me with 2 spare slices on each drive 
for other purposes. Any Windows or Linux stuff I put on tends to be 
mainly experimental and less long term than my FreeBSD system so don't 
really need the resilience of being mirrored.




Yes -- there's an On-Lamp article by Dru Lavigne that has been particularly
influential, and gmirror'ing whole disks is the best way forwards for the
vast majority of cases where you've a server dedicated to one OS.

However, one of the really amazingly brilliant things about geom is that
just about any disk / storage related thing can be a geom provider, and 
geom constructs will nest very happily.  Here's a howto for setting up

gmirror across a pair of slices:

http://people.freebsd.org/~rse/mirror/

It's fairly old now, but the essentials are still correct.  The one thing
that has changed in the intervening time is what is the best algorithm
to use for the gmirror.  Up until the release of 8.0, 'round-robin' was 
virtually always the right choice, but nowadays 'load' is preferred.

All that means, is change the following line in rse's article from:

gmirror label -v -n -b round-robin ${gm} /dev/${d2}s1

to

gmirror label -v -n -b load ${gm} /dev/${d2}s1


Cheers,

Matthew

--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Newbie gmirror questions

2010-01-17 Thread Volodymyr Kostyrko

On 17.01.2010 19:18, Matthew Seaman wrote:

Mike Clarke wrote:


Actually I was more concerned about what happens when I boot into
another OS like Windows or Linux on one of the spare slices - I'm
assuming that I have to apply gmirror to the whole disk rather than
just selected slices?


You can't do this. gmirror is FreeBSD specific, and other OSes can't
deal with it. You can take your two drives, partition them (fdisk) and
then create a gmirror across the slices you assign to FreeBSD. Similarly
you could set up md to mirror the slice(s) used for Linux. As far as I
know, Windows doesn't come with OS level mirroring software -- it can use
hostraid[*], or I believe there are some commercial solutions you can
purchase. Or just treat your Windows partitions as two separate drives,
and live without resilience for that OS.


I can correct you here. XP Pro and later do know about 'dynamic' disks 
and they can make mirrors from them. Booting from such disks is a kind 
pain in the ass but it works for RAID0, RAID1, RAID0+1 and RAID5 setup.


I can be wrong, I'm not a Win-fan, I just do know this exists. You can 
find details here:


http://support.microsoft.com/default.aspx/kb/816307

--
Sphinx of black quartz judge my vow.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie gmirror questions

2010-01-16 Thread Pieter de Goeje
On Saturday 16 January 2010 00:34:52 Mike Clarke wrote:
 I'm about to upgrade to more disk space and I'm tempted use this as an
 opportunity to get two disks and implement gmirror. Before I go ahead
 there's a few aspects of mirroring I'm not sure about and would
 appreciate some advice.

 I'm using grub for multi booting. Does this introduce any problems if I
 want to boot into Windows or Linux on one of the other partitions?

Gmirror stores the metadata at the last sector of each disk. So this shouldn't 
be a problem. But other operating systems might overwrite this data if you're 
not careful during the paritioning.


 The gmirror manpage describes the procedure for handling kernel dumps
 using the prefer balance algorithm in the early stages of booting and
 then switching to round-robin in the /etc/rc.local script. It then goes
 on to say that If on the next boot a component with a higher priority
 will be available, the prefer algorithm will choose to read from it and
 savecore(8) will find nothing. Does this only arise if I've made some
 change to the configuration of the mirror between the dump and the
 reboot or is there some instances when the priority automatically
 changes?

Priority never changes automatically.


 Some of the articles I've read about gmirror suggest setting the balance
 to round-robin while others just leave this at the default setting of
 split. Am I right in assuming that round-robin would give better
 performance, and does it make much noticeable difference in real terms.
 In particular am I likely to see a reduction in performance using
 gmirror compared with what I would get with just a normal single disk.

Assuming you have two or more regular HDDs, I can recommend updating to 
8-STABLE and using the load algorithm. It has had some major improvements 
lately, and is now the default. It should give equal or better read 
performance in comparison to a single disk in all cases. The performance 
of split and round-robin is very dependent on the access patterns and 
stripe size (for split).


 Finally, recent articles say to set kern.geom.debugflags to 17 when
 creating a mirror on a mounted drive while older articles say to set it
 to 16. Although I'll probably be creating the mirror on my disks before
 copying my system onto them so I don't really need to worry about
 setting this flag but I'm curious to know the difference between using
 the two values.

The sysctl is a bitfield, so 17 (0x11) enables some extra stuff compared to 16 
(0x10). See geom(4), section DIAGNOSTICS for more details.

-- 
Pieter de Goeje
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org