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

Bug#494910: partman-crypto: No longer allows to manually create LVM on crypto setup

reassign 494910 partman-lvm
tags 494910 + patch

On Wed, Aug 13, 2008 at 02:21:28AM +0200, Frans Pop wrote:
> This is probably not a bug in partman-crypto itself, but I think that's 
> the best place to start. Potential culprits include libparted, 
> partman-base and partman-lvm...

This bug seems triggered by recent changes in parted, but is actually in

> […]
> And:
> # ls /dev/mapper/
> control    hda6_crypt    hda6_cryptp1
> This last device obviously should NOT be there.

This last devices is created because update.d/lvm_sync_flag did not skip
crypto devices and did set the "lvm" flag on the "virtual" partition.
The result is that partman believes that the "virtual" (of type loop)
has been changed and apply these changes on commit.

It then gets everything wrong and create the _cryptp1 partition.

update.d/lvm_sync_flag previously partitions on RAID devices, but this
must also be done for partition on crypto devices.  And actually, it
looks to me like we could skip every disk with partition type "loop"
from LVM flag settings.

The attached patch fixed the issue in my tests.

Jérémy Bobbio                        .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
commit 3f093d528f2e2c4b957851802184b3fb2569a77f
Author: Jérémy Bobbio <lunar@debian.org>
Date:   Fri Aug 15 13:31:02 2008 +0200

    Skip devices of type "loop" in lvm_sync_flag
    Device of type loop (e.g. RAID or crypto) do not handle flag setting
    correctly.  Previously, only LVM on /dev/md* partitions were skipped in
    lvm_sync_flag.  We now skip every devices with the partition type "loop"
    to also skip crypto devices.
    (Closes: #494910)

diff --git a/packages/partman/partman-lvm/debian/changelog b/packages/partman/partman-lvm/debian/changelog
index c4d0284..d71ddbd 100644
--- a/packages/partman/partman-lvm/debian/changelog
+++ b/packages/partman/partman-lvm/debian/changelog
@@ -1,3 +1,11 @@
+partman-lvm (63) UNRELEASED; urgency=low
+  [ Jérémy Bobbio ]
+  * Don't fiddle with label on devices of type loop (e.g. RAID or crypto) in
+    update.d/lvm_sync_flag.  (Closes: #494910)
+ -- Jérémy Bobbio <lunar@debian.org>  Fri, 15 Aug 2008 14:31:06 +0200
 partman-lvm (62) unstable; urgency=low
   [ Jérémy Bobbio ]
diff --git a/packages/partman/partman-lvm/update.d/lvm_sync_flag b/packages/partman/partman-lvm/update.d/lvm_sync_flag
index ecaa0c5..d70b93d 100755
--- a/packages/partman/partman-lvm/update.d/lvm_sync_flag
+++ b/packages/partman/partman-lvm/update.d/lvm_sync_flag
@@ -24,15 +24,12 @@ if [ -f $id/method ]; then
 	method=$(cat $id/method)
-# As setting flags on RAID devices does not work and causes errors from
-# libparted, do not attempt to sync flags in case of LVM on RAID.
-# This is in line with the hacks in init.d/lvm and undo.d/lvm.
-# Note: must cover both /dev/md/X and /dev/mdX devices.
-if [ -f device ]; then
-	case $(cat device) in
-	    /dev/md*)
-		exit 0 ;;
-	esac
+# Don't fiddle with label on devices where there is no "real" partitioning
+open_dialog GET_LABEL_TYPE
+read_line label
+if [ "$label" = loop ]; then
+	exit 0

Attachment: signature.asc
Description: Digital signature

Reply to: