Bug 583658 - livecd-iso-to-disk --format fails with existing LV on USB
Summary: livecd-iso-to-disk --format fails with existing LV on USB
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: 13
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Alan Pevec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 582626
TreeView+ depends on / blocked
 
Reported: 2010-04-19 10:48 UTC by Alan Pevec
Modified: 2016-04-26 15:17 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-13 18:52:58 UTC


Attachments (Terms of Use)
livecd-iso-to-disk --format fails with existing LV on USB (1.33 KB, patch)
2010-04-21 22:42 UTC, David Huff
no flags Details | Diff
change to Dave's patch (534 bytes, patch)
2010-04-29 19:22 UTC, Frederick Grose
no flags Details | Diff
simplified patch (1.17 KB, patch)
2010-05-07 16:26 UTC, Alan Pevec
apevec: review?
Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.