On Monday 21 August 2006 20:55, Ronny Aasen wrote:
> I have written a patch that i hope could help on this issue.
> it can probably be santized, or rewritten in a better way, but it works
> for me as it looks now.

Thanks Ronny.

> what it does is basicaly.
> it checks that it's beeing run preseeded, if not it does nothing.

We really want to do the same when running interactive, but with a message 
to the user what is being deleted. If you feel up to trying that too, 
feel free. If not, someone else probably will when applying this.

Basically this means adding a boolean template with the question to 
confirm and a couple of variables to show the VGs and LVs to be removed 
(examples of similar templates and how to use them available in 
partman-lvm).
We would probably want to have the user preseed this template to "true" if 
he wants to delete without confirmation, so the test if LVM was preseeded 
would no longer be needed.

Again, you don't have to be the person to add this, but that is basically 
what we need for the final solution (at least as I see it).

> if the lvm check finds lvm volumes on the disk, it will check that
> these volume groups are not spanning multiple disks, if they do it will
> fail with the same error as before.

The current error should then probably be rewritten slightly to better 
describe the actual error situation.

> if it finds that the vg is isolated to the disk, preseeded to be
> erased, it removes all Logicalvolumes, and VolumeGroups on that disk.

The basic algorithm looks OK, but you should probably try to use the 
general functions already available in lvm_tools.sh (part of the 
partman-lvm package) instead of the direct calls to pvs and vgs.

Cheers,
FJP

Attachment: pgpC8TFmYGJQZ.pgp
Description: PGP signature

Reply via email to