Re: Mirroring Entire Drives Partition Type Clarification

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

 



Jared Raddigan <jraddigan@xxxxxxx> writes:

> Playing with mdadm today I noticed it seems to allow full drive
> mirroring something I remember that raidtools would fail on.
>
>  Back in raidtools days I remember that even though it was possible to
> mirror an entire drive with a single md volume (sda, sdb rather than
> sda1, sdb1) it really did not work and was not recommended.  It looks
> like that is no longer the case with mdadm.   Here is what I did.
>
>  Took two hard drives and created a single partition that spans the
> whole drive.  then do:
>
>  mdadm --create --level=mirror --raid-devices=2 /dev/md1 /dev/sd[ab]1
>
>  Look using mdadm --detail and see
>  Number   Major   Minor   RaidDevice State
>         0       8        1        0      active sync   /dev/sda1
>         1       8       17        1      active sync   /dev/sdb1
>
>
>  I reboot and now using mdadm --detail I see:
>  Number   Major   Minor   RaidDevice State
>         0       8        0        0      active sync   /dev/sda
>         1       8       16        1      active sync   /dev/sdb
>
>  So it would seem mdadm basically figured out what I wanted to do and
> no longer shows the partition number after a reboot.  So next deleted
> all partitions on the drives and recreated the raid set without
> referencing the partitions

Unless you configured your sda1 to actually start of block 0 of sda
instead of after the partitioning block then something went seriously
wrong there.

>  mdadm --create --level=mirror --raid-devices=2 /dev/md1 /dev/sd[ab]
>
>  That worked just fine and now  mdadm --detail gives me the same as
> before (but without rebooting)
>  Number   Major   Minor   RaidDevice State
>         0       8        0        0      active sync   /dev/sda
>         1       8       16        1      active sync   /dev/sdb
>
>
>  My questions are:
>
>  Is there anything wrong with doing this as this was not recommend
> with raidtools.  This with LVM or partition the md directly (cool
> feature you added) seems like a hard combo to beat?
>
>  Does the MBR get synced across the drives when doing this?

If you write to /dev/mdX then it gets synced. if you write to /dev/sdX
then not.

Also be carefull to use a filesystem that leaves the first 63 sectors
of the device unused for the MBR or you will corrupt your filesystem
and MBR every now and then.

>  I know partition type does not seem to matter with mdadm compared to
> raidtools, but when creating partitions I use "da" rather than "fd",
> is that the recommended type or since it no longer seems to matter no
> one really cares what you use?

The kernel cares for raid auto detection. But that only works if all
drivers needed are compiled in and you have the right metadata format.
Starting raid from initramfs totaly ignores the type I blieve.

>  I am using version mdadm - v2.6.7.2 - 14th November 2008 from Debian Lenny
>
>  Thanks and I am pretty excited how mdadm keeps getting better and better.
>
>  --
>  Jared

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

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux