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

Bug#468799: add multipath support



Package: partman-auto
Version: 76
Severity: wishlist
Depends: 442236

Hi,
attached patch allows multipathed devices to be used for auto
partitioning.
Cheers,
 -- Guido
>From 70c808621377cf27f248f772c32ed244465a3713 Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx@sigxcpu.org>
Date: Sat, 1 Mar 2008 15:51:04 +0100
Subject: [PATCH] allow multipathed devices as auto_disks

---
 packages/partman/partman-auto/lib/auto-shared.sh |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/packages/partman/partman-auto/lib/auto-shared.sh b/packages/partman/partman-auto/lib/auto-shared.sh
index f426a37..15cca07 100644
--- a/packages/partman/partman-auto/lib/auto-shared.sh
+++ b/packages/partman/partman-auto/lib/auto-shared.sh
@@ -146,16 +146,18 @@ create_partitions() {
 }
 
 get_auto_disks() {
-	local dev device
+	local dev device dmtype
 
 	for dev in $DEVICES/*; do
 		[ -d "$dev" ] || continue
 
-		# Skip /dev/mapper/X and /dev/mdX devices
+		# Skip /dev/mapper/X and /dev/mdX but not multipath devices
 		device=$(cat $dev/device)
 		$(echo "$device" | grep -q "/dev/md[0-9]*$") && continue
-		$(echo "$device" | grep -q "/dev/mapper/") && continue
-
+		if echo $device | grep -q ^/dev/mapper/; then
+			dmtype=$(dm_table $device)
+			[  "$dmtype" = multipath ] || continue
+		fi
 		printf "$dev\t$(device_name $dev)\n"
 	done
 }
-- 
1.5.4.1


Reply to: