Changeset 2072 in MondoRescue
- Timestamp:
- Dec 5, 2008, 3:32:59 PM (16 years ago)
- Location:
- branches/2.2.8
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.8/mindi/analyze-my-lvm
r2044 r2072 117 117 done 118 118 fi 119 l="" 120 if [ -f /etc/multipath.conf ]; then 121 # If multipath check which type of devidec are given, mpath prefered 122 for d in $list_of_devices; do 123 l="$l `GiveMapperOfdm $d`" 124 done 125 list_of_devices=$l 126 fi 127 119 128 echo "# $LVMCMD vgcreate $current_VG$VG_params $list_of_devices" 120 129 echo "# $LVMCMD vgchange -a y $current_VG" … … 125 134 ListAllPhysicalVolumes() { 126 135 if [ $lvmversion = 2 ]; then 127 $LVMCMD pvscan 2> /dev/null | grep 'PV' | awk '{print $2}' 128 else 129 pvscan 2> /dev/null | grep '"' | cut -d'"' -f2 130 fi 136 $LVMCMD pvscan 2> /dev/null | grep 'PV' | awk '{print $2}' > $MINDI_TMP/pv.tmp 137 else 138 pvscan 2> /dev/null | grep '"' | cut -d'"' -f2 > $MINDI_TMP/pv.tmp 139 fi 140 if [ -f /etc/multipath.conf ]; then 141 # If multipath check which type of devidec are given, mpath prefered 142 for d in `cat $MINDI_TMP/pv.tmp`; do 143 GiveMapperOfdm $d 144 done 145 else 146 cat $MINDI_TMP/pv.tmp 147 fi 148 rm -f $MINDI_TMP/pv.tmp 131 149 } 132 150 … … 136 154 } 137 155 156 GiveMapperOfdm () { 157 158 major=`stat -c "%t" $1` 159 minor=`stat -c "%T" $1` 160 161 for i in `ls /dev/mapper/*`; do 162 mj=`stat -c "%t" $i` 163 mn=`stat -c "%T" $i` 164 if [ "$mj" = "$major" ] && [ "$mn" = "$minor" ]; then 165 echo "$i" 166 return 167 fi 168 done 169 echo $1 170 } 171 138 172 139 173 ListLvmDrivesAndPartitions() { 140 $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}' 174 $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}' > $MINDI_TMP/vg.tmp 175 if [ -f /etc/multipath.conf ]; then 176 # If multipath check which type of devidec are given, mpath prefered 177 for d in `cat $MINDI_TMP/vg.tmp`; do 178 GiveMapperOfdm $d 179 done 180 else 181 cat $MINDI_TMP/vg.tmp 182 fi 183 rm -f $MINDI_TMP/vg.tmp 141 184 } 142 185 -
branches/2.2.8/mindi/deplist.txt
r2031 r2072 28 28 /usr/sbin/mondorestore 29 29 /etc/mdadm/mdadm.conf /etc/mdadm.conf 30 /sbin/multipath /sbin/dmsetup /sbin/kpartx /sbin/dmraid /sbin/scsi_id /sbin/mpath_prio_alua /sbin/mpath_wait /sbin/mpath_ctl /sbin/mpath_prio_emc /sbin/mpath_prio_hds_modular /sbin/mpath_prio_netapp /sbin/mpath_prio_ontap /sbin/mpath_prio_rdac /sbin/mpath_prio_tpc 30 31 /sbin/ldconfig 31 32 afio star ntfsclone parted partprobe ms-sys file getfattr setfattr getfacl setfacl -
branches/2.2.8/mindi/mindi
r2070 r2072 57 57 CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_base nls_cp437 nls_utf8 sg sr_mod zlib_inflate iso9660" 58 58 # Those modules will only go on the backup media, not the boot media. 59 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid5 raid456 lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm _multipath dm-round-robin dm_round_robin jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache"59 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid5 raid456 lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache" 60 60 # Replace with that line for HP OCMP e.g. 61 61 #DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu" … … 1154 1154 echo "WARNING: Multiple Logical Volumes found. Report to dev team" >> $LOGFILE 1155 1155 fi 1156 # if it's not found, it may well be a real device such as a multipath one 1157 # /dev/mapper/mpath... Thus we revert the situation so that next test succeed 1158 if [ _"$current_lvolume" = _"" ]; then 1159 current_lvolume="$current_partition" 1160 fi 1156 1161 fi 1157 1162 # … … 2196 2201 tar cf - /etc/udev 2> /dev/null | tar xf - 2197 2202 # This avoids NIC remapping if on another machine at restore time on Debian at least 2198 rm -f ./etc/udev/rules.d/z 25_persistent-net.rules2203 rm -f ./etc/udev/rules.d/z??_persistent-net.rules 2199 2204 tar cf - /lib*/udev 2> /dev/null | tar xf - 2200 2205 if [ -x /sbin/udevd ]; then -
branches/2.2.8/mindi/rootfs/sbin/init
r2015 r2072 406 406 } 407 407 408 409 StartMpath() { 410 if [ "`grep -i nompath /proc/cmdline`" ]; then 411 return; 412 fi 413 echo "Starting Mpath..." 414 if [ -x /sbin/multipath ]; then 415 mkdir -p /var/lib/multipath 416 cat > /etc/multipath.conf << EOF 417 defaults { 418 user_friendly_names yes 419 } 420 EOF 421 /sbin/multipath -v 0 422 if [ -x /sbin/kpartx ]; then 423 /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p" 424 fi 425 fi 426 } 408 427 409 428 StartRaids() { … … 440 459 fi 441 460 fi 461 done 462 elif 463 if [ "`grep -i nodmraid /proc/cmdline`" ]; then 464 return; 465 fi 466 for x in $(/sbin/dmraid -ay -i -p -t 2>/dev/null | grep -E -iv "^no " |awk -F ':' '{ print $1 }') ; do 467 echo "Please send the result of /sbin/dmraid -ay -i -p -t to the devteam !!!" 468 return 469 #dmname=$(resolve_dm_name $x) 470 #[ -z "$dmname" ] && continue 471 #/sbin/dmraid -ay -i -p "$dmname" >/dev/null 2>&1 472 #/sbin/kpartx -a -p p "/dev/mapper/$dmname" 442 473 done 443 474 else … … 672 703 PauseForRaids 673 704 StartRaids 705 StartMpath 674 706 StartLvms 675 707 CopyBootDevEntry -
branches/2.2.8/mondo/src/mondorestore/mondorestore.c
r2061 r2072 366 366 asprintf(&tmp1,"%s/etc/blkid.tab.old",bkpinfo->restore_path); 367 367 (void)unlink(tmp1); 368 paranoid_free(tmp1); 369 } 370 371 372 static void clean_multiconf() { 373 374 char *tmp1 = NULL; 375 376 /* Clean up multiconf cache file if they exist */ 377 asprintf(&tmp1,"%s/var/lib/multipath/bindings",bkpinfo->restore_path); 378 (void)unlink(tmp1); 379 paranoid_free(tmp1); 380 381 /* Edit multipath.conf if needed to adapt wwid */ 382 asprintf(&tmp1,"%s/etc/multipath.conf", MNT_RESTORING); 383 if (does_file_exist(tmp1)) { 384 log_msg(2, "We may need to clean /etc/multipath.conf"); 385 } else { 386 paranoid_free(tmp1); 387 return(); 388 } 389 paranoid_free(tmp1); 390 asprintf(&tmp1,"chroot %s %s /etc/multipath.conf", MNT_RESTORING, editor); 391 paranoid_system(tmp1); 368 392 paranoid_free(tmp1); 369 393 } … … 612 636 613 637 clean_blkid(); 638 clean_multiconf(); 614 639 protect_against_braindead_sysadmins(); 615 640 retval += unmount_all_devices(mountlist); … … 845 870 } 846 871 clean_blkid(); 872 clean_multiconf(); 847 873 protect_against_braindead_sysadmins(); 848 874 retval += unmount_all_devices(mountlist);
Note:
See TracChangeset
for help on using the changeset viewer.