On Thu, Apr 22, 2010 at 7:03 PM, David Huff <[email protected]> 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!"
...
--
livecd mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/livecd