[PATCH 1/4] Try to deactivate lvm on corrupted gpt disks.

Anne Mulhern amulhern at redhat.com
Tue Jan 20 18:37:45 UTC 2015





----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, January 9, 2015 4:32:30 PM
> Subject: [PATCH 1/4] Try to deactivate lvm on corrupted gpt disks.
> 
> Since pyparted won't let us use the corrupt gpt disklabel we can't
> treat the disk as partitioned, which prevents us from correctly detecting
> the lvm on top of it. By deactivating the lvm when this situation arises,
> we at least make it possible to clear the disk and do a fresh installation
> on it.
> 
> Related: rhbz#1144410
> ---
>  blivet/devicetree.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> index 5bf0a45..41cc42e 100644
> --- a/blivet/devicetree.py
> +++ b/blivet/devicetree.py
> @@ -692,7 +692,13 @@ class DeviceTree(object):
>          vg_name = udev.device_get_lv_vg_name(info)
>          device = self.getDeviceByName(vg_name)
>          if not device:
> +            # this means something is messed up, like a corrupt gpt
> disklabel
> +            # that the kernel is perfectly happy with but parted refuses to
> use
>              log.error("failed to find vg '%s' after scanning pvs", vg_name)
> +            try:
> +                lvm.vgdeactivate(vg_name)
> +            except LVMError as e:
> +                log.error("failed to deactivate vg: %s", e)
>  
>          # Don't return the device like we do in the other addUdevFooDevice
>          # methods. The device we have here is a vg, not an lv.
> --
> 1.9.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

I don't see any problem with the code.

My only worry is about coherence of the device tree, and I don't think that this
could be affected adversely by this change.

- mulhern


More information about the anaconda-patches mailing list