Changeset 2546 in MondoRescue
- Timestamp:
- Jan 21, 2010, 8:50:00 PM (15 years ago)
- Location:
- branches/2.2.10
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/README.bootparam
r2484 r2546 26 26 donteject 27 27 mondorestore will not eject the CD; this is useful if, for instance, your PC's case has a concealed CD-ROM drive 28 29 excludedevs="dev1 dev2" 30 Exclude those evices from retoration process (no LVM action done suc has pvcreate, and no partitioning. Those devices are removed from /tmp/mountlist.txt and /tmp/i-want-my-lvm) 28 31 29 32 forcemods="mod1 mod2" … … 58 61 59 62 pre=/path/to/script 60 Execute a pre-configuration script before calling mondorestore. Could be an NFS shared script e.g., or a script located in the initrd. 63 Execute a pre-configuration script before calling mondorestore. Could be an NFS shared script e.g., or a script located in the initrd. Eg: pre=/tmp/isodir/my-pre.sh. Note that the script should be executable. 61 64 62 65 post=/path/to/script 63 Execute a final script before rebooting the machine at the end of the restoration. Could be an NFS shared script e.g., or a script located on the restored disk or in the initrd. 66 Execute a final script before rebooting the machine at the end of the restoration. Could be an NFS shared script e.g., or a script located on the restored disk or in the initrd. Eg: post=/tmp/isodir/my-post.sh. Note that the script should be executable. 64 67 65 68 serial=/dev/ttySx -
branches/2.2.10/mindi/analyze-my-lvm
r2428 r2546 51 51 fi 52 52 fi 53 echo "# $LVMCMD lvcreate$params -n $logical_volume $volume_group" 53 # Do not process LV whose VG are excluded 54 if [ -f $MINDI_TMP/excludedvgs ]; then 55 if [ "`grep $volume_group $MINDI_TMP/excludedvgs`" = "" ]; then 56 echo "# $LVMCMD lvcreate$params -n $logical_volume $volume_group" 57 fi 58 fi 59 rm -f $MINDI_TMP/excludedvgs 54 60 } 55 61 … … 131 137 fi 132 138 139 rm -f $MINDI_TMP/excludedvgs 140 if [ "$EXCLUDE_DEVS" ] ; then 141 for ed in $EXCLUDE_DEVS ; do 142 if [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then 143 echo $current_VG >> $MINDI_TMP/excludedvgs 144 return 145 fi 146 done 147 fi 133 148 echo "# $LVMCMD vgcreate $current_VG$VG_params $list_of_devices" 134 149 echo "# $LVMCMD vgchange -a y $current_VG" … … 143 158 pvscan 2> /dev/null | grep '"' | cut -d'"' -f2 > $MINDI_TMP/pv.tmp 144 159 fi 160 161 rm -f $MINDI_TMP/pv.tmp2 162 for d in `cat $MINDI_TMP/pv.tmp`; do 163 # Skip devices excluded, coming from mondoarchive 164 skip=0 165 if [ "$EXCLUDE_DEVS" ] ; then 166 for ed in $EXCLUDE_DEVS ; do 167 if [ "`echo " $d " | grep " $ed"`" != "" ]; then 168 skip=1 169 continue 170 fi 171 done 172 fi 173 if [ $skip -eq 1 ]; then 174 continue 175 fi 176 echo $d >> $MINDI_TMP/pv.tmp2 177 done 178 145 179 if [ -f /etc/multipath.conf ]; then 146 180 # If multipath check which type of devidec are given, mpath prefered 147 for d in `cat $MINDI_TMP/pv.tmp`; do 181 for d in `cat $MINDI_TMP/pv.tmp2`; do 182 skip=0 183 if [ "$EXCLUDE_DEVS" ] ; then 184 for ed in $EXCLUDE_DEVS ; do 185 if [ "`echo " $d " | grep " $ed"`" != "" ]; then 186 skip=1 187 continue 188 fi 189 done 190 fi 191 if [ $skip -eq 1 ]; then 192 continue 193 fi 148 194 GiveMapperOfdm $d 149 195 done 150 196 else 151 cat $MINDI_TMP/pv.tmp 152 fi 153 rm -f $MINDI_TMP/pv.tmp 197 cat $MINDI_TMP/pv.tmp2 198 fi 199 rm -f $MINDI_TMP/pv.tmp $MINDI_TMP/pv.tmp2 154 200 } 155 201 … … 177 223 178 224 ListLvmDrivesAndPartitions() { 225 # We get partitions in this loop not devices 179 226 for d in `$LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}'`; do 180 # Skip devices excluded, coming from mondoarchive 181 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep " $d "`" ]; then 182 continue 183 fi 184 # If multipath check which type of devides are given, mpath prefered 227 # If multipath check which type of devices are given, mpath prefered 185 228 if [ -f /etc/multipath.conf ]; then 186 GiveMapperOfdm $d 229 i=`GiveMapperOfdm $d` 230 rep=$i 187 231 else 188 echo $d 189 fi 232 rep=$d 233 fi 234 skip=0 235 if [ "$EXCLUDE_DEVS" ] ; then 236 for ed in $EXCLUDE_DEVS ; do 237 if [ "`echo " $rep " | grep " $ed"`" != "" ]; then 238 skip=1 239 continue 240 fi 241 done 242 fi 243 if [ $skip -eq 1 ]; then 244 continue 245 fi 246 echo $rep 190 247 done 191 248 } -
branches/2.2.10/mindi/mindi
r2514 r2546 959 959 LVM="false" 960 960 fi 961 # Excluded LVs and GVs are not reported here 961 962 all_partitions=`cat $MINDI_TMP/lvm.res | grep -F ">>>" | cut -d' ' -f2-` 962 963 fi 963 964 all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`" 964 # echo "all partitions = $all_partitions" > /dev/stderr965 965 for i in $IMAGE_DEVS ; do 966 966 mount | grep -F "$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted." … … 1234 1234 fi 1235 1235 fi 1236 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then 1237 LogFile "Excluding $current_partition from mountlist" 1238 continue 1236 skip=0 1237 if [ "$EXCLUDE_DEVS" ] ; then 1238 for d in $EXCLUDE_DEVS ; do 1239 if [ "`echo " $current_partition " | grep " $d"`" != "" ]; then 1240 LogFile "Excluding $current_partition from mountlist (due to excluded device $d)" 1241 skip=1 1242 continue 1243 fi 1244 done 1245 fi 1246 if [ $skip -eq 1 ]; then 1247 continue 1239 1248 fi 1240 1249 if [ ! "$partition_mountpt" ] ; then … … 1292 1301 local file=$1 1293 1302 # Coherency verification 1294 ML0=`cat $file | wc -l` 1303 ML01=`cat $file | wc -l` 1304 ML02=`cat $file | grep -v ' lvm ' | wc -l` 1295 1305 ML1=`$AWK '{print $1}' $file | sort -u | wc -l` 1296 ML2=`$AWK '{print $2}' $file | sort -u | wc -l`1297 if [ "$ML0 " -ne "$ML1" ]; then1306 ML2=`$AWK '{print $2}' $file | grep -v ' lvm ' | sort -u | wc -l` 1307 if [ "$ML01" -ne "$ML1" ]; then 1298 1308 LogFile "--------------------------------------------" 1299 1309 echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE 1300 1310 LogFile "--------------------------------------------" 1301 1311 fi 1302 if [ "$ML0 " -ne "$ML2" ]; then1312 if [ "$ML02" -ne "$ML2" ]; then 1303 1313 LogFile "--------------------------------------------" 1304 1314 echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE -
branches/2.2.10/mindi/rootfs/sbin/init
r2508 r2546 391 391 vgscan 392 392 fi 393 394 # Exclude devices we may not want 395 rm -f /tmp/restorevgs 396 for d in $EXCLUDE_DEVS ; do 397 echo " == $d" 398 EXCLUDE_VGS=`grep " $d" /tmp/i-want-my-lvm | grep vgcreate | awk '{print $4}'` 399 vg=`echo $EXCLUDE_VGS | sed "s/ /|/g"` 400 if [ "$vg" != "" ]; then 401 re=" $d|$vg" 402 else 403 re=" $d" 404 fi 405 # Remove VGs from i-want-my-lvm 406 grep -Ev "$re" /tmp/i-want-my-lvm > /tmp/i-want-my-lvm.new 407 mv /tmp/i-want-my-lvm.new /tmp/i-want-my-lvm 408 # Prepare script to restore the VG exluded here if needed 409 for v in $EXCLUDE_VGS; do 410 echo "vgcfgrestore $v" >> /tmp/restorevgs 411 # Remove LVs from mountlist 412 EXCLUDE_LVS=`grep " $v" /tmp/i-want-my-lvm | grep lvcreate | sed "s/^.*-n \([^ ][^ ]*\) .*$/$1/"` 413 for l in $EXCLUDE_LVS; do 414 # FIXME: Should search for all possible device names here 415 grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new 416 grep -Ev "/dev/mapper/${v}-v$l" /tmp/mountlist.txt.new > /tmp/mountlist.txt 417 done 418 done 419 done 420 393 421 grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm 394 422 chmod +x /tmp/start-lvm … … 685 713 export FORCE_MODS=" " 686 714 fi 715 if [ "`grep -i excludedevs /proc/cmdline`" ]; then 716 export EXCLUDE_DEVS="`cat /proc/cmdline | sed 's~.*excludedevs=\"\(.*\)\".*~\1~'` mondonone" 717 else 718 export EXCLUDE_DEVS=" " 719 fi 687 720 688 721 echo "Activating a potential USB keyboard/mouse" … … 831 864 # start-netfs moved it under /tmp as the NFS share is already unmounted 832 865 if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then 833 p ost=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`866 pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'` 834 867 fi 835 868 if [ -x $pre ]; then -
branches/2.2.10/mondo-doc/mondoarchive.8
r2508 r2546 25 25 26 26 .SH SYNOPSIS 27 .B mondoarchive -O27 .B mondoarchive \-O 28 28 [ 29 29 .I options 30 30 ] : backup your PC 31 31 .br 32 .B mondoarchive -V32 .B mondoarchive \-V 33 33 [ 34 34 .I options … … 41 41 non-Linux filesystems to CD's, tape, ISO images or an NFS mount. In the event of 42 42 catastrophic data loss, you will be able to restore everything, taking a PC from 43 bare metal to its original state if necessary. 43 bare metal to its original state if necessary. 44 44 45 45 .PP … … 60 60 61 61 .PP 62 Call mondoarchive 62 Call mondoarchive 63 63 .BR without 64 .BR flags 64 .BR flags 65 65 to make it auto-detect as many settings as possible, ask you politely for the 66 66 rest, and then backup and verify your OS or a subset thereof. 67 67 68 68 .PP 69 To restore data, either run 69 To restore data, either run 70 70 .I mondorestore 71 71 from the command line or boot from the emergency media generated during … … 78 78 79 79 .TP 80 .BI " -c " speed80 .BI "\-c " speed 81 81 Use CD-R drive as backup device and its (write-once) disks as backup media. 82 82 83 83 .TP 84 .BI " -w " speed84 .BI "\-w " speed 85 85 Use CD-RW drive as backup device and its (write/rewrite) disks as backup media. 86 86 Mondo will wipe media before writing to them. 87 87 88 88 .TP 89 .BI " -r "89 .BI "\-r " 90 90 Use DVD drive as backup device and its disks as backup media. Growisofs decides 91 91 on the best speed for your drive. Note that calling mondoarchive 92 92 .B using sudo when writing to DVDs will fail 93 because growisofs does not support this - see the growisofs manpage for93 because growisofs does not support this \- see the growisofs manpage for 94 94 details. 95 95 96 96 .TP 97 .BI " -C " speed97 .BI "\-C " speed 98 98 Use CD-R drive as a streaming device, almost like a tape streamer. Use 99 99 write-once disks as backup media. … … 101 101 102 102 .TP 103 .BI " -p " prefix104 Use 105 .B prefix 103 .BI "\-p " prefix 104 Use 105 .B prefix 106 106 to generate the name of your ISO images. 107 107 By default, mondoarchive names images mondorescue-1.iso, mondorescue-2.iso, ... 108 Using 109 .B -p machine108 Using 109 .B \-p machine 110 110 will name your images machine-1.iso, machine-2.iso, ... 111 111 112 112 .TP 113 .BI " -i "113 .BI "\-i " 114 114 Use ISO files (CD images) as backup media. This is good for backing up your 115 115 system to a spare hard drive. The … … 118 118 119 119 .TP 120 .BI " -n " mount120 .BI "\-n " mount 121 121 Use files residing on a remote share as backup media. 122 122 .I mount … … 130 130 131 131 .TP 132 .BI " -t "132 .BI "\-t " 133 133 Use tape streamer as backup device and its tapes as backup media. 134 134 135 135 .TP 136 .BI " -U "136 .BI "\-U " 137 137 Use a generic USB device as backup device. Use this if you want to write 138 your backup to a USB key or USB disk, which will be make bootable. 138 your backup to a USB key or USB disk, which will be make bootable. 139 139 The USB device should be attached to the system in order for this to work and 140 140 its device name passed to the 141 .BR \-d 141 .BR \-d 142 142 option. Do not use the partition name, but the raw device name (/dev/sda e.g.) 143 143 .B WARNING: All the data on the related device will be removed. 144 144 145 145 .TP 146 .BI " -u "146 .BI "\-u " 147 147 Use a generic streaming device as backup device. Use this if you want to write 148 148 your backup to a device that is not directly support by mondoarchive. This will … … 152 152 .SH MAJOR OPTIONS 153 153 .TP 13 154 .BI " -D "154 .BI "\-D " 155 155 Make a differential backup: examine the filesystem and find which files have 156 156 changed since the last full backup was carried out. Backup only those files. 157 157 158 158 .TP 159 .BI " -E " "\*(lqpath ...\*(rq"159 .BI "\-E " "\*(lqpath ...\*(rq" 160 160 Exclude path(s) from backup. The paths should be separated with a whitespace and surrounded by quotes. 161 161 This is the prefered and recommended option when doing partial archiving. … … 167 167 the mountlist. NB: If you exclude /dev/sdd4 then the /dev entry itself will 168 168 still be backed up, even though the mountlist entry will be suppressed. 169 N.B.: If you specify a directory with a final / its content will be archived so it won't do what you expect. 170 You may also specify full disk device to this option as with -E \*(lq/dev/sda /dev/cciss/c0d0\*(rq 169 N.B.: If you specify a directory with a final / its content will be 170 archived so it won't do what you expect. 171 You may also specify full disk device to this option as with \-E 172 \*(lq/dev/sda /dev/cciss/c0d0\*(rq 171 173 172 174 .TP 173 175 .BI "-I " "\*(lqpath ...\*(rq" 174 Include paths(s) in backup. This option is mainly use to perform tests in order to reduce the time taken by the archiving operation. 175 The default backup path is \*(lq/\*(rq but you may specify alternatives, e.g. -I \*(lq/home /etc\*(rq to override that. 176 You may also specify full disk device to this option as with -I \*(lq/dev/sda /dev/cciss/c0d0\*(rq 176 Include paths(s) in backup. This option is mainly use to perform tests 177 in order to reduce the time taken by the archiving operation. 178 The default backup path is \*(lq/\*(rq but you may specify alternatives, 179 e.g. \-I \*(lq/home /etc\*(rq to override that. 180 You may also specify full disk device to this option as with \-I 181 \*(lq/dev/sda /dev/cciss/c0d0\*(rq 177 182 N.B.: When using the 178 183 .BR \-I 179 option with the 184 option with the 180 185 .BR \-E 181 option, the -E content should be subdirectories of those mentioned in the -I only, as -I takes precedence. 186 option, the \-E content should be subdirectories of those mentioned in 187 the \-I only, as -I takes precedence. 182 188 183 189 .TP 184 190 .BI "-J " "file" 185 191 Specify an explicit list of files and directories to include in a plain text file, one item 186 (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.192 (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. 187 193 188 194 .TP … … 206 212 for processing by an 'expect' wrapper, enabling the user to backup nightly via 207 213 a cron job. However, if you want to run this program with an attractive but 208 non-cron-friendly interface then use ' -g'.214 non-cron-friendly interface then use '\-g'. 209 215 210 216 .TP 211 217 .BI "-k " "path" 212 Path of user's kernel, if you want to use another one than the running one. 218 Path of user's kernel. If you are a Debian (<3.0) or Gentoo (<1.4) user then specify 219 .B \-k FAILSAFE 220 as your kernel. Otherwise, you will rarely need this option. 213 221 214 222 .TP 215 223 .BI "-m " 216 224 Manual (not self-retracting) CD trays are often found on laptops. If you are 217 a laptop user, your CD burner has BurnProof technology or you experience 218 problems with mondo then please call mondoarchive with this switch. 225 a laptop user, your CD burner has BurnProof technology or you experience 226 problems with mondo then please call mondoarchive with this switch. 219 227 220 228 .TP … … 246 254 CD burner using a non-standard command. 247 255 .B -A 248 understands two tokens - _ISO_ and _CD#_ - which will be translated into the256 understands two tokens \- _ISO_ and _CD#_ - which will be translated into the 249 257 ISO's filename and its index number (1, 2, ...) respectively. So, you could use 250 .I -A 'foobackup _ISO_; rm-f _ISO_'258 .I \-A 'foobackup _ISO_; rm \-f _ISO_' 251 259 to feed each ISO to some magical new backup tool. 252 260 … … 254 262 .BI "-B " "command" 255 263 This command will be called before each CD/NFS/ISO file is written. See 256 .B -A264 .B \-A 257 265 for more information. 258 266 … … 279 287 .TP 280 288 .BI "-R " 281 EXPERIMENTAL. Do not use in mission-critical environments. Star is an alternative to afio. Mondo now supports POSIX ACLs and extended attributes, so -R is essentially redundant for now. 289 EXPERIMENTAL. Do not use in mission-critical environments. Star is an 290 alternative to afio. Mondo now supports POSIX ACLs and extended 291 attributes, so \-R is essentially redundant for now. 282 292 283 293 .TP 284 294 .BI "-P " "tarball" 285 295 Post-nuke tarball. If you boot into Nuke Mode and everything is restored 286 successfully then the 296 successfully then the 287 297 .I post-nuke 288 298 script will be sought and executed if found. This is useful for post-restore … … 290 300 just the 291 301 .I post-nuke 292 script (or binary, or whatever it is) but also any files it requires. 302 script (or binary, or whatever it is) but also any files it requires. 293 303 294 304 .TP 295 305 .BI "-S " "path" 296 Specify the full pathname of the scratchdir, the directory where ISO images are built before being297 archived. If you have plenty of RAM and want to use a ramdisk for scratch 298 space, specify its path here.306 Specify the full pathname of the scratchdir, the directory where ISO 307 images are built before being archived. If you have plenty of RAM and 308 want to use a ramdisk for scratch space, specify its path here. 299 309 300 310 .TP 301 311 .BI "-T " "path" 302 Specify the full pathname of the tempdir, the directory where temporary files (other than ISO images303 being assembled) are stored. See304 .B -S312 Specify the full pathname of the tempdir, the directory where temporary 313 files (other than ISO images being assembled) are stored. See 314 .B \-S 305 315 306 316 .TP … … 309 319 this unless you have really great boot disks in your hand and you are an anally 310 320 retentive SOB who can't wait 2 minutes for Mindi to run in the background. If 311 you use -W then you'd better know what the hell you're doing, okay?321 you use \-W then you'd better know what the hell you're doing, okay? 312 322 313 323 .TP … … 332 342 the boot loader can usually be discovered. If you specify RAW then the MBR will 333 343 be backed up and restored byte-for-byte without any analysis. It is likely that 334 you will also need to specify the boot device with -f <dev>. ELILO is mandatory344 you will also need to specify the boot device with \-f <dev>. ELILO is mandatory 335 345 for IA64 machines. 336 346 … … 345 355 .TP 346 356 .BI "-z " 347 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. 357 Use extended attributes and acl for each file and store them in the 358 backup media. Use this option if you use SElinux e.g. but it will slow 359 down backup and restore time of course. 348 360 349 361 350 362 .SH DIAGNOSTICS 351 363 Mondo generates one additional, and extremely important file: 352 .BI /var/log/mondoarchive.log. 353 When seeking technical support, attach this file to your email. 354 364 .BI /var/log/mondoarchive.log. 365 When seeking technical support, attach this file to your email. 355 366 356 367 … … 361 372 support questions. 362 373 374 363 375 .SH NOTES 364 A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren, Cafeole, Randy Delphs,365 Stan Benoit, and Hugo Rabson) may be found at376 A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren, 377 Cafeole, Randy Delphs, Stan Benoit, and Hugo Rabson) may be found at 366 378 .I http://www.mondorescue.org/docs.shtml 367 - or in 379 \- or in 368 380 .I /usr/share/doc/mondo-x.xx 369 381 on your hard drive. … … 372 384 It is recommend that your system has more than 64 MB ram. SCSI device order 373 385 change with nuke can have unexpected results. It is recommended you use expert 374 mode with drastic hardware reconfigurations. 386 mode with drastic hardware reconfigurations. 375 387 376 388 .SH EXAMPLES … … 378 390 .BI ISO: 379 391 Backup to a directory; note that /mnt/foo's contents will be backed up except 380 for its ISO's unless you exclude it, as follows: -392 for its ISO's unless you exclude it, as follows: 381 393 .br 382 394 .I "mondoarchive -Oi -d /mnt/foo -E '/mnt/foo /mnt/foo2' -p \`hostname\`-\`date +%Y-%m-%d\`" … … 440 452 Backup PC to a Software Raid mount point, iso size 700mb: 441 453 .br 442 .I "mondoarchive -O -s 700m -d /mnt/raid" 454 .I "mondoarchive -O -s 700m -d /mnt/raid" 443 455 444 456 … … 446 458 afio(1), bzip2(1), find(1), mindi(8), mondorestore(8). 447 459 .SH AUTHORS 448 Bruno Cornec (lead-development) 460 Bruno Cornec (lead-development) 449 461 .I "bruno_at_mondorescue.org" 450 462 .br 451 Andree Leidenfrost (co-developer) 463 Andree Leidenfrost (co-developer) 452 464 .I "aleidenf_at_bigpond.net.au" 453 465 .br … … 466 478 .br 467 479 See mailing list at http://www.mondorescue.org for technical support. 468 . -
branches/2.2.10/mondo-doc/mondorescue-howto.sgml
r2508 r2546 1970 1970 do well to read up on the partition layout and the use of fdisk, it 1971 1971 gives you some pointers on how to best lay out partitions. 1972 You can find a good guide at 1973 <ulink url="http://www.tldp.org/HOWTO/Partition/index.html"> http://www.tldp.org/HOWTO/Partition/index.html</ulink>1972 You can find a good guide at the 1973 <ulink url="http://www.tldp.org/HOWTO/Partition/index.html">Partition HOWTO</ulink> 1974 1974 </para> 1975 1975 <para>If you want to restore a subset of the backup then:</para> … … 2041 2041 do well to read up on the partition layout and the use of fdisk, it 2042 2042 gives you some could pointers on how to best lay out partitions. 2043 You can find good a guide at 2044 <ulink url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/Partition/index.html">http://www.ibiblio.o 2045 rg/pub/Linux/docs/HOWTO/mini/Partition/index.html</ulink></para> 2043 You can find good a guide at the 2044 <ulink url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/Partition/index.html">Partition HOWTO</ulink></para> 2046 2045 <para>To restore manually, please:</para> 2047 2046 <itemizedlist> -
branches/2.2.10/mondo-doc/mondorestore.8
r2382 r2546 25 25 26 26 .SH SYNOPSIS 27 .B mondorestore [ -p prefix][-K loglevel][-i][-U]...27 .B mondorestore [\-p prefix][\-K loglevel][\-i][\-U]... 28 28 : restore your PC 29 29 … … 31 31 .PP 32 32 .I mondorestore 33 restores data previously backed up with 33 restores data previously backed up with 34 34 .I mondoarchive. 35 35 36 36 . 37 Note that mondorestore will usually automatically be called when booting a 37 Note that mondorestore will usually automatically be called when booting a 38 38 MondoRescue medium. The only exception is booting a MondoRescue medium in 39 39 .B Expert … … 42 42 .TP 43 43 .BI "-p " prefix 44 Use 45 .B prefix 44 Use 45 .B prefix 46 46 to specify the name of your ISO images. 47 47 By default, mondorestore names images mondorescue-1.iso, mondorescue-2.iso, ... 48 Using 49 .B -p machine48 Using 49 .B \-p machine 50 50 .B mondorestore 51 51 will use images named machine-1.iso, machine-2.iso, ... … … 55 55 Use ISO files (CD images) as restore media. This is good when having backed up your 56 56 system to a spare hard drive. The 57 .B -n57 .B \-n 58 58 switch is a wiser choice if you plan to restore from a remote filesystem. 59 59 … … 75 75 The USB device should be attached to the system in order for this to work and 76 76 its device name passed to the 77 .BR \-d 77 .BR \-d 78 78 option. 79 79 … … 88 88 .BI "-E " "\*(lqpath ...\*(rq" 89 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 you91 do not want to restore some content, exclude it with that switch.90 /mnt/cdrom, /proc, /sys, /tmp). For example, if you are restoring up 91 from an NFS mount but you do not want to restore some content, exclude it with that switch. 92 92 93 93 .TP 94 94 .BI "-I " "\*(lqpath ...\*(rq" 95 Include paths(s) to restore (future dev). 95 Include paths(s) to restore (future dev). 96 96 97 97 .TP 98 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. 99 Specify an explicit list of files and directories to restore in a plain 100 text file, one item (file or directory) per line. Beware that 101 directories placed in that file are not managed recursively contrary to 102 what is done with the \-I option. 101 103 102 104 .TP … … 117 119 .BI "-m " 118 120 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 a laptop user, your CD burner has BurnProof technology or you experience 122 problems with mondo then please call mondorestore with this switch. 121 123 122 124 .TP … … 132 134 .TP 133 135 .BI "-T " "path" 134 Specify the full pathname of the tempdir, the directory where temporary files 135 are stored. 136 Specify the full pathname of the tempdir, the directory where temporary files 137 are stored. 136 138 137 139 .TP … … 144 146 .TP 145 147 .BI "-e " 146 Don't eject the CD or tape when restoring... 148 Don't eject the CD or tape when restoring... 147 149 148 150 .TP … … 161 163 .TP 162 164 .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. 165 Use extended attributes and acl for each file and store them in the 166 backup media. Use this option if you use SElinux e.g. but it will slow 167 down backup and restore time of course. 164 168 165 169 .TP 166 170 .BI "-Z " 167 171 Specify mondorestore mode. Mode could be one of 168 .IR nuke: 172 .IR nuke: 169 173 This mode restore everything like on the original system with no/minimal questions 170 .IR interactive: 174 .IR interactive: 171 175 This mode asks all the questions to the user 172 .IR compare: 176 .IR compare: 173 177 This mode just compares the system with the backup 174 .IR iso: 178 .IR iso: 175 179 This mode restores from iso images, instead of real media 176 .IR isonuke: 180 .IR isonuke: 177 181 This mode restores from iso images, instead of real media, with no/minimal questions 178 .IR mbr: 182 .IR mbr: 179 183 This mode just restores the MBR (Master Boot Record) 180 184 … … 182 186 .SH DIAGNOSTICS 183 187 mondorestore generates an Extremely important file: 184 .BI /var/log/mondorestore.log. 185 When seeking technical support, attach this file to your email. 188 .BI /var/log/mondorestore.log. 189 When seeking technical support, attach this file to your email. 186 190 187 191 .SH FILES 188 192 .IR /var/log/mondorestore.log 189 This log contains important information required to analyse mondorestore problem 190 reports. Mondo support highly recommends sending this file with support 191 questions. It's located under /tmp during the restore process and moved under /var/log at the end. 193 This log contains important information required to analyse mondorestore 194 problem reports. Mondo support highly recommends sending this file with 195 support questions. It's located under /tmp during the restore process 196 and moved under /var/log at the end. 192 197 193 198 .SH NOTES 194 A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren, Cafeole, Randy Delphs,195 Stan Benoit, and Hugo Rabson) may be found at199 A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren, 200 Cafeole, Randy Delphs, Stan Benoit, and Hugo Rabson) may be found at 196 201 .I http://www.mondorescue.org/docs.shtml 197 - or in 202 \- or in 198 203 .I /usr/share/doc/mondo-x.xx 199 204 on your hard drive. … … 202 207 It is recommend that your system has more than 64 MB ram. SCSI device order 203 208 change with nuke can have unexpected results. It is recommended you use expert 204 mode with drastic hardware reconfigurations. 209 mode with drastic hardware reconfigurations. 205 210 206 211 .SH "SEE ALSO" 207 212 afio(1), bzip2(1), find(1), mindi(8), mondoarchive(8). 208 213 .SH AUTHORS 209 Bruno Cornec (lead-development) 214 Bruno Cornec (lead-development) 210 215 .I "bruno_at_mondorescue.org" 211 216 .br 212 Andree Leidenfrost (co-developer) 217 Andree Leidenfrost (co-developer) 213 218 .I "aleidenf_at_bigpond.net.au" 214 219 .br … … 227 232 .br 228 233 See mailing list at http://www.mondorescue.org for technical support. 229 . -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2508 r2546 1592 1592 ********/ 1593 1593 if (strncmp(dsf, "/dev/", 5)) { 1594 log_msg ( 5, "%s does not start with /dev/ and (probably) is not a device special file", dsf);1594 log_msg (4, "%s does not start with /dev/ and (probably) is not a device special file", dsf); 1595 1595 return (-1); 1596 1596 } 1597 log_msg( 5, " %s looks like a device special file", dsf);1597 log_msg(4, " %s looks like a device special file", dsf); 1598 1598 /* Verify that the dsf exists */ 1599 1599 mr_asprintf(command, "ls -al %s 2>/dev/null | wc -l", dsf); … … 1610 1610 return (1); 1611 1611 } 1612 log_msg( 5, " %s device special file exists", dsf);1612 log_msg(4, " %s device special file exists", dsf); 1613 1613 1614 1614 /* Get a list of the mounted file systems */ … … 1624 1624 ********/ 1625 1625 mr_asprintf(command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf); 1626 log_msg( 4, "Executing: %s", command);1626 log_msg(5, "Executing: %s", command); 1627 1627 partition_list = call_program_and_get_last_line_of_output(command); 1628 1628 mr_free(command); … … 1642 1642 lastpos = 0; 1643 1643 while ((token = mr_strtok(partition_list, token_chars, &lastpos)) != NULL) { 1644 log_msg ( 5, "Found partition: %s", token);1644 log_msg (4, "Found partition: %s", token); 1645 1645 partitions[i++] = token; 1646 1646 } … … 1648 1648 } 1649 1649 mr_free(partition_list); 1650 1650 1651 /* In any case we want to exclude the dsf itself from all MondRescue activities 1652 * at restore time (LVM, fdisk, ...) so we want it in our exclude_dev list */ 1653 if ((DSFptr = (MOUNTED_FS_STRUCT *) calloc(1, sizeof(MOUNTED_FS_STRUCT))) == NULL) { 1654 fatal_error ("Cannot allocate memory"); 1655 } 1656 add_mounted_fs_struct(DSFptr); 1657 strcpy(DSFptr->device, dsf); 1658 DSFptr->check = 1; 1659 1651 1660 /* For the rest ndsf is the new dsf to deal with */ 1652 1661 /******** … … 1683 1692 /* See if it's swap. If it is, ignore it. */ 1684 1693 mr_asprintf(command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", ndsf, partitions[i]); 1685 log_msg( 4, " Running: %s", command);1694 log_msg(5, " Running: %s", command); 1686 1695 tmp = call_program_and_get_last_line_of_output(command); 1687 1696 mr_free(command); 1688 1697 1689 log_msg( 4, " Return value: %s", tmp);1698 log_msg(5, " Return value: %s", tmp); 1690 1699 c = strlen(tmp); 1691 1700 mr_free(tmp); … … 1717 1726 log_msg(4, " It's not mounted. Checking to see if it's LVM..."); 1718 1727 1719 /* Get the partition ID; 8efor LVM */1720 mr_asprintf(command, "p arted2fdisk -l %s |awk '{if($1 ~ \"^%s\"){print $5}}'", ndsf, partitions[i]);1721 log_msg( 4, " Running: %s", command);1728 /* Check for LVM */ 1729 mr_asprintf(command, "pvdisplay -c %s | grep '%s:' 2> /dev/null", partitions[i], partitions[i]); 1730 log_msg(5, " Running: %s", command); 1722 1731 tmp = call_program_and_get_last_line_of_output(command); 1723 1732 mr_free(command); 1724 1733 1725 1734 if (strlen(tmp)) { 1726 log_msg(4, " Partition ID: %s", tmp); 1727 if (!strcasecmp(tmp, "8e")) { 1728 /* It's LVM: Find the VG it's in */ 1729 log_msg(4, " It's LVM: Find the VG it's in..."); 1730 mr_asprintf(command, "pvdisplay -v %s 2>/dev/null|grep \"VG Name\"|awk '{print $NF}'", partitions[i]); 1731 log_msg(4, " Running: %s", command); 1732 VG = call_program_and_get_last_line_of_output(command); 1735 log_msg(4, "Found an LVM partition at %s. Find the VG it's in...", partitions[i]); 1736 /* It's LVM: Find the VG it's in */ 1737 mr_asprintf(command, "pvdisplay -v %s 2>/dev/null|grep \"VG Name\"|awk '{print $NF}'", partitions[i]); 1738 log_msg(5, " Running: %s", command); 1739 strcpy(VG, call_program_and_get_last_line_of_output(command)); 1740 mr_free(command); 1741 1742 log_msg(4, " Volume Group: %s", VG); 1743 if (strlen(VG)) { 1744 /* Found the Volume Group. Now find all of the VG's mount points */ 1745 log_msg(4, " Found the Volume Group. Now find all of the VG's mount points"); 1746 mr_asprintf(command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG); 1747 log_msg(5, " Running: %s", command); 1748 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command)); 1733 1749 mr_free(command); 1734 1750 1735 log_msg(4, " Volume Group: %s", VG); 1736 if (strlen(VG)) { 1737 /* Found the Volume Group. Now find all of the VG's mount points */ 1738 log_msg(4, " Found the Volume Group. Now find all of the VG's mount points"); 1739 mr_asprintf(command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG); 1740 log_msg(4, " Running: %s", command); 1741 mount_list = call_program_and_get_last_line_of_output(command); 1751 log_msg(4, " VG %s mount_list: %s", VG, mount_list); 1752 lastpos = 0; 1753 while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) { 1754 log_msg (5, "mount point token: %s", token); 1755 if ((DSFptr = find_mount_point_in_list(token)) == NULL) { 1756 log_msg (4, "Can't find mount point %s in mounted file systems list", token); 1757 mr_free(tmp); 1758 mr_free(token); 1759 return (1); 1760 } 1761 DSFptr->check = 1; 1762 mr_free(token); 1763 } 1764 /******** 1765 * Now we want to see if there are any software raid devices using 1766 * any of the Logical Volumes on the Volume Group. 1767 *******/ 1768 mr_free(mount_list); 1769 1770 mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 1771 log_msg (5, "Running: %s", command); 1772 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command)); 1773 mr_free(command); 1774 1775 log_msg(4, " Software raid device list: %s", mount_list); 1776 lastpos = 0; 1777 while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) { 1778 mr_asprintf(command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 1779 log_msg (5, "Running: %s", command); 1780 mr_free(tmp); 1781 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command)); 1742 1782 mr_free(command); 1743 1783 1744 log_msg(4, " VG %s mount_list: %s", VG, mount_list); 1745 lastpos = 0; 1746 while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) { 1747 log_msg (5, "mount point token: %s", token); 1748 if ((DSFptr = find_mount_point_in_list(token)) == NULL) { 1749 log_msg (4, "Can't find mount point %s in mounted file systems list", token); 1784 log_msg(4, "Number of Software raid device: %s", tmp); 1785 if (atoi(tmp)) { 1786 /* This device is on our disk */ 1787 if ((DSFptr = find_device_in_list(token)) == NULL) { 1788 log_msg (4, "Can't find device %s in mounted file systems list", token); 1750 1789 mr_free(tmp); 1751 1790 mr_free(VG); … … 1754 1793 } 1755 1794 DSFptr->check = 1; 1756 mr_free(token);1757 1795 } 1758 /********1759 * Now we want to see if there are any software raid devices using1760 * any of the Logical Volumes on the Volume Group.1761 *******/1762 mr_free(mount_list);1763 1764 mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");1765 log_msg (5, "Running: %s", command);1766 mount_list = call_program_and_get_last_line_of_output(command);1767 mr_free(command);1768 1769 log_msg(4, " Software raid device list: %s", mount_list);1770 lastpos = 0;1771 while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) {1772 mr_asprintf(command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG);1773 log_msg (5, "Running: %s", command);1774 mr_free(tmp);1775 1776 tmp = call_program_and_get_last_line_of_output(command);1777 mr_free(command);1778 1779 log_msg(4, "Number of Software raid device: %s", tmp);1780 c = atoi(tmp);1781 mr_free(tmp);1782 1783 if (c) {1784 /* This device is on our disk */1785 if ((DSFptr = find_device_in_list(token)) == NULL) {1786 log_msg (4, "Can't find device %s in mounted file systems list", token);1787 mr_free(VG);1788 mr_free(token);1789 return (1);1790 }1791 DSFptr->check = 1;1792 }1793 mr_free(token);1794 }1795 mr_free(token);1796 mr_free(mount_list);1797 } else {1798 log_msg (4, "Error finding Volume Group for partition %s", partitions[i]);1799 mr_free(tmp);1800 return (1);1801 1796 } 1797 mr_free(token); 1798 paranoid_free(mount_list); 1799 } else { 1800 log_msg (4, "Error finding Volume Group for partition %s", partitions[i]); 1802 1801 mr_free(tmp); 1803 mr_free(VG); 1804 continue; 1805 } 1802 return (1); 1803 } 1804 mr_free(tmp); 1805 continue; 1806 1806 } else { 1807 1807 log_msg (4, "Error finding partition type for the partition %s", partitions[i]); … … 1880 1880 while (DSFptr != NULL) { 1881 1881 if (DSFptr->check) { 1882 log_msg ( 5, "%s is mounted on %s and is on disk %s\n", DSFptr->device, DSFptr->mount_point, ndsf);1882 log_msg (4, "%s is mounted on %s and is on disk %s\n", DSFptr->device, DSFptr->mount_point, ndsf); 1883 1883 strcat(*included_dsf_list, DSFptr->mount_point); 1884 1884 strcat(*included_dsf_list, " "); … … 1907 1907 char *not_mounted_on_dsf = NULL; 1908 1908 char token_chars[] =" \t\r\f\a\0\n"; 1909 char *tmp = NULL; 1910 char *tmp1 = NULL; 1909 1911 1910 1912 while ((token = mr_strtok(pathlist, token_chars, &lastpos)) != NULL) { … … 1946 1948 /* A device special file was not passed in. Process it as a path. */ 1947 1949 case -1: 1950 /* we need to add a space after token to be sure our strstr test works correctly */ 1951 mr_asprintf(tmp1,"%s ",token); 1948 1952 if (mode == 'E') { 1949 1953 /* Add the token if not already in the list */ 1950 if (strstr(bkpinfo->exclude_paths,token) == NULL) { 1951 mr_strcat(bkpinfo->exclude_paths, " %s ", token); 1954 mr_asprintf(&tmp,"%s ",bkpinfo->exclude_paths); 1955 if (strstr(tmp,tmp1) == NULL) { 1956 mr_strcat(bkpinfo->exclude_paths, " %s", tmp1); 1952 1957 } 1953 1958 } else { 1954 1959 /* Add the token if not already in the list */ 1955 if (strstr(bkpinfo->include_paths,token) == NULL) { 1956 mr_strcat(bkpinfo->include_paths, " %s ", token); 1957 } 1958 } 1960 mr_asprintf(&tmp,"%s ",bkpinfo->include_paths); 1961 if (strstr(tmp,tmp1) == NULL) { 1962 mr_strcat(bkpinfo->include_paths, " %s", tmp1); 1963 } 1964 } 1965 mr_free(tmp); 1966 mr_free(tmp1); 1959 1967 break; 1960 1968 } -
branches/2.2.10/mondo/src/common/libmondo-fork.c
r2508 r2546 586 586 mr_free(command); 587 587 588 mr_asprintf(command, "ntfsclone -- force --save-image --overwrite %s %s", output_fname, input_device);588 mr_asprintf(command, "ntfsclone --rescue --force --save-image --overwrite %s %s", output_fname, input_device); 589 589 res = run_program_and_log_output(command, 5); 590 590 mr_free(command); … … 703 703 mr_free(command); 704 704 705 mr_asprintf(command, "ntfsclone -- force --restore-image --overwrite %s %s", output_device, input_fifo);705 mr_asprintf(command, "ntfsclone --rescue --force --restore-image --overwrite %s %s", output_device, input_fifo); 706 706 res = run_program_and_log_output(command, 5); 707 707 mr_free(command);
Note:
See TracChangeset
for help on using the changeset viewer.