Changeset 1977 in MondoRescue
- Timestamp:
- Jun 2, 2008, 10:49:01 AM (17 years ago)
- Location:
- branches/stable
- Files:
-
- 9 deleted
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-kernel/mindi-kernel.spec
r349 r1977 2 2 # $Id$ 3 3 # 4 %define mrel 15 4 6 5 Summary: A program that creates emergency boot disks/CDs using your kernel, tools and modules. 7 6 Name: mindi-kernel 8 Version: 1.069 Release: %mrel7 Version: 2.6 8 Release: 1 10 9 License: GPL 11 10 Group: System/Kernel and hardware -
branches/stable/mindi/README.pxe
r1939 r1977 21 21 server is the ip addr of the NFS server 22 22 mountpoint is the mount point on the NFS server to use (should be in /etc/exports of the NFS server) 23 rmadisk_size may have to be increase to 131072 on more recent distributions such as rhel 5 23 24 The [] mean this parameter is optional 24 25 The () mean that you have a choice with the '|' meaning 'or' … … 40 41 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DHCP request is made to get those information. In the 2 cases, you have to mention on which physical interface those parameters should apply. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want. If you have a different NFS server for the deployment than for the archiving, you can also precise it through the nfsmount option. The structure on both server under the mountpoint has to be the same. 41 42 43 CAVEAT: the limit to the number of char on the append line is 255. Use symlinks to reduce the size of your path if needed. 44 42 45 Please report any problem around that tool to bruno@mondorescue.org 43 46 -
branches/stable/mindi/analyze-my-lvm
r1489 r1977 13 13 GetValueFromField() { 14 14 local res 15 sed s/' '/~/ "$1" | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%dm",$1;} else if ($2=="KB") {printf "%dk",$1;} else if ($2=="GB") {printf "% dg",$1;} else {print $0;};}'15 sed s/' '/~/ "$1" | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%dm",$1;} else if ($2=="KB") {printf "%dk",$1;} else if ($2=="GB") {printf "%fg",$1;} else {print $0;};}' 16 16 } 17 17 -
branches/stable/mindi/distributions/conf/mindi.conf.dist
r1939 r1977 92 92 # Modules supported by mindi and required at boot time 93 93 # 94 mindi_scsi_mods="3w-xxxx 3w_xxxx 3w-9xxx 3w_9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid megaraid_mm megaraid_mbox megaraid_sas mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod scsi_transport_sas scsi_transport_spi sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs "94 mindi_scsi_mods="3w-xxxx 3w_xxxx 3w-9xxx 3w_9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid megaraid_mm megaraid_mbox megaraid_sas mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod scsi_transport_sas scsi_transport_spi sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule" 95 95 mindi_ide_mods="ide ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide-cs ide-core ide_core edd paride ata_generic ata_piix libata via82cxxx generic nvidia ahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks" 96 96 # Replace with that line for HP OCMP e.g. -
branches/stable/mindi/mindi
r1939 r1977 1385 1385 rm -Rf $MINDI_TMP/iso 1386 1386 mkdir -p $MINDI_TMP/iso/{images,archives,isolinux} 1387 cp -f $1/*. img $1/*.gz $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "OfferToMakeBootableISO: Cannot copy $ito $MINDI_TMP/iso/images"1387 cp -f $1/*.gz $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "OfferToMakeBootableISO: Cannot copy $1/*.gz to $MINDI_TMP/iso/images" 1388 1388 old_pwd=`pwd` 1389 1389 cd $MINDI_TMP/iso … … 1427 1427 else 1428 1428 $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log 1429 rm -f images/mindi-bootroot.$BOOT_SIZE.img 1429 1430 fi 1430 1431 if [ "$?" -ne "0" ] ; then … … 1630 1631 else 1631 1632 options="interactive expert compare iso nuke isonuke" 1632 # hda hdb hdc hdd"1633 1633 fi 1634 1634 else … … 2100 2100 rm -f $orig_file 2101 2101 return 0 2102 }2103 2104 2105 ScanCDandTape() {2106 local i2107 2108 for i in /dev/st0 /dev/ht0 /dev/cdrom /dev/cdrom0 /dev/cdrom 1 ; do2109 dd if=$i of=/dev/null bs=64k count=1 &> /dev/null2110 done2111 2102 } 2112 2103 … … 2880 2871 fi 2881 2872 fi 2882 #ScanCDandTape2883 2873 [ "$CDRECOVERY" = "yes" ] || CDRECOVERY=no 2884 2874 if [ "$CDRECOVERY" = "yes" ] ; then … … 2956 2946 fi 2957 2947 if [ _"$MONDO_SHARE" = _"" ] && [ "$INTERACTIVE" = "yes" ] && [ "$ARCH" != "ia64" ] ; then 2958 echo -en "Would you like to use LILO (instead of syslinux)\nfor your boot image (y/[n]) ?" 2959 read ch 2960 if [ "$ch" != "y" ] && [ "$ch" != "Y" ] ; then 2961 USE_LILO=no 2962 else 2963 USE_LILO=yes 2964 fi 2948 USE_LILO=no 2965 2949 fi 2966 2950 if [ "$YOUR_KERNEL_SUCKS" != "" ] || [ "$kernelpath" = "" ] || [ "$kernelpath" = "SUCKS" ] || [ "$kernelpath" = "FAILSAFE" ] ; then -
branches/stable/mindi/rootfs/sbin/init
r1939 r1977 105 105 [ "$1" != "" ] && tapedev=$1 106 106 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2` 107 # tar -zxf $tapedev 107 mt -f $tapedev rewind 108 mt -f $tapedev fsf 2 108 109 dd if=$tapedev bs=32k count=1024 | tar -zx 109 110 res=$? 110 111 if [ "$res" -eq "0" ] ; then 111 grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg 112 echo "media-dev=$tapedev" >> /tmp/mr.cfg 113 cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg 112 # Store the dev name in case we changed it interactively 113 sed -i "s/^media-dev .*$/media-dev $tapedev/" /tmp/mondo-restore.cfg 114 115 #grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg 116 #echo "media-dev $tapedev" >> /tmp/mr.cfg 117 #cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg 114 118 fi 115 119 cd $old_pwd … … 120 124 local res tapedev 121 125 tapedev="" ; # will be set by UntarTapeStuff() 126 127 # Here we can add the USB storage module, it's working even with OBDR ! 128 modprobe -q usb-storage 129 # Tape takes some time to appear 130 sleep 10 122 131 cd $GROOVY 123 UntarTapeStuff $tapedev || UntarTapeStuff /dev/st0 || UntarTapeStuff /dev/osst0 || UntarTapeStuff /dev/ht0132 UntarTapeStuff $tapedev 124 133 res=$? 125 134 while [ "$res" -ne "0" ] ; do … … 139 148 fi 140 149 done 150 # For post-init 151 export TAPEDEV=$tapedev 141 152 142 153 if [ "$res" -ne "0" ] ; then … … 146 157 res=$? 147 158 else 148 # clear149 159 LogIt "Using tape as extended datadisk. Good." 3 150 160 echo "Using tape as extd ddisk." > /tmp/TAPEDEV-HAS-DATA-DISKS … … 584 594 export DENY_MODS=" " 585 595 fi 586 596 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg`" ]; then 597 # Do not try to load usb storage when dealing with OBDR it makes the modprobe hang :-( 598 export DENY_MODS="usb-storage $DENY_MODS" 599 fi 587 600 if [ "`grep -i forcemods /proc/cmdline`" ]; then 588 601 export FORCE_MODS="`cat /proc/cmdline | sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone" … … 623 636 fi 624 637 625 if [ "`grep -i ' tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev/tmp/mondo-restore.cfg`" ]; then638 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg`" ]; then 626 639 HandleTape 627 640 ExtractDataDisksAndLoadModules … … 635 648 ExtractDataDisksAndLoadModules 636 649 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg | grep media-type`" ]; then 637 # We need to get here exported variables from start-nfs638 650 . /sbin/start-usb 639 651 -
branches/stable/mindi/rootfs/sbin/post-init
r1621 r1977 104 104 done 105 105 106 mondoopt="" 107 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg`" ]; then 108 mondoopt="$mondoopt -o -d $TAPEDEV" 109 fi 110 111 if [ "`grep -i 'debug' /proc/cmdline`" ]; then 112 mondoopt="$mondoopt -K 99" 113 fi 114 106 115 if [ "$compare" ] ; then 107 116 LogIt "------------------COMPARE MODE-----------------" 1 108 mondorestore --compare117 mondorestore $mondoopt -Z compare 109 118 elif [ "$nuke" ] ; then 110 119 LogIt "-------------------NUKE MODE-------------------" 1 111 mondorestore --nuke120 mondorestore $mondoopt -Z nuke 112 121 elif [ "$expert" ] ; then 113 122 if [ "`grep tapedev /tmp/mondo-restore.cfg`" ] ; then … … 119 128 LogIt "Tape Mode -- calling mondorestore..." 120 129 if [ "$nuke" ] ; then 121 mondorestore --nuke130 mondorestore $mondoopt -Z nuke 122 131 else 123 mondorestore ; # MR will detect & access the tape132 mondorestore $mondoopt; # MR will detect & access the tape 124 133 fi 125 134 fi … … 132 141 LogIt "Cdstream Mode -- calling mondorestore..." 133 142 if [ "$nuke" ] ; then 134 mondorestore - -nuke143 mondorestore -Z nuke $mondoopt 135 144 else 136 mondorestore ; # MR will detect & access the cdstream145 mondorestore $mondoopt; # MR will detect & access the cdstream 137 146 fi 138 147 fi … … 147 156 else 148 157 LogIt "------------------INTERACTIVE------------------" 1 149 mondorestore - -interactive158 mondorestore -Z interactive $mondoopt 150 159 fi 151 160 152 [ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore - -mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1161 [ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore -Z mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1 153 162 154 163 exit 0 -
branches/stable/mondo-doc/mondoarchive.8
r1903 r1977 189 189 this is the directory where the ISO images are stored. For NFS users, this is 190 190 the directory within the NFS mount where the backups are stored. The default 191 for ISO and NFS is '/ root/images/mondo'.191 for ISO and NFS is '/var/cache/mondo'. 192 192 193 193 .TP … … 212 212 .TP 213 213 .BI "-o " 214 Use LILO as boot loader of boot media instead of SYSLINUX/ISOLINUX. By 215 default, SYSLINUX is used for USB and ISOLINUX for CD's. Use LILO if you 216 prefer to use that boot loader. NB: This does not affect which boot loader you 217 use to boot your PC, merely the boot loader used by the media created 218 by Mondo. Use ELILO instead which is mandatory for IA64 machines. 214 Use OBDR (One Button Disaster Recovery) type of tapes. 215 By default, tapes are not bootable. With this flag, tape will be made bootable 216 following the OBDR format. 219 217 220 218 .TP … … 310 308 .TP 311 309 .BI "-e " 312 Don't eject the CD or tape when backing up or restoring... unless cdrecord 313 insists on it. If it does, well, tough. Sorry. :) 310 Don't eject the CD or tape when backing up... 314 311 315 312 .TP -
branches/stable/mondo-doc/mondorestore.8
r1903 r1977 45 45 .B prefix 46 46 to specify the name of your ISO images. 47 By default, mondo archive names images mondorescue-1.iso, mondorescue-2.iso, ...47 By default, mondorestore names images mondorescue-1.iso, mondorescue-2.iso, ... 48 48 Using 49 49 .B -p machine … … 52 52 53 53 .TP 54 .BI "-i " 55 Use ISO files (CD images) as restore media. This is good when having backed up your 56 system to a spare hard drive. The 57 .B -n 58 switch is a wiser choice if you plan to restore from a remote filesystem. 59 60 .TP 61 .BI "-n " mount 62 Use files residing on NFS partition as restore media. 63 .I mount 64 is the remote mount-point, e.g. '192.168.1.3:/home/nfs' 65 for my file server. Please mount it before restoring/verifying. 66 67 .TP 68 .BI "-t " 69 Use tape streamer as restore device and its tapes as restore media. 70 71 .TP 72 .BI "-U " 73 Use a generic USB device as restore device. Use this if you want to read 74 your backup from a USB key or USB disk. 75 The USB device should be attached to the system ir order for this to work and 76 its device name passed to the 77 .BR \-d 78 option. 79 80 .TP 81 .BI "-u " 82 Use a generic streaming device as restore device. Use this if you want to read 83 your backup from a device that is not directly support by mondoarchive. This will 84 get the data directly from a raw device. 85 .B For experienced users only. 86 87 .TP 88 .BI "-E " "\*(lqpath ...\*(rq" 89 Exclude path(s) from restore (future dev). The paths should be separated with a whitespace. 90 /mnt/cdrom, /proc, /sys, /tmp). For example, if you are restoring up from an NFS mount but you 91 do not want to restore some content, exclude it with that switch. 92 93 .TP 94 .BI "-I " "\*(lqpath ...\*(rq" 95 Include paths(s) to retore (future dev). 96 97 .TP 98 .BI "-J " "file" 99 Specify an explicit list of files and directories to restore in a plain text file, one item 100 (file or directory) per line. Beware that directories placed in that file are not managed recursively contrary to what is done with the -I option. 101 102 .TP 103 .BI "-d " "dev|dir" 104 Specify the restore device (CD/tape/USB) or directory (NFS/ISO). For CD-R[W] drives, 105 this is the SCSI node where the drive may be found, e.g. '0,1,0'. For tape 106 users, this is the tape streamers /dev entry, e.g. '/dev/st0'. For USB users, 107 this is the device name of your key or external disk. For ISO users, 108 this is the directory where the ISO images are stored. For NFS users, this is 109 the directory within the NFS mount where the backups are stored. The default 110 for ISO and NFS is '/var/cache/mondo'. 111 112 .TP 113 .BI "-g " 114 GUI mode. Without this switch, the screen output of mondorestore is text based. 115 116 .TP 117 .BI "-m " 118 Manual (not self-retracting) CD trays are often found on laptops. If you are 119 a laptop user, your CD burner has BurnProof technology or you experience 120 problems with mondo then please call mondorestore with this switch. 121 122 .TP 123 .BI "-o " 124 Use OBDR (One Button Disaster Recovery) type of tapes. 125 By default, tapes are not bootable. With this flag, tape will be read as bootable tapes 126 following the OBDR format. 127 128 .TP 129 .BI "-x " "'dev ...'" 130 Specify non-Linux partitions which you want to restore (future dev). 131 132 .TP 133 .BI "-T " "path" 134 Specify the full pathname of the tempdir, the directory where temporary files 135 are stored. 136 137 .TP 138 .BI "-b " 139 Specify the internal block size used by the tape drive. This is usually 32K but 140 some drives just don't like that. They should but they don't. That's what 141 happens when tape drive vendors don't talk to kernel driver writers. Try 512 or 142 16384. 143 144 .TP 145 .BI "-e " 146 Don't eject the CD or tape when restoring... 147 148 .TP 149 .BI "-f " "device" 150 Specify the drive on which your Master Boot Record lives. Usually, this is 151 discovered automatically. (future dev) 152 153 .TP 154 .BI "-Q " 155 Give more detailed information about the boot loader. 156 157 .TP 54 158 .BI "-K " "loglevel" 55 159 Specify the loglevel. Use 99 for full debug. Standard debug level is 4. 160 161 .TP 162 .BI "-z " 163 Use extended attributes and acl for each file and store them in the backup media. Use this option if you use SElinux e.g. but it will slow down backup and restore time of course. 56 164 57 165 .SH DIAGNOSTICS -
branches/stable/mondo/src/common/libmondo-archive.c
r1939 r1977 60 60 /*@unused@*/ 61 61 //static char cvsid[] = "$Id$"; 62 // 63 extern char *get_non_rewind_dev(char *); 62 64 63 65 /* *************************** external global vars ******************/ … … 70 72 extern long long g_tape_posK; 71 73 extern char *g_tmpfs_mountpt; 72 extern bool g_cd_recovery;73 74 extern char *g_serial_string; 74 75 75 extern char *g_getfacl; 76 76 extern char *g_getfattr; … … 79 79 /* Reference to global bkpinfo */ 80 80 extern struct s_bkpinfo *bkpinfo; 81 82 81 83 82 … … 111 110 static int g_sem_id; 112 111 static int g_sem_key; 113 114 115 116 112 117 113 /** … … 540 536 char *use_lilo_sz = NULL; 541 537 char *bootdev = NULL; 538 char *ntapedev = NULL; 542 539 543 540 /*@ char ************************************************************** */ … … 586 583 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 587 584 mr_asprintf(&tape_size_sz, "%ld", bkpinfo->media_size); 585 ntapedev = get_non_rewind_dev(bkpinfo->media_device); 586 if ((bkpinfo->use_obdr) && (ntapedev != NULL)) { 587 mr_free(bkpinfo->media_device); 588 bkpinfo->media_device = ntapedev; 589 } else { 590 if (ntapedev == NULL) { 591 log_it("Not able to create OBDR - Restore will have to be done manually"); 592 } 593 } 588 594 mr_asprintf(&tape_device, bkpinfo->media_device); 589 595 } else { … … 858 864 mr_fprintf(fd1, "acl=no\n"); 859 865 } 866 if (bkpinfo->use_obdr) { 867 asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir); 868 if (write_one_liner_data_file(tmp1, "TRUE")) { 869 log_msg(1, "%ld: Unable to write one-liner OBDR", 870 __LINE__); 871 } 872 paranoid_free(tmp1); 873 } 860 874 861 875 if (g_cd_recovery) { … … 1255 1269 openout_cdstream(bkpinfo->media_device, bkpinfo->writer_speed); 1256 1270 } else { 1257 openout_tape( bkpinfo->media_device, bkpinfo->internal_tape_block_size); /* sets g_tape_stream */1271 openout_tape(); /* sets g_tape_stream */ 1258 1272 } 1259 1273 if (!g_tape_stream) { … … 2144 2158 /* copy to CD (scratchdir) ... and an actual CD-R if necessary */ 2145 2159 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2146 register_in_tape_catalog(fileset, curr_set_no, -1, 2147 curr_afioball_fname); 2148 maintain_collection_of_recent_archives(bkpinfo->tmpdir, 2149 curr_afioball_fname); 2160 register_in_tape_catalog(fileset, curr_set_no, -1, curr_afioball_fname); 2161 maintain_collection_of_recent_archives(bkpinfo->tmpdir, curr_afioball_fname); 2150 2162 iamhere("Writing EXAT files"); 2151 2163 res += -
branches/stable/mondo/src/common/libmondo-cli.c
r1939 r1977 199 199 /* Reference to global bkpinfo */ 200 200 extern struct s_bkpinfo *bkpinfo; 201 202 extern void free_MR_global_filenames(void); 201 203 202 204 /** … … 349 351 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 350 352 351 /* compulsory */353 /* compulsory */ 352 354 i = flag_set['c'] + flag_set['i'] + flag_set['n'] + 353 355 flag_set['t'] + flag_set['u'] + flag_set['r'] + 354 356 flag_set['w'] + flag_set['C'] + flag_set['U']; 355 if ( i == 0) {357 if ((i == 0) && (! bkpinfo->restore_data)) { 356 358 retval++; 357 359 log_to_screen("You must specify the media type\n"); … … 361 363 log_to_screen("Please specify only one media type\n"); 362 364 } 365 363 366 if (flag_set['K']) { 364 367 g_loglevel = atoi(flag_val['K']); 365 log_msg(1,"Loglevel forced to % s",g_loglevel);368 log_msg(1,"Loglevel forced to %d",g_loglevel); 366 369 if (g_loglevel < 3) { 367 370 g_loglevel = 3; 368 371 } 369 372 } 370 if (flag_set['L'] && flag_set['0']) { 373 374 if ((flag_set['L'] && flag_set['0']) && (! bkpinfo->restore_data)) { 371 375 retval++; 372 376 log_to_screen("You cannot have 'no compression' _and_ LZOP.\n"); 373 377 } 374 bkpinfo->backup_data = flag_set['O']; 378 if (! bkpinfo->restore_data) { 379 bkpinfo->backup_data = flag_set['O']; 380 } 375 381 bkpinfo->verify_data = flag_set['V']; 382 376 383 if (flag_set['I'] && !bkpinfo->backup_data) { 377 384 log_to_screen("-I switch is ignored if just verifying"); … … 401 408 } 402 409 } 403 if (flag_set['W']) { 410 411 if ((flag_set['W']) && (! bkpinfo->restore_data)) { 404 412 bkpinfo->nonbootable_backup = TRUE; 405 413 log_to_screen("Warning - you have opted for non-bootable backup"); … … 409 417 } 410 418 } 411 if (flag_set['t'] && flag_set['H']) { 419 420 if ((flag_set['t'] && flag_set['H']) && (! bkpinfo->restore_data)) { 412 421 fatal_error 413 422 ("Sorry, you may not nuke w/o warning from tape. Drop -H, please."); 414 423 } 424 415 425 if (flag_set['I']) { 416 426 if (!strcmp(bkpinfo->include_paths, "/")) { … … 430 440 if (q != NULL) { 431 441 *q = '\0'; 432 if ( stat(p, &buf) != 0) {442 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 433 443 log_msg(1, "ERROR ! %s doesn't exist", p); 434 444 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); … … 436 446 p = q+1 ; 437 447 } else { 438 if ( stat(p, &buf) != 0) {448 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 439 449 log_msg(1, "ERROR ! %s doesn't exist", p); 440 450 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); … … 456 466 457 467 if (g_kernel_version >= 2.6 && !flag_set['d'] 458 && (flag_set['c'] || flag_set['w']) ) {468 && (flag_set['c'] || flag_set['w']) && (! bkpinfo->restore_data)) { 459 469 fatal_error 460 470 ("If you are using the 2.6.x kernel, please specify the CD-R(W) device."); … … 471 481 strcpy(bkpinfo->include_paths, flag_val['J']); 472 482 } 473 if (flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['r']) { 483 484 if ((flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['r']) && (! bkpinfo->restore_data)) { 474 485 if (!flag_set['r'] && g_kernel_version <= 2.5 475 486 && strstr(flag_val['d'], "/dev/")) { … … 522 533 } 523 534 } 524 if (flag_set['t'] && !flag_set['d']) { 535 536 if ((flag_set['t'] && !flag_set['d']) && (! bkpinfo->restore_data)) { 525 537 log_it("Hmm! No tape drive specified. Let's see what we can do."); 526 538 if (find_tape_device_and_size(flag_val['d'], tmp)) { … … 540 552 if (! flag_set['d']) { 541 553 fatal_error 542 ("You need to specify a device file with -d for bootable USB device creation");543 } 544 if ( !flag_set['s']) {554 ("You need to specify a device file with -d for bootable USB device usage"); 555 } 556 if ((!flag_set['s']) && (! bkpinfo->restore_data)) { 545 557 fatal_error("You did not specify a size (-s) for your USB device. Aborting"); 546 558 } … … 559 571 } 560 572 } 561 if (!find_home_of_exe("growisofs")) {562 fatal_error563 ("Please install growisofs (probably part of dvd+rw-tools). If you want DVD support, you need it.");564 }565 if (!find_home_of_exe("dvd+rw-format")) {566 fatal_error567 ("Please install dvd+rw-format (probably part of dvd+rw-tools). If you want DVD support, you need it.");568 }569 573 if (strchr(flag_val['d'], ',')) { 570 574 fatal_error 571 575 ("Please don't give a SCSI node. Give a _device_, preferably a /dev entry, for the parameter of the -d flag."); 572 576 } 573 if (!flag_set['s']) { 574 sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 575 strcat(flag_val['s'], "m"); 576 log_to_screen 577 ("You did not specify a size (-s) for DVD. I'm guessing %s.", 578 flag_val['s']); 579 flag_set['s'] = 1; 577 if (! bkpinfo->restore_data) { 578 if (!find_home_of_exe("growisofs")) { 579 fatal_error 580 ("Please install growisofs (probably part of dvd+rw-tools). If you want DVD support, you need it."); 581 } 582 if (!find_home_of_exe("dvd+rw-format")) { 583 fatal_error 584 ("Please install dvd+rw-format (probably part of dvd+rw-tools). If you want DVD support, you need it."); 585 } 586 if (!flag_set['s']) { 587 sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 588 strcat(flag_val['s'], "m"); 589 log_to_screen 590 ("You did not specify a size (-s) for DVD. I'm guessing %s.", 591 flag_val['s']); 592 flag_set['s'] = 1; 593 } 580 594 } 581 595 /* … … 591 605 ("Please don't give a SCSI node. Give a _device_, preferably a /dev entry, for the parameter of the -d flag."); 592 606 } 593 if ( flag_set['O']) {607 if ((flag_set['O']) && (! bkpinfo->restore_data)) { 594 608 if (flag_set['s']) { 595 609 if (flag_set['t']) { … … 609 623 } 610 624 } 611 } else {/* CD|USB size */625 } else if (! bkpinfo->restore_data) { /* CD|USB size */ 612 626 if (flag_set['s']) { 613 627 if (process_the_s_switch(flag_val['s'])) { … … 619 633 } /* CD-RW */ 620 634 } 635 621 636 if (flag_set['n']) { 622 637 strncpy(bkpinfo->nfs_mount, flag_val['n'], MAX_STR_LEN); … … 636 651 log_msg(3, "isodir= %s", bkpinfo->isodir); 637 652 } 653 638 654 if (flag_set['c']) { 639 655 bkpinfo->backup_media_type = cdr; … … 702 718 q++; 703 719 /* End of bug fix */ 704 if ( stat(p, &buf) != 0) {720 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 705 721 log_msg(1, "WARNING ! %s doesn't exist", p); 706 722 } 707 723 p = q+1 ; 708 724 } else { 709 if ( stat(p, &buf) != 0) {725 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 710 726 log_msg(1, "WARNING ! %s doesn't exist", p); 711 727 } … … 719 735 4*MAX_STR_LEN - strlen(bkpinfo->exclude_paths)); 720 736 } 737 721 738 if (flag_set['e']) { 722 739 bkpinfo->please_dont_eject = TRUE; 723 740 } 724 if (flag_set['N']) // exclude NFS mounts & devices 741 742 if ((flag_set['N']) && (! bkpinfo->restore_data)) // exclude NFS mounts & devices 725 743 { 726 744 // strncpy(psz, list_of_NFS_devices_and_mounts(), MAX_STR_LEN); … … 733 751 bkpinfo->exclude_paths); 734 752 } 753 735 754 if (strlen(bkpinfo->exclude_paths) >= 4*MAX_STR_LEN) { 736 755 fatal_error 737 756 ("Your '-E' parameter is too long. Increase MAX_STR_LEN"); 738 757 } 758 739 759 if (flag_set['b']) { 740 760 strcpy(psz, flag_val['b']); … … 754 774 bkpinfo->internal_tape_block_size = itbs; 755 775 } 756 if (flag_set['D']) { 776 777 if ((flag_set['D']) && (! bkpinfo->restore_data)) { 757 778 bkpinfo->differential = 1; 758 779 // bkpinfo->differential = atoi (flag_val['D']); … … 762 783 } 763 784 } 785 764 786 if (flag_set['x']) { 765 787 strncpy(bkpinfo->image_devs, flag_val['x'], MAX_STR_LEN / 4); 766 if ( run_program_and_log_output("which ntfsclone", 2)) {788 if ((run_program_and_log_output("which ntfsclone", 2)) && (! bkpinfo->restore_data)) { 767 789 fatal_error("Please install ntfsprogs package/tarball."); 768 790 } 769 791 } 792 770 793 if (flag_set['m']) { 771 794 bkpinfo->manual_cd_tray = TRUE; 772 795 } 773 if (flag_set['k']) { 796 797 if ((flag_set['k']) && (! bkpinfo->restore_data)) { 774 798 strncpy(bkpinfo->kernel_path, flag_val['k'], MAX_STR_LEN); 775 799 if (!strcmp(bkpinfo->kernel_path, "failsafe")) { … … 785 809 } 786 810 } 811 787 812 if (flag_set['p']) { 788 813 strncpy(bkpinfo->prefix, flag_val['p'], MAX_STR_LEN / 4); 789 }790 814 log_msg(1,"Prefix forced to %s",bkpinfo->prefix); 815 } 791 816 792 817 if (flag_set['d']) { /* backup directory (if ISO/NFS) */ … … 801 826 strncpy(bkpinfo->nfs_remote_dir, flag_val['d'], MAX_STR_LEN); 802 827 } else { /* backup device (if tape/CD-R/CD-RW) */ 803 804 828 strncpy(bkpinfo->media_device, flag_val['d'], MAX_STR_LEN / 4); 805 829 } 806 830 } 807 831 808 if ( flag_set['n']) {832 if ((flag_set['n']) && (! bkpinfo->restore_data)) { 809 833 asprintf(&tmp1,"%s/%s/.dummy.txt", bkpinfo->isodir,bkpinfo->nfs_remote_dir); 810 834 sprintf(tmp, "echo hi > %s", tmp1); … … 839 863 } 840 864 841 if ( !flag_set['d'] && !flag_set['n'] && !flag_set['C']) {865 if ((!flag_set['d'] && !flag_set['n'] && !flag_set['C']) && (! bkpinfo->restore_data)) { 842 866 retval++; 843 867 log_to_screen("Please specify the backup device/directory.\n"); … … 845 869 ("You didn't use -d to specify the backup device/directory."); 846 870 } 847 /* optional, obscure */ 871 848 872 for (i = '0'; i <= '9'; i++) { 849 873 if (flag_set[i]) { … … 851 875 } /* not '\0' but '0' */ 852 876 } 877 853 878 if (flag_set['S']) { 854 879 sprintf(bkpinfo->scratchdir, "%s/mondo.scratch.%ld", flag_val['S'], 855 880 random() % 32768); 856 881 } 882 857 883 if (flag_set['T']) { 858 884 setup_tmpdir(flag_val['T']); … … 872 898 } 873 899 } 874 if (flag_set['A']) { 900 901 if ((flag_set['A']) && (! bkpinfo->restore_data)) { 875 902 strncpy(bkpinfo->call_after_iso, flag_val['A'], MAX_STR_LEN); 876 903 } 877 if (flag_set['B']) { 904 905 if ((flag_set['B']) && (! bkpinfo->restore_data)) { 878 906 strncpy(bkpinfo->call_before_iso, flag_val['B'], MAX_STR_LEN); 879 907 } 880 if (flag_set['H']) { 908 909 if ((flag_set['H']) && (! bkpinfo->restore_data)) { 881 910 g_cd_recovery = TRUE; 882 911 } 883 if (flag_set['l']) { 912 913 if ((flag_set['l']) && (! bkpinfo->restore_data)) { 884 914 #ifdef __FreeBSD__ 885 915 # define BOOT_LOADER_CHARS "GLBMR" … … 901 931 #undef BOOT_LOADER_CHARS 902 932 } 933 903 934 if (flag_set['f']) { 904 935 strncpy(bkpinfo->boot_device, … … 907 938 MAX_STR_LEN / 4); 908 939 } 909 if (flag_set['P']) { 940 941 if ((flag_set['P']) && (! bkpinfo->restore_data)) { 910 942 strncpy(bkpinfo->postnuke_tarball, flag_val['P'], MAX_STR_LEN); 911 943 } 944 912 945 if (flag_set['Q']) { 913 946 i = which_boot_loader(tmp); … … 916 949 finish(0); 917 950 } 918 if (flag_set['L']) { 951 952 if ((flag_set['L']) && (! bkpinfo->restore_data)) { 919 953 bkpinfo->use_lzo = TRUE; 920 954 if (run_program_and_log_output("which lzop", 2)) { … … 925 959 } 926 960 927 if ( flag_set['G']) {961 if ((flag_set['G']) && (! bkpinfo->restore_data)) { 928 962 bkpinfo->use_gzip = TRUE; 929 963 if (run_program_and_log_output("which gzip", 2)) { … … 934 968 } 935 969 936 if (!flag_set['o'] 937 && 938 !run_program_and_log_output 939 ("grep -Ei suse /etc/issue.net | grep -E '9.0' | grep 64", 2)) { 970 bkpinfo->use_obdr = FALSE; 971 if (flag_set['o']) { 972 if ((!flag_set['t']) && (! bkpinfo->restore_data)) { 973 log_to_screen("OBDR support is only available for tapes. Use the -t option"); 974 fatal_error("Aborting"); 975 } 976 bkpinfo->use_obdr = TRUE; 977 } 978 979 #ifndef __FreeBSD__ 980 if ((!is_this_a_valid_disk_format("vfat")) && (! bkpinfo->restore_data)) { 940 981 bkpinfo->make_cd_use_lilo = TRUE; 941 982 log_to_screen 942 ("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary."); 943 } 944 if (flag_set['o']) { 983 ("Your kernel appears not to support vfat filesystems. I am therefore"); 984 log_to_screen 985 ("using LILO instead of SYSLINUX as the media boot loader."); 986 } 987 if ((run_program_and_log_output("which mkfs.vfat", 2)) && (! bkpinfo->restore_data)) { 945 988 bkpinfo->make_cd_use_lilo = TRUE; 946 }947 #ifndef __FreeBSD__948 else {949 if (!is_this_a_valid_disk_format("vfat")) {950 bkpinfo->make_cd_use_lilo = TRUE;951 log_to_screen952 ("Your kernel appears not to support vfat filesystems. I am therefore");953 log_to_screen954 ("using LILO instead of SYSLINUX as the media boot loader.");955 }956 if (run_program_and_log_output("which mkfs.vfat", 2)) {957 bkpinfo->make_cd_use_lilo = TRUE;958 989 #ifdef __IA32__ 959 960 961 962 990 log_to_screen 991 ("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as"); 992 log_to_screen 993 ("your boot loader. I shall therefore use LILO instead."); 963 994 #endif 964 995 #ifdef __IA64__ 965 966 967 968 996 log_to_screen 997 ("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI"); 998 log_to_screen("environment correctly. Please install it."); 999 fatal_error("Aborting"); 969 1000 #endif 970 1001 } 971 1002 #ifdef __IA64__ 972 973 1003 /* We force ELILO usage on IA64 */ 1004 bkpinfo->make_cd_use_lilo = TRUE; 974 1005 #endif 975 }976 1006 #endif 977 1007 … … 980 1010 } 981 1011 982 if ( ! bkpinfo->restore_data) {1012 if (! bkpinfo->restore_data) { 983 1013 i = flag_set['O'] + flag_set['V']; 984 1014 if (i == 0) { 985 1015 retval++; 986 1016 log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n"); 1017 } 1018 } 1019 1020 if ((! bkpinfo->restore_data) && (flag_set['Z'])) { 1021 fatal_error 1022 ("The -Z switch is only valid in restore mode"); 1023 } 1024 1025 if (flag_set['Z']) { 1026 if (! strcmp(flag_val['Z'], "nuke")) { 1027 bkpinfo->restore_mode = nuke; 1028 } else if (! strcmp(flag_val['Z'], "interactive")) { 1029 bkpinfo->restore_mode = interactive; 1030 } else if (! strcmp(flag_val['Z'], "compare")) { 1031 bkpinfo->restore_mode = compare; 1032 } else if (! strcmp(flag_val['Z'], "mbr")) { 1033 bkpinfo->restore_mode = mbr; 1034 } else if (! strcmp(flag_val['Z'], "iso")) { 1035 bkpinfo->restore_mode = isoonly; 1036 } else if (! strcmp(flag_val['Z'], "isonuke")) { 1037 bkpinfo->restore_mode = isonuke; 1038 } else { 1039 bkpinfo->restore_mode = interactive; 987 1040 } 988 1041 } … … 1082 1135 void help_screen() 1083 1136 { 1084 log_msg(1, "Type 'man mondo -archive' for more information\n");1137 log_msg(1, "Type 'man mondoarchive' for more information\n"); 1085 1138 exit(1); 1086 1139 } … … 1141 1194 } 1142 1195 kill_buffer(); 1196 1197 free_MR_global_filenames(); 1198 1143 1199 fatal_error 1144 ("Mondo archive is terminating in response to a signal from the OS");1200 ("MondoRescue is terminating in response to a signal from the OS"); 1145 1201 finish(254); // just in case 1146 1202 } -
branches/stable/mondo/src/common/libmondo-devices.c
r1939 r1977 1749 1749 1750 1750 case tape: 1751 if (bkpinfo->media_device) { 1751 if ((!bkpinfo->restore_mode) && (find_tape_device_and_size(bkpinfo->media_device, sz_size))) { 1752 mr_msg(3, "Ok, using vanilla scsi tape."); 1753 mr_free(bkpinfo->media_device); 1754 mr_asprintf(&tmp,VANILLA_SCSI_TAPE); 1755 bkpinfo->media_device = tmp; 1756 1752 1757 if ((fin = fopen(bkpinfo->media_device, "r"))) { 1753 1758 paranoid_fclose(fin); … … 1795 1800 bkpinfo->media_size = 0L; 1796 1801 mr_msg(4, "media_size = %ld", bkpinfo->media_size); 1802 bkpinfo->use_obdr = ask_me_yes_or_no 1803 ("Do you want to activate OBDR support for your tapes ?"); 1797 1804 if (archiving_to_media) { 1798 1805 if ((bkpinfo->compression_level = … … 2196 2203 strcpy(exclude_these_directories, 2197 2204 call_program_and_get_last_line_of_output 2198 ("mount -t coda,ncpfs,nfs,smbfs,cifs,afs, ocfs,ocfs2,mvfs | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'"));2205 ("mount -t coda,ncpfs,nfs,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'")); 2199 2206 strcpy(exclude_these_devices, 2200 2207 call_program_and_get_last_line_of_output 2201 ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|afs| ocfs|ocfs2|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));2208 ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'")); 2202 2209 sprintf(result_sz, "%s", exclude_these_directories); 2203 2210 mr_free(exclude_these_devices); … … 2227 2234 mr_asprintf(&tmp, 2228 2235 call_program_and_get_last_line_of_output 2229 ("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs,afs, ocfs,ocfs2,mvfs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));2236 ("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'")); 2230 2237 #else 2231 2238 mr_asprintf(&tmp, 2232 2239 call_program_and_get_last_line_of_output 2233 ("LANGUAGE=C df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs -x afs -x ocfs -x ocfs2 -x mvfs | sed 's/ /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));2240 ("LANGUAGE=C df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs | sed 's/ /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'")); 2234 2241 #endif 2235 2242 -
branches/stable/mondo/src/common/libmondo-filelist.c
r1924 r1977 1603 1603 mr_asprintf(&exclude_paths, " %s %s %s %s %s %s . .. \ 1604 1604 " MNT_CDROM " " MNT_FLOPPY " /media /tmp /var/log/lastlog \ 1605 /proc /sys / root/images/mondo ", MINDI_CACHE, MONDO_CACHE, excp, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);1606 paranoid_free(tmp2);1605 /proc /sys /var/cache/mondo ", MINDI_CACHE, MONDO_CACHE, excp, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1606 mr_free(tmp2); 1607 1607 1608 1608 mr_msg(2, -
branches/stable/mondo/src/common/libmondo-stream-EXT.h
r1663 r1977 13 13 extern int openin_tape(); 14 14 extern int openout_cdstream(char *cddev, int speed); 15 extern int openout_tape( char *tapedev, long internal_tape_block_size);15 extern int openout_tape(); 16 16 extern int read_file_from_stream_to_file( 17 17 char *outfile, long long size); -
branches/stable/mondo/src/common/libmondo-stream.c
r1939 r1977 2 2 3 3 ...tools for talking to tapes, Monitas streams, etc. 4 4 5 */ 5 6 … … 364 365 int res = 0; 365 366 char *fname = (char *)&res; /* Should NOT be NULL */ 367 char *tmp = NULL; 366 368 367 369 // xattr … … 371 373 wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr); 372 374 } 373 if (!strstr(fname, "xattr")) { 374 fatal_error("Wrong order for xattr, sunshine."); 375 if (strstr(fname, "xattr") == NULL) { 376 asprintf(&tmp,"Wrong order expected xattr, got %s, sunshine.", fname); 377 fatal_error(tmp); 375 378 } 376 379 read_file_from_stream_to_file(xattr_fname, *ptmp_size); 377 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);380 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 378 381 if (*pctrl_chr != BLK_STOP_EXAT_FILE) { 379 382 wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr); 380 383 } 381 384 mr_msg(1, "Got xattr"); 382 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);385 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 383 386 if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) { 384 387 wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr); 385 388 } 386 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);387 if ( pctrl_chr == BLK_START_AN_AFIO_OR_SLICE) {389 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 390 if (*pctrl_chr == BLK_START_AN_AFIO_OR_SLICE) { 388 391 log_msg(1, "No acl attributes found, skipping to afio files"); 389 392 return(0); 390 393 } else { 391 if ( pctrl_chr != BLK_START_EXTENDED_ATTRIBUTES) {394 if (*pctrl_chr != BLK_START_EXTENDED_ATTRIBUTES) { 392 395 wrong_marker(BLK_START_EXTENDED_ATTRIBUTES, *pctrl_chr); 393 396 } … … 397 400 if (g_getfacl) { 398 401 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 399 if (!strstr(fname, "acl")) {400 fatal_error("Wrong order for acl, sunshine.");401 }402 402 if (*pctrl_chr != BLK_START_EXAT_FILE) { 403 403 wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr); 404 404 } 405 if (strstr(fname, "acl") == NULL) { 406 asprintf(&tmp,"Wrong order expected acl, got %s, sunshine.", fname); 407 fatal_error(tmp); 408 } 405 409 read_file_from_stream_to_file(acl_fname, *ptmp_size); 406 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);410 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 407 411 if (*pctrl_chr != BLK_STOP_EXAT_FILE) { 408 412 wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr); 409 413 } 410 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);414 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 411 415 if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) { 412 416 wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr); … … 595 599 596 600 597 int set_tape_block_size_with_mt(char *tapedev, 598 long internal_tape_block_size) 601 int set_tape_block_size_with_mt(long internal_tape_block_size) 599 602 { 600 603 char *tmp; 601 604 int res; 602 605 603 if (strncmp( tapedev, "/dev/", 5)) {606 if (strncmp(bkpinfo->media_device, "/dev/", 5)) { 604 607 mr_msg(1, 605 608 "Not using 'mt setblk'. This isn't an actual /dev entry."); 606 609 return (0); 607 610 } 608 mr_asprintf(&tmp, "mt -f %s setblk %ld", tapedev, 609 internal_tape_block_size); 611 mr_asprintf(&tmp, "mt -f %s setblk %ld",bkpinfo->media_device,internal_tape_block_size); 610 612 res = run_program_and_log_output(tmp, 3); 611 613 mr_free(tmp); 612 614 return (res); 615 } 616 617 /** 618 * Return the non-rewinding device when passed the normal one 619 * @param tapedev The tape device to open for writing. 620 * @note the caller needs to free the string returned 621 */ 622 char *get_non_rewind_dev(char *tapedev) 623 { 624 625 char *ntapedev = NULL; 626 char *p = NULL; 627 char *q = NULL; 628 char *r = NULL; 629 630 ntapedev = (char *)malloc(strlen(tapedev)+sizeof(char)); 631 p = strrchr(tapedev,'/'); 632 if (p == NULL) { 633 log_it("Didn't find a '/' in %s",tapedev); 634 return(NULL); 635 } 636 637 /* Copy tapedev content up to the last / */ 638 q = tapedev; 639 r = ntapedev; 640 while (q != p) { 641 *r = *q; 642 r++; 643 q++; 644 } 645 /* Copy the '/' */ 646 *r = *q; 647 r++; 648 q++; 649 /* Adds a 'n' - non-rewinding */ 650 *r = 'n'; 651 r++; 652 /* Copy the rest of tapedev */ 653 while (*q != '\0') { 654 *r = *q; 655 r++; 656 q++; 657 } 658 *r = '\0'; 659 if (mt_says_tape_exists(ntapedev)) { 660 log_it("Non-rewinding tape device is %s",ntapedev); 661 } else { 662 log_it("Unable to find non-rewinding tape device."); 663 ntapedev = NULL; 664 } 665 return(ntapedev); 666 } 667 668 669 670 /** 671 * Handle OBDR if we were asked to do so 672 * @param tapedev The tape device to open for reading. 673 */ 674 int skip_obdr(void) 675 { 676 char *command = NULL; 677 int res = 0; 678 679 log_it("Skipping OBDR headers"); 680 asprintf(&command, "mt -f %s rewind",bkpinfo->media_device); 681 res = run_program_and_log_output(command, 1); 682 paranoid_free(command); 683 684 asprintf(&command, "mt -f %s fsf 2",bkpinfo->media_device); 685 res = run_program_and_log_output(command, 1); 686 paranoid_free(command); 687 688 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 689 return(res); 690 } 691 692 /** 693 * Handle OBDR if we were asked to do so 694 * @param tapedev The tape device to open for writing. 695 * @return 0 for success, nonzero for failure. 696 * @note This should be called ONLY from backup processes. It will OVERWRITE ANY 697 * EXISTING DATA on the tape! 698 */ 699 int create_obdr(void) 700 { 701 702 char *command = NULL; 703 int res = 0; 704 705 log_it("Creating OBDR headers"); 706 /* OBDR: First block 10 kB of zero bs = 512 */ 707 asprintf(&command, "mt -f %s compression off",bkpinfo->media_device); 708 res = run_program_and_log_output(command, 1); 709 paranoid_free(command); 710 711 asprintf(&command, "mt -f %s rewind",bkpinfo->media_device); 712 res += run_program_and_log_output(command, 1); 713 paranoid_free(command); 714 715 set_tape_block_size_with_mt(512); 716 717 asprintf(&command, "dd if=/dev/zero of=%s bs=512 count=20",bkpinfo->media_device); 718 res += run_program_and_log_output(command, 1); 719 paranoid_free(command); 720 721 /* OBDR: then ISO boot image bs = 2048 */ 722 set_tape_block_size_with_mt(2048); 723 724 asprintf(&command, "dd if=%s of=%s bs=2048",MINDI_CACHE"/mondorescue.iso",bkpinfo->media_device); 725 res += run_program_and_log_output(command, 1); 726 paranoid_free(command); 727 728 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 729 return(res); 613 730 } 614 731 … … 633 750 int i; 634 751 int j; 635 int res ;752 int res = 0; 636 753 long length, templong; 637 754 size_t k; … … 654 771 return (0); 655 772 } 773 774 // mondoarchive should have configured everything to give the right non-rew device 775 if ((bkpinfo->use_obdr) && (bkpinfo->media_device != NULL)) { 776 res = skip_obdr(); 777 if (res != 0) { 778 log_it("Not able to skip OBDR - Restore will have to be done manually"); 779 } 780 } else { 781 if (bkpinfo->media_device == NULL) { 782 log_it("Not able to skip OBDR - Restore will have to be done manually"); 783 } 784 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 785 } 786 656 787 insist_on_this_tape_number(1); 657 788 mr_asprintf(&outfname, "%s/tmp/all.tar.gz", bkpinfo->tmpdir); 658 789 make_hole_for_file(outfname); 659 660 set_tape_block_size_with_mt(bkpinfo->media_device,661 bkpinfo->internal_tape_block_size);662 790 663 791 log_it("Opening IN tape"); … … 762 890 /** 763 891 * Start writing to a tape device for the backup. 892 * Handle OBDR if we were asked to do so 764 893 * @param tapedev The tape device to open for writing. 765 894 * @return 0 for success, nonzero for failure. … … 767 896 * EXISTING DATA on the tape! 768 897 */ 769 int openout_tape( char *tapedev, long internal_tape_block_size)770 { 898 int openout_tape() { 899 771 900 g_current_media_number = 1; 772 901 if (g_tape_stream) { … … 777 906 g_tape_posK = 0; 778 907 779 set_tape_block_size_with_mt(tapedev, internal_tape_block_size); 908 if (bkpinfo->use_obdr) { 909 create_obdr(); 910 } else { 911 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 912 } 780 913 log_it("Opening OUT tape"); 781 914 if (! 782 915 (g_tape_stream = 783 open_device_via_buffer( tapedev, 'w', internal_tape_block_size))) {916 open_device_via_buffer(bkpinfo->media_device, 'w', internal_tape_block_size))) { 784 917 log_to_screen(_("Cannot openin stream device")); 785 918 return (1); -
branches/stable/mondo/src/common/libmondo-stream.h
r1663 r1977 14 14 int openin_tape(); 15 15 int openout_cdstream(char *cddev, int speed); 16 int openout_tape( char *tapedev, long internal_tape_block_size);16 int openout_tape(); 17 17 int read_file_from_stream_to_file(char *outfile, 18 18 long long size); -
branches/stable/mondo/src/common/libmondo-tools.c
r1924 r1977 677 677 678 678 void setup_tmpdir(char *path) { 679 679 680 680 char *tmp = NULL; 681 681 char *p = NULL; … … 687 687 paranoid_free(tmp); 688 688 } 689 689 690 690 if (path != NULL) { 691 691 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", path); … … 758 758 } 759 759 bkpinfo->boot_device[0] = '\0'; 760 bkpinfo->restore_path[0] = '\0'; 760 bkpinfo->image_devs[0] = '\0'; 761 bkpinfo->compression_level = 3; 761 762 bkpinfo->do_not_compress_these[0] = '\0'; 762 763 bkpinfo->verify_data = FALSE; 763 764 bkpinfo->backup_data = FALSE; 764 765 bkpinfo->restore_data = FALSE; 766 bkpinfo->use_star = FALSE; 767 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 765 768 bkpinfo->disaster_recovery = 766 769 (am_I_in_disaster_recovery_mode()? TRUE : FALSE); … … 772 775 mr_asprintf(&tmp,mr_conf->prefix); 773 776 bkpinfo->prefix = tmp; 774 775 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 777 sensibly_set_tmpdir_and_scratchdir(); 778 776 779 bkpinfo->optimal_set_size = 0; 777 bkpinfo->backup_media_type = none;778 780 bkpinfo->backup_media_string[0] = '\0'; 779 781 strcpy(bkpinfo->include_paths, "/"); 782 bkpinfo->restore_path[0] = '\0'; 780 783 bkpinfo->call_before_iso[0] = '\0'; 781 784 bkpinfo->call_make_iso[0] = '\0'; 782 785 bkpinfo->call_after_iso[0] = '\0'; 783 bkpinfo->image_devs[0] = '\0';784 bkpinfo->postnuke_tarball[0] = '\0';785 786 bkpinfo->nfs_mount[0] = '\0'; 786 787 bkpinfo->nfs_remote_dir[0] = '\0'; 788 bkpinfo->postnuke_tarball[0] = '\0'; 787 789 bkpinfo->wipe_media_first = FALSE; 788 bkpinfo->differential = FALSE; 790 bkpinfo->differential = 0; 791 bkpinfo->please_dont_eject = FALSE; 789 792 bkpinfo->writer_speed = mr_conf->iso_burning_speed; 793 bkpinfo->manual_cd_tray = FALSE; 794 bkpinfo->nonbootable_backup = FALSE; 795 bkpinfo->make_cd_use_lilo = FALSE; 796 bkpinfo->use_obdr = FALSE; 797 bkpinfo->restore_mode = interactive; 790 798 } 791 799 -
branches/stable/mondo/src/common/mondostructures.h
r1904 r1977 127 127 */ 128 128 int index; 129 129 130 130 /** 131 131 * Type of disk. 132 132 */ 133 133 char type; // ' ' = data (default), S = spare, F = faulty 134 134 135 135 }; 136 136 … … 184 184 } t_archtype; 185 185 186 /** 187 * A type of file in the catalog of recent archives. 188 */ 189 typedef enum { 190 nuke = 0, /// Nuke mode 191 interactive, /// Interactive mode 192 compare, /// Compare mode 193 mbr, /// MBR mode 194 isoonly, /// ISO mode 195 isonuke, /// ISO+Nuke mode 196 } t_restore_mode; 197 186 198 187 199 #ifdef __FreeBSD__ … … 236 248 */ 237 249 int chunk_size; 238 250 239 251 /** 240 252 * The parity algorithm of this RAID device. (RAID5 only) … … 582 594 */ 583 595 bool make_cd_use_lilo; 596 597 /** 598 * If TRUE, make the the tape bootable. If FALSE, normal tape, the default 599 */ 600 bool use_obdr; 601 602 /** 603 * Nature of the restore 604 */ 605 t_restore_mode restore_mode; 584 606 }; 585 607 -
branches/stable/mondo/src/mondoarchive/mondoarchive.c
r1939 r1977 817 817 struct s_bkpinfo *bkpinfo; 818 818 819 /* To be coded */ 820 void free_MR_global_filenames(void) { 821 } 822 819 823 /****************** subroutines used only by main.c ******************/ 820 824 -
branches/stable/mondo/src/mondoarchive/mondoarchive.h
r1924 r1977 17 17 */ 18 18 char *MONDO_LOGFILE = "/var/log/mondoarchive.log"; 19 char *MONDO_OPTIONS = "0123456789A:B:C:DE: FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z";19 char *MONDO_OPTIONS = "0123456789A:B:C:DE:GHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"; 20 20 21 21 /* No restriction on ps options */ -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1939 r1977 56 56 57 57 extern void kill_anything_like_this(char *str); 58 extern int skip_obdr(void); 58 59 59 60 /** … … 72 73 mr_free(g_mondo_cfg_file); 73 74 mr_free(g_mountlist_fname); 75 mr_free(g_mondo_home); 74 76 mr_free(g_tmpfs_mountpt); 75 77 mr_free(g_isodir_device); … … 887 889 bkpinfo->use_star = TRUE; 888 890 mr_msg(1, "Goody! ... bkpinfo->use_star is now true."); 891 } 892 893 read_cfg_var(cfg_file, "obdr", value); 894 if (strstr(value, "yes")) { 895 bkpinfo->use_obdr = TRUE; 896 log_msg(1, "OBDR mode activated"); 889 897 } 890 898 … … 1786 1794 1787 1795 /** 1788 * Turn signal trapping on or off.1789 * @param on If TRUE, then do full cleanup when we receive a signal; if FALSE, then1790 * print a message and exit immediately.1791 */1792 void set_signals(int on)1793 {1794 int signals[] =1795 { SIGKILL, SIGPIPE, SIGTERM, SIGHUP, SIGTRAP, SIGABRT, SIGINT,1796 SIGSTOP, 01797 };1798 int i;1799 for (i = 0; signals[i]; i++) {1800 if (on) {1801 signal(signals[i], terminate_daemon);1802 } else {1803 signal(signals[i], termination_in_progress);1804 }1805 }1806 }1807 1808 /**************************************************************************1809 *END_SET_SIGNALS *1810 **************************************************************************/1811 1812 1813 /**1814 1796 * malloc() and set sensible defaults for the mondorestore filename variables. 1815 1797 * @param bkpinfo The backup information structure. Fields used: … … 1895 1877 /************************************************************************** 1896 1878 *END_STREAMLINE_CHANGES_FILE * 1897 **************************************************************************/1898 1899 1900 /**1901 * Exit due to a signal (normal cleanup).1902 * @param sig The signal we're exiting due to.1903 */1904 void terminate_daemon(int sig)1905 {1906 log_to_screen1907 (_("Mondorestore is terminating in response to a signal from the OS"));1908 free_MR_global_filenames();1909 finish(254);1910 }1911 /**************************************************************************1912 *END_TERMINATE_DAEMON *1913 1879 **************************************************************************/ 1914 1880 … … 1941 1907 /************************************************************************** 1942 1908 *END_TWENTY_SECONDS_TIL_YIKES * 1943 **************************************************************************/1944 1945 1946 /**1947 * Exit due to a signal (no cleanup).1948 * @param sig The signal we're exiting due to.1949 */1950 void termination_in_progress(int sig)1951 {1952 mr_msg(1, "Termination in progress");1953 usleep(1000);1954 pthread_exit(0);1955 }1956 /**************************************************************************1957 *END_TERMINATION_IN_PROGRESS *1958 1909 **************************************************************************/ 1959 1910 … … 2011 1962 "/mnt/.boot.d", 5); 2012 1963 } 1964 1965 /* Unmounting the local /proc and /sys first */ 1966 run_program_and_log_output("umount " MNT_RESTORING "/proc",3); 1967 run_program_and_log_output("umount " MNT_RESTORING "/sys",3); 1968 2013 1969 for (lino = mountlist->entries - 1; lino >= 0; lino--) { 2014 1970 if (!strcmp(mountlist->el[lino].mountpoint, "lvm")) { … … 2081 2037 // BERLIOS: below 32KB seems to block at least on RHAS 2.1 and MDK 10.0 2082 2038 2039 if (bkpinfo->use_obdr) { 2040 skip_obdr(); 2041 } 2083 2042 // tar -zxvf- 2084 2043 mr_asprintf(&command, -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1939 r1977 3324 3324 3325 3325 extern int partition_everything(struct mountlist_itself *mountlist); 3326 3326 extern int handle_incoming_parameters(int argc, char *argv[]); 3327 3327 3328 3328 /** … … 3545 3545 c = which_restore_mode(); 3546 3546 iamhere("post wrm"); 3547 if (c == 'I' || c == ' N' || c == 'C') {3547 if (c == 'I' || c == 'C') { 3548 3548 interactively_obtain_media_parameters_from_user(FALSE); 3549 } else if (c == 'N') { 3550 // Auto mode nothing special to do 3549 3551 } else { 3550 3552 popup_and_OK("No restoring or comparing will take place today."); … … 3710 3712 } 3711 3713 } 3712 3714 3713 3715 #ifdef __FreeBSD__ 3714 3716 if (strstr … … 6398 6400 } 6399 6401 6400 if (argc == 3 && strcmp(argv[1], "-p") == 0) {6401 strcpy(bkpinfo->prefix,argv[2]);6402 log_msg(1,"Prefix forced to %s",bkpinfo->prefix);6403 }6404 6405 if (argc == 3 && strcmp(argv[1], "-K") == 0) {6406 g_loglevel = atoi(argv[2]);6407 log_msg(1,"Loglevel forced to %s",g_loglevel);6408 }6409 6410 6402 if (argc == 2 && strcmp(argv[1], "--live-grub") == 0) { 6411 6403 retval = run_grub(FALSE, "/dev/hda"); … … 6419 6411 pause_and_ask_for_cdr(5, NULL); 6420 6412 paranoid_MR_finish(0); 6421 } else if (!bkpinfo->disaster_recovery) { // live! 6422 if (argc != 1) { 6423 popup_and_OK 6424 ("Live mode doesn't support command-line parameters yet."); 6425 paranoid_MR_finish(1); 6426 // return(1); 6427 } 6413 } 6414 if ((argc == 2 && strcmp(argv[1], "--partition-only") == 0) && (bkpinfo->disaster_recovery)) { 6415 log_msg(0, "Partitioning only."); 6416 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 6417 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 6418 load_mountlist(mountlist, g_mountlist_fname); 6419 res = partition_everything(mountlist); 6420 finish(res); 6421 } 6422 6423 if ((argc == 2 && strcmp(argv[1], "--format-only") == 0) && (bkpinfo->disaster_recovery)) { 6424 log_msg(0, "Formatting only."); 6425 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 6426 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 6427 load_mountlist(mountlist, g_mountlist_fname); 6428 res = format_everything(mountlist, FALSE, raidlist); 6429 finish(res); 6430 } 6431 6432 if ((argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) && (bkpinfo->disaster_recovery)) { 6433 log_msg(0, "Stopping LVM and RAID"); 6434 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 6435 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 6436 load_mountlist(mountlist, g_mountlist_fname); 6437 res = do_my_funky_lvm_stuff(TRUE, FALSE); 6438 res += stop_all_raid_devices(mountlist); 6439 finish(res); 6440 } 6441 6442 if ((argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) && (!bkpinfo->disaster_recovery)) { 6443 g_restoring_live_from_cd = TRUE; 6444 } 6445 6446 // Handle params here first 6447 handle_incoming_parameters(argc,argv); 6448 6449 if (!bkpinfo->disaster_recovery) { // live! 6428 6450 log_msg(1, "I am in normal, live mode."); 6429 6451 log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname); 6430 6452 mount_boot_if_necessary(); /* for Gentoo users */ 6431 6453 log_msg(2, "Still here."); 6432 if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {6433 g_restoring_live_from_cd = TRUE;6434 }6435 6454 if (bkpinfo->backup_media_type == nfs) { 6436 6455 g_restoring_live_from_nfs = TRUE; … … 6439 6458 retval = 6440 6459 restore_live_from_monitas_server(argv[2], 6441 6460 argv[3], argv[4]); 6442 6461 } else { 6443 6462 log_msg(2, "Calling restore_to_live_filesystem()"); … … 6455 6474 log_msg(1, "I must be in disaster recovery mode."); 6456 6475 log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname); 6457 if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {6458 log_to_screen("Uh, that hasn't been implemented yet.");6459 paranoid_MR_finish(1);6460 }6461 6476 6462 6477 iamhere("About to call load_mountlist and load_raidtab"); … … 6468 6483 ("Returned from calling load_mountlist and load_raidtab successfully"); 6469 6484 6470 if (argc > 1 6471 && (strcmp(argv[1], "--compare") == 0 6472 || strcmp(argv[1], "--nuke") == 0)) { 6485 // BCO:To be reviewed 6486 if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) { 6473 6487 if (bkpinfo->backup_media_type == nfs 6474 6488 && !is_this_device_mounted(bkpinfo->nfs_mount)) { … … 6482 6496 } 6483 6497 6484 6485 6498 if (retval) { 6486 6499 log_to_screen … … 6488 6501 } 6489 6502 6490 6491 6503 log_msg(1, "Send in the clowns."); 6492 6504 6493 if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) { 6494 log_msg(0, "Partitioning only."); 6495 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 6496 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 6497 load_mountlist(mountlist, g_mountlist_fname); 6498 res = partition_everything(mountlist); 6499 finish(res); 6500 } 6501 6502 if (argc == 2 && strcmp(argv[1], "--format-only") == 0) { 6503 log_msg(0, "Formatting only."); 6504 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 6505 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 6506 load_mountlist(mountlist, g_mountlist_fname); 6507 res = format_everything(mountlist, FALSE, raidlist); 6508 finish(res); 6509 } 6510 6511 if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) { 6512 log_msg(0, "Stopping LVM and RAID"); 6513 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 6514 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 6515 load_mountlist(mountlist, g_mountlist_fname); 6516 res = do_my_funky_lvm_stuff(TRUE, FALSE); 6517 res += stop_all_raid_devices(mountlist); 6518 finish(res); 6519 } 6520 6521 if (argc == 2 && strcmp(argv[1], "--nuke") == 0) { 6505 6506 if (bkpinfo->restore_mode == nuke) { 6522 6507 iamhere("nuking"); 6523 6508 retval += nuke_mode(mountlist, raidlist); 6524 } else if ( argc == 2 && strcmp(argv[1], "--interactive") == 0) {6509 } else if (bkpinfo->restore_mode == interactive) { 6525 6510 iamhere("catchall"); 6526 6511 retval += catchall_mode(mountlist, raidlist); 6527 } else if ( argc == 2 && strcmp(argv[1], "--compare") == 0) {6512 } else if (bkpinfo->restore_mode == compare) { 6528 6513 iamhere("compare"); 6529 6514 retval += compare_mode(mountlist, raidlist); 6530 } else if ( argc == 2 && strcmp(argv[1], "--iso") == 0) {6515 } else if (bkpinfo->restore_mode == isoonly) { 6531 6516 iamhere("iso"); 6532 6517 retval = iso_mode(mountlist, raidlist, FALSE); 6533 } else if ( argc == 2 && strcmp(argv[1], "--mbr") == 0) {6518 } else if (bkpinfo->restore_mode == mbr) { 6534 6519 iamhere("mbr"); 6535 6520 retval = mount_all_devices(mountlist, TRUE); … … 6541 6526 log_to_screen("Failed to write Master Boot Record"); 6542 6527 } 6543 } else if ( argc == 2 && strcmp(argv[1], "--isonuke") == 0) {6528 } else if (bkpinfo->restore_mode == isonuke) { 6544 6529 iamhere("isonuke"); 6545 6530 retval = iso_mode(mountlist, raidlist, TRUE); 6546 } else if (argc != 1) {6547 log_to_screen("Invalid paremeters");6548 paranoid_MR_finish(1);6549 6531 } else { 6550 6532 iamhere("catchall (no mode specified in command-line call"); -
branches/stable/mondo/src/mondorestore/mondorestore.h
r1663 r1977 9 9 */ 10 10 char *MONDO_LOGFILE = "/var/log/mondorestore.log"; 11 char *MONDO_OPTIONS = "E:GI:J:K:QRT:UVZ:b:d:ef:gimn:op:tux:z"; 11 12 12 13 /* Busybox ps has no option and PID in first pos */
Note:
See TracChangeset
for help on using the changeset viewer.