All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Bellaby <member@bellaby.freeserve.co.uk>
To: linux-kernel@vger.kernel.org
Subject: RAID10 overwrites partition tables
Date: Fri, 26 Nov 2004 18:23:58 +0100 (CET)	[thread overview]
Message-ID: <22941355.1101489838173.JavaMail.www@wwinf3001> (raw)

mdadm --level 10 does not seem to respect disk partition boundaries.

Whilst trying to construct a small RAID10 array on a workstation, I naturally attempted
to set the array up over partitions to leave somewhere for grub to access the kernel.
Using partitions also assists with booting Fedora 3 as it relies on RAID autodetection
and partition labels in its standard initial ram disk.

However, the RAID10 seems to overwrite some of the partition tables.

For example, configuring a RAID10 array over 3 partitions as follows:

        mdadm --create /dev/md0 --level 10 --raid-devices 3 \
                /dev/sda1 /dev/sdb1 /dev/sdc1

seems to overwrite the partition tables for the disks in the
same way as configuring RAID10 over the complete disks:

        mdadm --create /dev/md0 --level 10 --raid-devices 3 \
                /dev/sda /dev/sdb /dev/sdc

A more detailed example:

        echo ',,fd' | sfdisk /dev/sda
        echo ',,fd' | sfdisk /dev/sdb
        echo ',,fd' | sfdisk /dev/sdc

        mdadm --create /dev/md0 --level 10 --raid-devices 3 \
                /dev/sda1 /dev/sdb1 /dev/sdc1

        mke2fs /dev/md0

        sfdisk -d /dev/sda
        sfdisk -d /dev/sdb
        sfdisk -d /dev/sdc

One of the partition tables in the above example will be replaced with
the start of the second chunk of the ext2 fs, just as one would expect
with an array configured over /dev/sda, dev/sdb and /dev/sdc.

The problem appears consistently on my test system (minimal Fedora 3 on
an NForce3 system using the sata_nv.ko device driver). I have had the
same results with a separate, identical system, and when using various
custom 2.6.9 kernels. However, the problems do not appear with RAID5.

The code in raid10.c is probably to blame. A cursory examination suggests
that raid10.c accesses the configured devices using very similar code to
raid1.c (where the problem might go unnoticed) but rather differently from
raid5.c.

Felix

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm

             reply	other threads:[~2004-11-26 21:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-26 17:23 Felix Bellaby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-11-26 17:28 RAID10 overwrites partition tables Felix Bellaby
2004-11-27  0:02 ` Neil Brown
2004-11-27 18:12 Felix Bellaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22941355.1101489838173.JavaMail.www@wwinf3001 \
    --to=member@bellaby.freeserve.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.