All of lore.kernel.org
 help / color / mirror / Atom feed
* RAID partitions, or RAID disks and partition array?
@ 2014-08-22 16:52 Adam Talbot
  2014-08-22 17:28 ` Piergiorgio Sartor
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Adam Talbot @ 2014-08-22 16:52 UTC (permalink / raw)
  To: linux-raid

I hope this is an easy one.  I have two drives I would like to mirror
as my boot drive.
1) Should I mirror the drives, then partition the RAID device (md0)?
2) Should I partition the the drives then RAID the partitions?

What is the best practice, and why?

Thanks
Adam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RAID partitions, or RAID disks and partition array?
  2014-08-22 16:52 RAID partitions, or RAID disks and partition array? Adam Talbot
@ 2014-08-22 17:28 ` Piergiorgio Sartor
  2014-08-22 17:30   ` Adam Talbot
  2014-08-22 18:34 ` Chris Murphy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Piergiorgio Sartor @ 2014-08-22 17:28 UTC (permalink / raw)
  To: Adam Talbot; +Cc: linux-raid

On Fri, Aug 22, 2014 at 09:52:11AM -0700, Adam Talbot wrote:
> I hope this is an easy one.  I have two drives I would like to mirror
> as my boot drive.
> 1) Should I mirror the drives, then partition the RAID device (md0)?
> 2) Should I partition the the drives then RAID the partitions?
> 
> What is the best practice, and why?

Hi Adam,

if I understand it correctly, being a boot drive,
you'll have to install a boot loader, so you'll
need some space between the beginning of your data
(or RAID in this case) and the boot loader.
This means, as far as I know, your *only* choice
is to partition.

Or I miss something...

bye,

pg

> 
> Thanks
> Adam
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

piergiorgio

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RAID partitions, or RAID disks and partition array?
  2014-08-22 17:28 ` Piergiorgio Sartor
@ 2014-08-22 17:30   ` Adam Talbot
  0 siblings, 0 replies; 7+ messages in thread
From: Adam Talbot @ 2014-08-22 17:30 UTC (permalink / raw)
  To: Piergiorgio Sartor; +Cc: linux-raid

I was wondering about the boot loader problem. Thanks.

On Fri, Aug 22, 2014 at 10:28 AM, Piergiorgio Sartor
<piergiorgio.sartor@nexgo.de> wrote:
> On Fri, Aug 22, 2014 at 09:52:11AM -0700, Adam Talbot wrote:
>> I hope this is an easy one.  I have two drives I would like to mirror
>> as my boot drive.
>> 1) Should I mirror the drives, then partition the RAID device (md0)?
>> 2) Should I partition the the drives then RAID the partitions?
>>
>> What is the best practice, and why?
>
> Hi Adam,
>
> if I understand it correctly, being a boot drive,
> you'll have to install a boot loader, so you'll
> need some space between the beginning of your data
> (or RAID in this case) and the boot loader.
> This means, as far as I know, your *only* choice
> is to partition.
>
> Or I miss something...
>
> bye,
>
> pg
>
>>
>> Thanks
>> Adam
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
>
> piergiorgio

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RAID partitions, or RAID disks and partition array?
  2014-08-22 16:52 RAID partitions, or RAID disks and partition array? Adam Talbot
  2014-08-22 17:28 ` Piergiorgio Sartor
@ 2014-08-22 18:34 ` Chris Murphy
  2014-08-23  1:18 ` NeilBrown
  2014-08-24 10:53 ` David Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Chris Murphy @ 2014-08-22 18:34 UTC (permalink / raw)
  To: linux-raid@vger.kernel.org List


On Aug 22, 2014, at 10:52 AM, Adam Talbot <ajtalbot1@gmail.com> wrote:

> I hope this is an easy one.  I have two drives I would like to mirror
> as my boot drive.
> 1) Should I mirror the drives, then partition the RAID device (md0)?
> 2) Should I partition the the drives then RAID the partitions?
> 
> What is the best practice, and why?

Most common is 2, because it allows you to exclude e.g. swap from being mirrored. If it's included, you will find that scrub checks show bogus mismatches and you won't know for sure if they're due to swap or some real problem. See man 4 md for more information on scrubs and raid1/raid10. There are also bootloader complications that come up with layout 1.

Recovery will involve more steps with layout 2, because you'll be replacing multiple faulty devices: one for each partition on the dead drive.

Since it's to be bootable, you probably want a resiliently bootable setup that can boot degraded. If so you'll want to use partition type code 0xDA, mdadm metadata 1.2, and GRUB2. Why? Because mdadm metadata 1.2 is what's recommended these days and avoids the inconsistency that develops if you mount a filesystem before assembling the md device, which is possible with metadata 0.9 and 1.0. GRUB2 because it reads metadata 1.2 directly, including degraded, and for that matter can even read md raid5/6. The MBR type code 0xDA is obscure and not supported by parted, but is supported by fdisk. 0xFD is intended for metadata 0.9, kernel autodetect. So if you aren't using that version of metadata you should use 0xDA which indicates the partition is not a file system, which it isn't, it's a raid memb
 er device first. The filesystem materializes only once the md device is assembled (degraded or normal).

It's all a bit tricky because as far as I know, no distribution's GUI installer does this exactly correct on all counts. Most are still using 0xFD for type code, and metadata 1.0 or 1.1. It's probably not dangerous or there'd be screaming users. But if you want best practice, use what's recommended. And then if there are bugs you have a lot more leverage in getting them fixed.

