Bug 583658

Summary: livecd-iso-to-disk --format fails with existing LV on USB
Product: [Fedora] Fedora Reporter: Alan Pevec <apevec>
Component: livecd-toolsAssignee: Alan Pevec <apevec>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 13CC: apevec, cpelland, dhuff, Jasper.Hartline, katzj, ovirt-maint, vbian, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-13 18:52:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 582626    
Attachments:
Description Flags
livecd-iso-to-disk --format fails with existing LV on USB
none
change to Dave's patch
none
simplified patch apevec: review?

Description Alan Pevec 2010-04-19 10:48:03 UTC
The latest script from F13beta livecd, with one dummy PV/LV in /dev/sdb1 reported:
...
mkdosfs: unable to open /dev/sdb1
USB filesystem must be vfat or ext[23]
Cleaning up to exit...

With one small filesystem on sdb1 and PV on sdb2, fdisk failed:

Error: Error informing the kernel about modifications to partition /dev/sdb1 -- Device or resource busy.  This means Linux won't know about any changes you made to /dev/sdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Warning: The kernel was unable to re-read the partition table on /dev/sdb (Device or resource busy).  This means Linux won't know anything about the modifications you made until you reboot.  You should reboot your computer before doing anything with /dev/sdb.
Waiting for devices to settle...
mkdosfs 3.0.0 (28 Sep 2008)
/dev/sdb1: No such file or directory
USB filesystem must be vfat or ext[23]
Cleaning up to exit...

Comment 1 David Huff 2010-04-21 22:42:14 UTC
Created attachment 408189 [details]
livecd-iso-to-disk --format fails with existing LV on USB

Comment 2 Frederick Grose 2010-04-29 19:22:19 UTC
Created attachment 410206 [details]
change to Dave's patch

I found 2 code issues:

1. The new function checkLVMActive() will fail silently if the lvm2 package is
   not installed.

2. The path expansion in the call to pvs,

      pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]*

   will miss SD/MMC device partitions, which are labeled p1, p2, ... instead of
   1, 2, ...

So, I propose,

1. that we not redirect standard error to /dev/null

2. use a more general path expansion.

-+	for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do
++	for vg in $(pvs -o vg_name --noheadings $dev${dev_delim}* |sort -u); do

Comment 3 Fedora Admin XMLRPC Client 2010-05-07 15:41:31 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Alan Pevec 2010-05-07 16:26:11 UTC
Created attachment 412394 [details]
simplified patch

Comment 6 Jasper O'neal Hartline 2010-08-13 18:52:58 UTC
Closing, this is in git.
Thanks guys.