[parted-devel] md blacklisting breaks Debian installer RAID support
Colin Watson
cjwatson at ubuntu.com
Sun Jul 26 09:32:04 UTC 2009
On Sun, Jul 26, 2009 at 01:38:35AM +0200, Karel Zak wrote:
> On Fri, Jul 24, 2009 at 12:52:26PM +0100, Colin Watson wrote:
> > diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> > index 5699197..f875581 100644
> > --- a/libparted/arch/linux.c
> > +++ b/libparted/arch/linux.c
> > @@ -1985,7 +1985,6 @@ _skip_entry (const char *name)
> > { ".", sizeof (".") - 1 },
> > { "..", sizeof ("..") - 1 },
> > { "dm-", sizeof ("dm-") - 1 },
> > - { "md", sizeof ("md") - 1 },
> > { "loop", sizeof ("loop") - 1 },
> > { "ram", sizeof ("ram") - 1 },
> > { 0, 0 },
> > @@ -2180,6 +2179,18 @@ _partition_is_mounted (const PedPartition *part)
> > }
> >
> > static int
> > +_has_partitions (const PedDisk* disk)
> > +{
> > + PED_ASSERT(disk != NULL, return 0);
> > +
> > + /* Some devices can't be partitioned. */
> > + if (!strcmp (disk->type->name, "loop"))
> > + return 0;
> > +
> > + return 1;
> > +}
>
> Incorrect.
>
> Linux kernel (since 2.6.26) supports partitioned /dev/loopN devices.
> (patch 476a4813cfddf7cf159956cc0e2d3c830c1507e3)
You are confused (understandably) about what disk->type->name "loop"
means. It does not identify /dev/loop* devices; it is a disk label type
in libparted that only supports one partition. Please see
libparted/labels/loop.c.
If you want to partition /dev/loop* devices, don't use the "loop" label
type.
> I also think that device-mapper devices could be partitioned (and
> somewhere on the way to Linux upstream is a patch with BLKRRPART
> support for dm devices).
And in that case you wouldn't put a "loop" label on them.
--
Colin Watson [cjwatson at ubuntu.com]
More information about the parted-devel
mailing list