[Fedora-livecd-list] [PATCH] livecd-iso-to-disk --format fails with existing LV on USB

Sebastian Dziallas sdz at fedoraproject.org
Thu Apr 22 21:00:48 UTC 2010


I'm going to make some noise here as this is already the second patch
that has hit the list which needs a reaction - I don't have commit
access to that repo, but Frederick [1] [2] had also posted another one
earlier. I'm CC'ing a couple of folks that *do* have commit access
according to FAS. It'd be awesome if we could find a solution how to
proceed with the livecd-tools in general, as it seems pretty dead
right now.

--Sebastian

[1] http://lists.fedoraproject.org/pipermail/livecd/2010-April/005764.html
[2] http://lists.fedoraproject.org/pipermail/livecd/2010-March/005762.html

On Thu, Apr 22, 2010 at 7:03 PM, David Huff <dhuff at redhat.com> wrote:
> Resolves rhbz#583658
> ---
>  tools/livecd-iso-to-disk.sh |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
> index 3a4726d..0cfcfb8 100755
> --- a/tools/livecd-iso-to-disk.sh
> +++ b/tools/livecd-iso-to-disk.sh
> @@ -138,6 +138,21 @@ checkPartActive() {
>     fi
>  }
>
> +checkLVMActive() {
> +    dev=$1
> +
> +   # check for an active lv which will cause format to fail
> +   for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do
> +       if [ $(lvs -o lv_attr --noheadings $vg |awk {'print $1;'} |cut -c 5) = "a" ]; then
> +       echo "Device, $dev, contains a volume group with an active volume and cannot be formated!"
> +       echo "You can remove the volume group with "
> +       echo "    # /sbin/vgremove -f $vg"
> +       exitclean
> +       fi
> +    done
> +    return 0
> +}
> +
>  createGPTLayout() {
>     dev=$1
>     getdisk $dev
> @@ -407,6 +422,7 @@ fi
>  # do some basic sanity checks.
>  checkMounted $USBDEV
>  if [ -n "$format" ];then
> +  checkLVMActive $USBDEV
>   # checks for a valid filesystem
>   if [ -n "$efi" ];then
>     createGPTLayout $USBDEV
> --
> 1.6.6.1
>
> --
> livecd mailing list
> livecd at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/livecd


More information about the livecd mailing list