[Fedora-livecd-list] [PATCH] livecd-iso-to-disk --format fails with existing LV on USB
Alan Pevec
apevec at gmail.com
Fri May 7 15:53:20 UTC 2010
On Thu, Apr 22, 2010 at 7:03 PM, David Huff <dhuff at redhat.com> wrote:
> + 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
That check breaks with no or more than 1 LV but anyway, we should bail
out even on non active VG, it's not nice to reformat the disk under
LVM feet, so just first check is enough:
if [ "$(pvs -o vg_name --noheadings $dev $dev[0-9]* 2>/dev/null)" ]; then
echo "Device, $dev, contains a volume group and cannot be formated!"
...
More information about the livecd
mailing list