Opened 14 years ago

Closed 14 years ago

#413 closed defect (fixed)

analyze-my-lvm leaves out the pvcreate's when mondarchive has the -E option

Reported by: Michael Shapiro Owned by: Bruno Cornec
Priority: normal Milestone: 2.2.9.3
Component: mindi Version: 2.2.9.2
Severity: major Keywords:
Cc:

Description

mindi-2.0.7.2-1.rhel5

mondo-2.2.9.2-1.rhel5

Ran mondoarchive as follows:

mondoarchive -N -O -9 -p mondo-mrou43 -n mrou10:/nwinstall -d mondo/mrou43 -s 650m -E "/dev/sdb /dev/sdc"

The lvm.res file does not have the pvcreate line(s) causing the restore to fail:

/usr/sbin/lvmdiskscan
/sbin/lvm
i=2
LVM version >= 2.0 found.
Just before you extrapolate mountlist to include RAID partitions,
extrapolate it to include the following LVM drives and partitions:-
>>>>> /dev/sda2 
To get started, type:-
(insmod dm-mod)
(insmod dm_mod)
# lvm vgchange -an
# lvm vgscan
 
Finally, create the LV's (logical volumes).
Not including LV lvol1 as VG vgtest was excluded
# lvm lvcreate -L 13219m -r auto -n LogVol00 VolGroup00
# lvm lvcreate -L 2017m -r auto -n LogVol01 VolGroup00
 
# lvm vgscan
Now you may format the LV's:-
(mkfs -t foo /dev/vgtest/lvol1 or something like that)
(mkfs -t foo /dev/VolGroup00/LogVol00 or something like that)
(mkfs -t foo /dev/VolGroup00/LogVol01 or something like that)
 
Finally, to shut down and delete the volumes, do this:-
(lvm lvremove -f /dev/vgtest/lvol1)
(lvm lvremove -f /dev/VolGroup00/LogVol00)
(lvm lvremove -f /dev/VolGroup00/LogVol01)
(lvm vgchange -a n vgtest)
(lvm vgchange -a n VolGroup00)
(lvm vgremove vgtest)
(lvm vgremove VolGroup00)
(rmmod dm-mod & rmmod dm_mod & )

If I remove the -E option, the lvm.res file is correct:

mondoarchive -N -O -9 -p mondo-mrou43 -n mrou10:/nwinstall -d mondo/mrou43 -s 650m

/usr/sbin/lvmdiskscan
/sbin/lvm
i=2
LVM version >= 2.0 found.
Just before you extrapolate mountlist to include RAID partitions,
extrapolate it to include the following LVM drives and partitions:-
>>>>> /dev/sdb1 /dev/sda2 
To get started, type:-
(insmod dm-mod)
(insmod dm_mod)
# lvm vgchange -an
# echo y | lvm pvcreate -ff /dev/sdb1
# echo y | lvm pvcreate -ff /dev/sda2
# lvm vgscan
 
Create and activate the VG's (volume groups).
# lvm vgcreate vgtest -l 0 -p 0 -s 4m /dev/sdb1
# lvm vgchange -a y vgtest
# lvm vgcreate VolGroup00 -l 0 -p 0 -s 32m /dev/sda2
# lvm vgchange -a y VolGroup00
 
Finally, create the LV's (logical volumes).
# lvm lvcreate -L 52m -r auto -n lvol1 vgtest
# lvm lvcreate -L 13219m -r auto -n LogVol00 VolGroup00
# lvm lvcreate -L 2017m -r auto -n LogVol01 VolGroup00
 
# lvm vgscan
Now you may format the LV's:-
(mkfs -t foo /dev/vgtest/lvol1 or something like that)
(mkfs -t foo /dev/VolGroup00/LogVol00 or something like that)
(mkfs -t foo /dev/VolGroup00/LogVol01 or something like that)
 
Finally, to shut down and delete the volumes, do this:-
(lvm lvremove -f /dev/vgtest/lvol1)
(lvm lvremove -f /dev/VolGroup00/LogVol00)
(lvm lvremove -f /dev/VolGroup00/LogVol01)
(lvm vgchange -a n vgtest)
(lvm vgchange -a n VolGroup00)
(lvm vgremove vgtest)
(lvm vgremove VolGroup00)
(rmmod dm-mod & rmmod dm_mod & )

I was able to fix the problem by adding a line to the ListAllPhysicalVolumes function (see comment ##### ADDED THIS LINE #####):

        for d in `cat $MINDI_TMP/pv.tmp`; do
                # Skip devices excluded, coming from mondoarchive
                skip=0
                ##### ADDED THIS LINE #####
                l=""
                ##### END ADDED THIS LINE #####
                l="$l `mindi --readalllink $d`"
                l="$l `GiveMapperOfdm $d`"
                list_of_devices="`echo $l | sort -u`"
                if [ "$MINDI_EXCLUDE_DEVS" ] ; then
                        for ed in $MINDI_EXCLUDE_DEVS ; do 
                                if  [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then 
                                        skip=1   
                                        continue 
                                fi       
                        done     
                fi
                if [ $skip -eq 1 ]; then  
                        continue 
                fi       
                echo $d >> $MINDI_TMP/pv.tmp2
        done

Attachments (1)

analyze-my-lvm.with_mod (10.7 KB ) - added by Michael Shapiro 14 years ago.
analyze-my-lvm with line added to fix problem

Download all attachments as: .zip

Change History (3)

by Michael Shapiro, 14 years ago

Attachment: analyze-my-lvm.with_mod added

analyze-my-lvm with line added to fix problem

comment:1 by Bruno Cornec, 14 years ago

Status: newassigned

Thanks for your patch Michael. Fixed in rev [2616]. Will be in 2.2.9.3 final.

I'm rebuilding packages for you to test under ftp://ftp.mondorescue.org/test/rhel/5/ (tag 20100407121858)

comment:2 by Bruno Cornec, 14 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.