Package: parted Version: 2.3-10 Severity: serious Tags: patch wheezy sid Background: I have added support to the debian installer for installation on Intel Matrix Raid (imsm) arrays as supported by mdadm (I'll be submitting patches to debian-boot soon).
When installing on such an array, partitions are created directly on the array (e.g. /dev/md0). Before kernel 2.6.28, partitionable md arrays were seperate from 'normal' md arrays (different dev_t's), but since 2.6.28 that has been consolidated. However, there is one minor oversight/bug in the kernel: the sysfs "range" key is still set to "1" for md arrays. That means libparted thinks that it's not possible to partition that device, where in fact it is. The attached patch reckognizes that situation: if running on a kernel >= 2.6.28, and the device is a PED_DEVICE_MD, and the sysfs 'range' key is set to '1', _device_get_partition_range() returns MAX_NUM_PARTS instead. Please consider this patch for wheezy. Suggested changelog entry: * starting at kernel 2.6.28, MD devices can be partitioned, but the sysfs "range" key only shows support for one partition/device. Ignore that setting if it's set to "1" and the kernel version is >= 2.6.28. Mike.
Index: parted-2.3/libparted/arch/linux.c =================================================================== --- parted-2.3.orig/libparted/arch/linux.c 2010-05-10 10:57:54.000000000 +0000 +++ parted-2.3/libparted/arch/linux.c 2012-08-05 13:24:14.449768577 +0000 @@ -2415,6 +2415,11 @@ ok = fscanf(fp, "%d", &range) == 1; fclose(fp); + /* starting at 2.6.28 partitions are OK but "range" doesn't show it */ + if (dev->type == PED_DEVICE_MD && range == 1 && + _get_linux_version() >= KERNEL_VERSION (2,6,28)) + ok = 0; + /* (range <= 0) is none sense.*/ return ok && range > 0 ? range : MAX_NUM_PARTS; }