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

Bug#504397: ext2_or_ext3_boot check fails when /boot is RAID

We have a partman check that ensures on some devices that the /boot
partition is the 1st primary partition.  Unfortunately this check
fails when /boot is a RAID device, but it's actually valid for /boot
to be a RAID1 device (as long as its physical partition is the 1st
primary partition).

There's currently no good way to map the RAID device to its physical
partition to performs these checks, so I was thinking of applying a
patch for lenny to skip the check if the /boot device is RAID1.

OK to apply?  (I don't think many users are affected by this, so this
isn't crucial)

Index: check.d/ext2_or_ext3_boot
--- check.d/ext2_or_ext3_boot	(revision 57101)
+++ check.d/ext2_or_ext3_boot	(working copy)
@@ -60,6 +60,17 @@
 # The boot file system has to be the first primary partition
+# ... but for now don't run the check if /boot is on RAID1.  Right now,
+# there's no good way to map a RAID device to its physical partition
+# and then run the checks on that partition (see #509799).
+if echo $boot_path | grep -q "^/dev/md"; then
+	raid=${boot_path#/dev/}
+	if grep "^$raid" /proc/mdstat | grep -q " raid1 "; then
+		exit 0
+	fi
 part_num=$(echo "$boot_path" | sed -e 's/.*[^0-9]\+//')
 if [ "$boot_type" != primary ] || [ "$part_num" -ne 1 ]; then
 	db_set partman/boot_not_first_partition true
Index: debian/changelog
--- debian/changelog	(revision 57101)
+++ debian/changelog	(working copy)
@@ -1,9 +1,16 @@
 partman-ext3 (56) UNRELEASED; urgency=low
+  [ Colin Watson ]
   * check.d/nomountpoint_ext3:
     - partman-ext3/no_mount_point is a boolean, not a select (thanks,
       Nicolas Valcárcel; LP: #256459).
+  [ Martin Michlmayr ]
+  * check.d/ext2_or_ext3_boot: when a RAID1 partition is used for /boot
+    don't check whether it's the 1st primary partition.  There's no good
+    way to map a RAID partition to its physical partition at the moment.
+    (Works around #504397).
  -- Colin Watson <cjwatson@debian.org>  Fri, 26 Dec 2008 13:56:13 +0000
 partman-ext3 (55) unstable; urgency=low

Martin Michlmayr

Reply to: