[PATCH] fix multipath partition naming
Guido Guenther
agx at sigxcpu.org
Wed Apr 23 14:16:13 BST 2008
Multipath partitions are named -partX according to the upstream udev
rule:
ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \
RUN+="/sbin/kpartx -a -p -part /dev/$kernel"
---
libparted/arch/linux.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index da1c858..22deb9d 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2016,6 +2016,13 @@ _device_get_part_path (PedDevice* dev, int num)
/* replace /disc with /path%d */
strcpy (result, dev->path);
snprintf (result + path_len - 5, 16, "/part%d", num);
+#ifdef ENABLE_DEVICE_MAPPER
+ } else if (dev->type == PED_DEVICE_DM &&
+ strcmp(dev->dmtype, "multipath") == 0) {
+ /* This is what multipath-tools upstream and Debian uses, it's
+ * a pure userpace (udev) decision! */
+ snprintf (result, result_len, "%s-part%d", dev->path, num);
+#endif
} else if (dev->type == PED_DEVICE_DAC960
|| dev->type == PED_DEVICE_CPQARRAY
|| dev->type == PED_DEVICE_ATARAID
--
1.5.5
--LZvS9be/3tNcYl/X--
More information about the Parted-maintainers
mailing list