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

Frederick Grose fgrose at gmail.com
Fri May 7 17:05:31 UTC 2010


On Fri, May 7, 2010 at 1:04 PM, Frederick Grose <fgrose at gmail.com> wrote:

> On Fri, May 7, 2010 at 12:28 PM, <apevec at gmail.com> wrote:
>
>> From: Alan Pevec <apevec at redhat.com>
>>
>> Resolves: rhbz#583658
>>
>> Signed-off-by: Alan Pevec <apevec at redhat.com>
>> ---
>>  tools/livecd-iso-to-disk.sh |   13 +++++++++++++
>>  1 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
>> index 3a4726d..f4d0855 100755
>> --- a/tools/livecd-iso-to-disk.sh
>> +++ b/tools/livecd-iso-to-disk.sh
>> @@ -138,6 +138,18 @@ checkPartActive() {
>>     fi
>>  }
>>
>> +checkLVM() {
>> +    dev=$1
>> +
>> +    if [ -x /sbin/pvs -a \
>> +       "$(/sbin/pvs -o vg_name --noheadings $dev* 2>/dev/null)" ]; then
>> +       echo "Device, $dev, contains a volume group and cannot be
>> formated!"
>> +       echo "You can remove the volume group using vgremove."
>> +       exitclean
>> +    fi
>> +    return 0
>> +}
>> +
>>  createGPTLayout() {
>>     dev=$1
>>     getdisk $dev
>> @@ -407,6 +419,7 @@ fi
>>  # do some basic sanity checks.
>>  checkMounted $USBDEV
>>  if [ -n "$format" ];then
>> +  checkLVM $USBDEV
>>   # checks for a valid filesystem
>>   if [ -n "$efi" ];then
>>     createGPTLayout $USBDEV
>> --
>> 1.6.0.6
>
>
> Redirecting standard error leads to silent failure when the lvm2 tools are
> not installed.
>
> I've suggested leaving out that redirection so as to leave a hint for the
> user in that situation.
>
>            --Fred
>

Sorry, I see the additional test now.
         --Fred
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/livecd/attachments/20100507/027e056f/attachment.html 


More information about the livecd mailing list