Hello Caution: I'm retracting any patches I posted to this list. I misunderstood some stuff and introduced my own bugs. I posted an updated version for setup-storage to the fai-devel list and asked on guidance on how to proceed / integrate these changes into fai. Full post: https://lists.uni-koeln.de/pipermail/linux-fai-devel/2012q3/001110.html
The following stuff is now working in setup-storage 1.4: (It's definitely broken in fai experimental / 4.0.3+0~1346412696.57~1.gbp4b7b93 but I don't know since when. Some of these problems only occured if there was a volume group present.) preparation phase: - removal and wiping of existing LVM volumes (vg was deactivated before lv was wiped and removed) - removal and wiping of existing LVM volumes on MD (md was shut down and restarted, but not LVM -> setup-storage attempted to remove logical volumes which were not present) - wipefs for logical volumes failed due to missing '/dev/' execution phase: - LVM (complete reinstall & preserve logical volume) - LVM on MD (complete reinstall & preserve logical volume) - LVM on LUKS on MD (complete reinstall) I also added some debug info: - show a list of states which are required but not provided - show a list of states which are provided but unused - show list of all commands with the states they require and provide and provide a small stack trace to the code where they have been created (function names and line numbers) A 'state' is something like 'vgchange_a_n_VG_testvg'. Executing 'vgchange -a n testvg' provides this state and 'vgremove [...]' requires the presence of this state before it can be run. All test cases were run against - factory clean disks (no partition table) - empty partition table (msdos) - reinstall (simulate a previous installation with this disk layout) There's one case from Brian's disk configuration which is still broken, but judging from http://fai-project.org/doc/man/setup-storage.html it's currently not possible to preserve an encrypted volume. Well it ~may~ be possible if one is able to feed the original encryption key to setup-storage and implement the required logic. [Personally I don't think that's a good idea.] Future plans: The wrapper script I wrote and posted was a real big help, but I now find it a bit lacking. I'm currently pondering on turning this bash beast into a nice perl program with the goal of being easily extendable with anybody's personal disk config. If nothing else it should provide a nice training to hone my programming and design skills. =) bye thomas