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

Bug#396023: LVM removal will not work properly with the applied patch



Hi guys,

I had a long conversation with Frans on IRC about this bug and the applied patch.

I am seeing different issues such as:

1) take a fresh disk with no lvm
2) install using automatic lvm setup and it will work
3) install on it again this time not using lvm and it will work
4) install again this time using lvm and it will fail

The problem is that at #4 the disk has no partitions type LVM but the lvm
metadata from #2 are still there.

pvscan still works but all other lvm operations will correctly report that there
is an error.

Basically #3 did not wipe the disk properly.

I did dig into it and found out that partman-auto wipe_disk depends on
dmsetup-udeb, but this depends is not declared.

Usage of dmsetup requires you to make sure that either dm-mod module is loaded
or built-in the kernel. this check is not done and dmsetup invokations will fail.

In order to trigger the code to run dm_wipe_lvm the lv/vg needs to be enabled or
dmsetup deps will simply not find them.

dm_wipe_lvm uses a set of shared functions calls to lvm but i don't think a
dependency has been expressed to guarantee that they are available.


I have different ideas on how to approach the problem but in one way or another
they might hit other kinds of installations (Colin Watson mentioned low-mem as
one of them).

My suggestion is:
- Make partman-auto depends on the proper bits that it is actually using.
- Add code to modprobe/verify that dm-mod is available.
- Fix dm_wipe_lvm to not require dmsetup to detect the volumes and use lvm2
  tools instead (I am not happy to execute vgchanges if we can avoid it).

Any other suggestion is welcome.

Fabio

PS CC me on reply.

-- 
I'm going to make him an offer he can't refuse.



Reply to: