diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-16 18:13:55 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-16 18:13:55 +0100 |
commit | e565cae3d698f13ba4b9e181770f9a51a5c4a709 (patch) | |
tree | 99e25408e14765e19e10ec3468aab720a23c0935 | |
parent | 02f944b99e015a81bb6dc244507396419e94b3a1 (diff) |
fix for rollback doesnt work for dm_crypt devices
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/core/libs/lib-blockdevices-filesystems.sh | 5 |
2 files changed, 2 insertions, 4 deletions
@@ -12,7 +12,6 @@ ALPHA PHASE: get some people to test and suggest ideas, while fixing bugs and re * find a way to make _cli_ask_checklist still userfriendly for long lists.. maybe we should just propose/ask to use dia if the list is too long * lib things sometimes call die_error but we go back to the menu.. or something.. i think * automatically configure grub for dm_crypt and lvm -* cannot destruct luks devices (cryptsetup isLuks exits 234 instead of 0 for the device) -> breaks rollback when you have a luks FS * removing an LV from a VG with more then 1 LV makes another LV be listed twice * when removing dm_mapper devices, their "results" are not cleaned up (eg remove a LV filesystem on a VG and the LV block device remains) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 99fac02..37bfaee 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -508,7 +508,7 @@ rollback_filesystems () real_part=${part/+/} if [ "$part_type" = dm_crypt ] # Can be in use for: lvm-pv or raw. we don't need to care about raw (it will be unmounted so it can be destroyed) then - if [ -b $real_part ] && cryptsetup isLuks $real_part &>/dev/null #TODO: if you have lukscreated and luksopened something, isLuks still returns exitcode 234 :@ WTF + if [ -b $real_part ] && cryptsetup status $real_part &>/dev/null # don't use 'isLuks' it only works for the "underlying" device (eg in /dev/sda1 -> luksOpen -> /dev/mapper/foo, isLuks works only on the former. status works on the latter too) then if pvdisplay $real_part >/dev/null then @@ -569,10 +569,9 @@ rollback_filesystems () if lvdisplay $part >/dev/null && ! vgdisplay $part 2>/dev/null | grep -q 'VG Name' # it exists: lvdisplay works, and it's not a volume group (you can do lvdisplay $volumegroup) then have_crypt=0 - for i in `awk '$2 ~ /dm_crypt/ {print $1}' $TMP_BLOCKDEVICES`; do cryptsetup isLuks $i >/dev/null && have_crypt=1; done + for i in `awk '$2 ~ /dm_crypt/ {print $1}' $TMP_BLOCKDEVICES`; do cryptsetup status $i >/dev/null && have_crypt=1; done # TODO: Find a way to determine if a volume is used for a dm_crypt device. # this is a workaround that checks if any of the specified dm_crypts is still active. These devices may not be using this lvm LV, but we don't do much harm in skipping anyway. The dm_crypts should be cleared otherwise there's a problem anyway. - # TODO: beware though. isLuks can exit(234) even though the volume isLuks .. :s if [ $have_crypt -gt 0 ] then debug "$part ->Cannot do right now..." |