﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
414	If you exclude an LVM disk in mondoarchive it still shows up in mountlist.txt	Michael Shapiro	Bruno Cornec	"mindi-2.0.7.3-0.20100407121858.rhel5

In this example, /dev/sdb is a PV in the VG vgtest:


{{{
# pvs
  PV         VG         Fmt  Attr PSize  PFree 
  /dev/sda2  VolGroup00 lvm2 a-   14.88G     0 
  /dev/sdb1  vgtest     lvm2 a-   96.00M 44.00M
}}}

I ran mondoarchive:

 mondoarchive -N -O -9 -p mondo-mrou43 -n mrou10:/nwinstall -d mondo/mrou43  -s 650m -E ""/dev/sdb""

The mountlist.txt file still contains an entry for vgtest:


{{{
/dev/sda2 lvm lvm 15623212 
/dev/VolGroup00/LogVol00 / ext3 lvm 
/dev/sda1 /boot ext3 104391 /boot
/dev/VolGroup00/LogVol01 swap swap lvm 
/dev/vgtest/lvol1 /lvmmnt ext3 lvm 
/dev/sdc1 /wholemnt ext3 122864
}}}
 
The problem is that, if you exclude a PV from a VG, mindi doesn't add that PV to the list_of_devices in !MakeMountlist(). I was able to fix the problem in mindi by adding the function GetPVsForLV() and adding its result to the list_of_devices in !MakeMountlist(). Basically, it looks at the current_partition and, if it's a VG, adds all of the VG's PV's to the list_of_devices. 


{{{
# Get PV's for an LV
GetPVsForLV() {
  if [ -n ""$1"" ]; then
    lvol=""$1""
    vg=`lvdisplay $lvol 2>/dev/null |awk '/VG Name/{print $NF;exit}'`
    if [ -z ""$vg"" ]; then
      return
    fi
    vgdisplay -v $vg 2>/dev/null | awk '/PV Name/{print$NF}'
  fi
}
}}}

In the !MakeMountlist() function:


{{{
if [ ""$MINDI_EXCLUDE_DEVS"" ] ; then
	l=""""
	list_of_devices=""`ReadAllLink $current_partition`""
	for d in $list_of_devices; do
		l=""$l `GiveMapperOfdm $d`""
	done
	list_of_devices=""`echo $l | sort -u`""

        ##### ADDED THESE TWO LINES #####
	PVVG=`GetPVsForLV $current_partition`
        list_of_devices=""$list_of_devices $PVVG""

	for d in $MINDI_EXCLUDE_DEVS ; do
		if  [ ""`echo "" $list_of_devices "" | grep "" $d""`"" != """" ]; then
   			echo ""Excluding $current_partition from mountlist (due to excluded device $d)"" >> $LOGFILE
			skip=1
			continue
		fi
	done
fi
}}}


 
With the modifications, running mondoarchive produces a correct mountlist.txt (i.e. with no VG vgtest in it):


{{{
/dev/sda2 lvm lvm 15623212 
/dev/VolGroup00/LogVol00 / ext3 lvm 
/dev/sda1 /boot ext3 104391 /boot
/dev/VolGroup00/LogVol01 swap swap lvm 
/dev/sdc1 /wholemnt ext3 122864 
}}}
 
The attached mindi has been modified with the fixes described above. Look for the lines:[[BR]][[BR]]

 '''#### START ADD BY MIKE SHAPIRO ####'''[[BR]]
[[BR]]
 and[[BR]][[BR]]

 '''#### END ADD BY MIKE SHAPIRO ####'''"	defect	closed	normal	2.2.9.3	mindi	2.2.9.2	major	fixed		
