Package: mindi Version: 1.04-4 Severity: normal
lvdisplay and vgdisplay report decimal sizes that lvcreate and vgcreate can't understand. with '-c' option, I was able to restore my lvm volumes. the enclosed patch needs also a patch to mondo : i'll follow up the bts number as soon as I get it. cheers, guillaume pernot -- System Information: Debian Release: 3.1 Architecture: i386 (i686) Kernel: Linux 2.4.28-686 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages mindi depends on: ii bzip2 1.0.2-7 high-quality block-sorting file co ii file 4.12-1 Determines file type using "magic" ii gawk 1:3.1.4-2 GNU awk, a pattern scanning and pr ii mindi-busybox 1.00-4 Collection of shell utilities in a ii mindi-kernel 2.4.27-2 failsafe Linux kernel for Mindi/Mo ii mindi-partimagehack 0.6.2-4 disk partition imaging utility for ii mkisofs 4:2.01+01a01-2 Creates ISO-9660 CD-ROM filesystem ii ms-sys 1.1.3-1 Write a Microsoft compatible boot ii nano 1.2.4-5 free Pico clone with some new feat ii parted 1.6.21-1 The GNU Parted disk partition resi ii syslinux 2.11-0.1 Bootloader for Linux/i386 using MS -- no debconf information
diff -ruN mindi-1.04-old/analyze-my-lvm mindi-1.04/analyze-my-lvm --- mindi-1.04-old/analyze-my-lvm 2004-07-23 21:43:43.000000000 +0200 +++ mindi-1.04/analyze-my-lvm 2005-08-31 13:43:08.000000000 +0200 @@ -86,26 +86,27 @@ device=$1 output="" if [ $lvmversion = 2 ]; then - lvm lvdisplay $device > $fname + allocation=`lvm lvdisplay -c $device | cut -d: -f 8` + [ "$allocation" ] && output="$output -l $allocation" else lvdisplay $device > $fname + stripes=`GetValueFromField $fname "Stripes"` + stripesize=`GetValueFromField $fname "Stripe size (MByte)"`m + [ "$stripesize" = "m" ] && stripesize=`GetValueFromField $fname "Stripe size (KByte)"`k + [ "$stripesize" = "k" ] && stripesize="" + allocation=`GetValueFromField $fname "LV Size"` + [ ! "`echo "$allocation" | grep "[k,m,g]"`" ] && allocation="$allocation"m + if echo "$allocation" | grep -x ".*g" > /dev/null 2> /dev/null ; then + val=`echo "$allocation" | sed s/g//` + allocation=`echo "$val" | awk '{c=$1; printf "%d", c*1024;}'`m + fi + readahead=`GetValueFromField $fname "Read ahead sectors"` + rm -f $fname + [ "$stripes" ] && output="$output -i $stripes" + [ "$stripesize" ] && output="$output -I $stripesize" + [ "$allocation" ] && output="$output -L $allocation" + [ "$readahead" ] && output="$output -r $readahead" fi - stripes=`GetValueFromField $fname "Stripes"` - stripesize=`GetValueFromField $fname "Stripe size (MByte)"`m - [ "$stripesize" = "m" ] && stripesize=`GetValueFromField $fname "Stripe size (KByte)"`k - [ "$stripesize" = "k" ] && stripesize="" - allocation=`GetValueFromField $fname "LV Size"` - [ ! "`echo "$allocation" | grep "[k,m,g]"`" ] && allocation="$allocation"m - if echo "$allocation" | grep -x ".*g" > /dev/null 2> /dev/null ; then - val=`echo "$allocation" | sed s/g//` - allocation=`echo "$val" | awk '{c=$1; printf "%d", c*1024;}'`m - fi - readahead=`GetValueFromField $fname "Read ahead sectors"` - rm -f $fname - [ "$stripes" ] && output="$output -i $stripes" - [ "$stripesize" ] && output="$output -I $stripesize" - [ "$allocation" ] && output="$output -L $allocation" - [ "$readahead" ] && output="$output -r $readahead" echo "$output" } @@ -116,15 +117,17 @@ current_VG=$1 VG_info_file=/tmp/$$.vg-info.txt if [ $lvmversion = 2 ]; then - lvm vgdisplay $current_VG > $VG_info_file + physical_extent_size=`vgdisplay -c $current_VG |cut -d: -f 13`k + max_logical_volumes=`vgdisplay -c $current_VG |cut -d: -f 6` + max_physical_volumes=`vgdisplay -c $current_VG |cut -d: -f 10` else vgdisplay $current_VG > $VG_info_file + max_logical_volumes=`GetValueFromField "$VG_info_file" "MAX LV"` + [ $max_logical_volumes -ge 256 ] && max_logical_volumes=255 + max_physical_volumes=`GetValueFromField "$VG_info_file" "MAX PV"` + [ $max_physical_volumes -ge 256 ] && max_physical_volumes=255 + physical_extent_size=`GetValueFromField "$VG_info_file" "PE Size"` fi - max_logical_volumes=`GetValueFromField "$VG_info_file" "MAX LV"` - [ $max_logical_volumes -ge 256 ] && max_logical_volumes=255 - max_physical_volumes=`GetValueFromField "$VG_info_file" "MAX PV"` - [ $max_physical_volumes -ge 256 ] && max_physical_volumes=255 - physical_extent_size=`GetValueFromField "$VG_info_file" "PE Size"` output="" [ "$max_logical_volumes" ] && output="$output -l $max_logical_volumes" [ "$max_physical_volumes" ] && output="$output -p $max_physical_volumes"