Things are slightly different if the firmware is BIOS but you're using GPT partitioning; or if the firmware is UEFI (and of course GPT partitioning). So if either of those are the case, let us know.

Chris Murphy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RAID partitions, or RAID disks and partition array?
  2014-08-22 16:52 RAID partitions, or RAID disks and partition array? Adam Talbot
  2014-08-22 17:28 ` Piergiorgio Sartor
  2014-08-22 18:34 ` Chris Murphy
@ 2014-08-23  1:18 ` NeilBrown
  2014-08-23 22:20   ` Adam Talbot
  2014-08-24 10:53 ` David Brown
  3 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2014-08-23  1:18 UTC (permalink / raw)
  To: Adam Talbot; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

On Fri, 22 Aug 2014 09:52:11 -0700 Adam Talbot <ajtalbot1@gmail.com> wrote:

> I hope this is an easy one.  I have two drives I would like to mirror
> as my boot drive.
> 1) Should I mirror the drives, then partition the RAID device (md0)?
> 2) Should I partition the the drives then RAID the partitions?
> 
> What is the best practice, and why?

I always do '1'.  I use 1.0 metadata so each drive can be used by itself quite
apart from RAID, or can be part of the array.
Boot sectors etc are mirrored so you don't need to be sure that grub writes
to both devices or whatever.

However this is "my" practice rather than "best" practice.  It is entirely
possible that grub might try to be too clever, see a RAID1 and want to do
something to the underlying drives - and then fail when they look wrong.

Ultimately this is a question about how your distro is configured and how
your boot loader works much more than it is a question about md/raid.

Once you choose a distro, you should see what that distro recommends and do
that, because that is the only configuration you can hope to get support for.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RAID partitions, or RAID disks and partition array?
  2014-08-23  1:18 ` NeilBrown
@ 2014-08-23 22:20   ` Adam Talbot
  0 siblings, 0 replies; 7+ messages in thread
From: Adam Talbot @ 2014-08-23 22:20 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

Thank you all for the feed back.  I never knew the FD vs DA partition
stuff.  I have been using FD with metadata 1.2.  Time to fix that. :-)

Any chance at a wiki article about this?

On Fri, Aug 22, 2014 at 6:18 PM, NeilBrown <neilb@suse.de> wrote:
> On Fri, 22 Aug 2014 09:52:11 -0700 Adam Talbot <ajtalbot1@gmail.com> wrote:
>
>> I hope this is an easy one.  I have two drives I would like to mirror
>> as my boot drive.
>> 1) Should I mirror the drives, then partition the RAID device (md0)?
>> 2) Should I partition the the drives then RAID the partitions?
>>
>> What is the best practice, and why?
>
> I always do '1'.  I use 1.0 metadata so each drive can be used by itself quite
> apart from RAID, or can be part of the array.
> Boot sectors etc are mirrored so you don't need to be sure that grub writes
> to both devices or whatever.
>
> However this is "my" practice rather than "best" practice.  It is entirely
> possible that grub might try to be too clever, see a RAID1 and want to do
> something to the underlying drives - and then fail when they look wrong.
>
> Ultimately this is a question about how your distro is configured and how
> your boot loader works much more than it is a question about md/raid.
>
> Once you choose a distro, you should see what that distro recommends and do
> that, because that is the only configuration you can hope to get support for.
>
> NeilBrown

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RAID partitions, or RAID disks and partition array?
  2014-08-22 16:52 RAID partitions, or RAID disks and partition array? Adam Talbot
                   ` (2 preceding siblings ...)
  2014-08-23  1:18 ` NeilBrown
@ 2014-08-24 10:53 ` David Brown
  3 siblings, 0 replies; 7+ messages in thread
From: David Brown @ 2014-08-24 10:53 UTC (permalink / raw)
  To: Adam Talbot, linux-raid

On 22/08/14 18:52, Adam Talbot wrote:
> I hope this is an easy one.  I have two drives I would like to mirror
> as my boot drive.
> 1) Should I mirror the drives, then partition the RAID device (md0)?
> 2) Should I partition the the drives then RAID the partitions?
>
> What is the best practice, and why?
>
> Thanks
> Adam


Mirroring drives is conceptually simpler, and can be faster if you are 
trying to make a system optimised for speed for particular loads. 
Mirroring partitions involves a few more steps, but gives more flexibility.

My usual setup for two drives on a workstation is to use partitions.  I 
have a small partition on each drive, with a raid1 mirror (with 0.9 
metadata), that is used for /boot.  Any bootloader will be happy with 
that.  Then there is a partition on each drive for swap space - the 
kernel will use both as a sort of raid0, so there is no need for raiding 
here (high availability servers would put swap on raid, but it is not 
really needed for "normal" PC's).  The rest of the drives are a single 
large partition, which I then put together with raid10,far2 - or 
possibly a btrfs filesystem with btrfs raid1.

But as has been said, there are no hard and fast rules.  mdadm gives you 
a level of flexibility well beyond anything you get with hardware raid, 
but the cost of that is that you have to make some decisions!  If you 
have a specific setup in mind, you can always ask here for opinions.

David



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-24 10:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 16:52 RAID partitions, or RAID disks and partition array? Adam Talbot
2014-08-22 17:28 ` Piergiorgio Sartor
2014-08-22 17:30   ` Adam Talbot
2014-08-22 18:34 ` Chris Murphy
2014-08-23  1:18 ` NeilBrown
2014-08-23 22:20   ` Adam Talbot
2014-08-24 10:53 ` David Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.