[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mdadm and UUIDs for its component drives



On Sun, Jun 26, 2011 at 9:55 AM, Luke Kenneth Casson Leighton
<luke.leighton@gmail.com> wrote:
> On Sun, Jun 26, 2011 at 2:25 PM, Andrew McGlashan
> <andrew.mcglashan@affinityvision.com.au> wrote:
>
>> Anyway.... the long and short of it is, I can use mdadm without regard to
>> what devices are found, such as /dev/sda /dev/sdb /dev/sdc and the like as I
>> rely purely on the UUID functionality, which as you know, mdadm handles
>> perfectly well.  ;-)
>
>  :)
>
>  ...mmmm you see, this is the bit that has me concerned.  /dev/mdN can
> be referred to by its unique UUID, but that's *not* what i'm referring
> to.  and, from what you're saying, you appear to be implying that yes,
> the external drives can pop up as /dev/sda through /dev/sdc and be
> "confused" - and thus it is pure luck (or actually design) that the
> drives *happen* to all be part of the same identical RAID-1 mirroring
> array.
>
>  so i realise martin that you've already answered, but it would be
> really good if you could explicitly confirm:
>
>  yes, mdadm names its RAID drives by UUID (as can clearly be seen in
> /dev/mdadm/mdadm.conf) but does it *also* refer to its *COMPONENT*
> drives (internally, and non-obviously, and undocumentedly) by UUID and
> then report to the outside world that it's using whatever name
> (/dev/sdX) which can, under these external-drives scenario, change.

I've never plugged a USB drive into a mdadm'd box so I'm trying to get
my head around this - and check whether I'm understanding you
correctly.

You have "/" set up as a RAID 1 array md0 with sda1 and sdb1 as its components.

You plug in a USB drive and its first/only partition become sda1.

mdadm tries to assemble the USB drive's sda1 with sdb1 (whether it's
the old sda1 or the old sdb1) even though sda1 doesn't have md0's
(array) UUID in its metadata, let alone any mdadm metadata!


Reply to: