Changeset 2546 in MondoRescue


Ignore:
Timestamp:
Jan 21, 2010, 8:50:00 PM (14 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 2523:2545 /mondorescue/branches/2.2.9

  • Adds the --rescue flag to ntfsclone (Andree Leidenfrost andree_at_debian.org)
  • Fix 2 typos in the HOWTO (reported by Bram Mertens bram-mertens_at_linux.be)
  • Patch from Rogério Brito rbrito_at_ime.usp.br which fixes errors in man pages format
  • Fix syntax issue in analyze-my-lvm
  • Better doc for pre and post
  • Finally the function ListLvmDrivesAndPartitions is used, as it creates info parsed by mindi !! So reverting back to filter excluded devices in it
  • Better exclusion of the LVs from the mountlist at restore time if excludedevs used
  • Exclude LVs whose VGs are excluded now in analyze-my-lvm
  • First attempt to support device exclusion at restore time through a new boot param excludedevs
  • Fix a bug preventing execution of the pre script in init
  • LVM exclusion based on devices was flawed as the function targeted was not really useful. That script shold be fully rewritten to have a data structure contaiing what is needed. Anyway the current patch should allow to have some improvements
  • Do not report Duplicate mount point when lvm is used
  • each device of the EXCLUDE_DEVS list is now used correctly and partitions found on this device are excluded
  • Fix the way the dsf is declared in the linked list to have it work
  • Fix #383 by using pvdisplay instead of relying on 8e as partition type
  • Try to fix #384 by always excluding the dfs per users wish
  • Also use the exclude dev feature in case of multipath and exclude resulting /dev/mapper/mpath type of files
  • Fix #381 by postfixing spaces at the end of the strings to be cheked in strstr
Location:
branches/2.2.10
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/README.bootparam

    r2484 r2546  
    2626donteject
    2727    mondorestore will not eject the CD; this is useful if, for instance, your PC's case has a concealed CD-ROM drive
     28
     29excludedevs="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)
    2831
    2932forcemods="mod1 mod2"
     
    5861
    5962pre=/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.
    6164
    6265post=/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.
    6467
    6568serial=/dev/ttySx
  • branches/2.2.10/mindi/analyze-my-lvm

    r2428 r2546  
    5151        fi
    5252    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
    5460}
    5561
     
    131137    fi
    132138
     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
    133148    echo "# $LVMCMD vgcreate $current_VG$VG_params $list_of_devices"
    134149    echo "# $LVMCMD vgchange -a y $current_VG"
     
    143158        pvscan 2> /dev/null | grep '"' | cut -d'"' -f2  >  $MINDI_TMP/pv.tmp
    144159    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
    145179    if [ -f /etc/multipath.conf ]; then
    146180        # 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
    148194            GiveMapperOfdm $d
    149195        done
    150196    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
    154200}
    155201
     
    177223
    178224ListLvmDrivesAndPartitions() {
     225    # We get partitions in this loop not devices
    179226    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
    185228        if [ -f /etc/multipath.conf ]; then
    186             GiveMapperOfdm $d
     229            i=`GiveMapperOfdm $d`
     230            rep=$i
    187231        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
    190247    done
    191248}
  • branches/2.2.10/mindi/mindi

    r2514 r2546  
    959959            LVM="false"
    960960        fi
     961        # Excluded LVs and GVs are not reported here
    961962        all_partitions=`cat $MINDI_TMP/lvm.res | grep -F ">>>" | cut -d' ' -f2-`
    962963    fi
    963964    all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`"
    964 #    echo "all partitions = $all_partitions" > /dev/stderr
    965965    for i in $IMAGE_DEVS ; do
    966966        mount | grep -F "$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted."
     
    12341234            fi
    12351235        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
    12391248        fi
    12401249        if [ ! "$partition_mountpt" ] ; then
     
    12921301    local file=$1
    12931302    # Coherency verification
    1294     ML0=`cat $file | wc -l`
     1303    ML01=`cat $file | wc -l`
     1304    ML02=`cat $file | grep -v ' lvm ' | wc -l`
    12951305    ML1=`$AWK '{print $1}' $file | sort -u | wc -l`
    1296     ML2=`$AWK '{print $2}' $file | sort -u | wc -l`
    1297     if [ "$ML0" -ne "$ML1" ]; then
     1306    ML2=`$AWK '{print $2}' $file | grep -v ' lvm ' | sort -u | wc -l`
     1307    if [ "$ML01" -ne "$ML1" ]; then
    12981308        LogFile "--------------------------------------------"
    12991309        echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE
    13001310        LogFile "--------------------------------------------"
    13011311    fi
    1302     if [ "$ML0" -ne "$ML2" ]; then
     1312    if [ "$ML02" -ne "$ML2" ]; then
    13031313        LogFile "--------------------------------------------"
    13041314        echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE
  • branches/2.2.10/mindi/rootfs/sbin/init

    r2508 r2546  
    391391            vgscan
    392392        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
    393421        grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm
    394422        chmod +x /tmp/start-lvm
     
    685713    export FORCE_MODS=" "
    686714fi
     715if [ "`grep -i excludedevs /proc/cmdline`" ]; then
     716    export EXCLUDE_DEVS="`cat /proc/cmdline | sed 's~.*excludedevs=\"\(.*\)\".*~\1~'` mondonone"
     717else
     718    export EXCLUDE_DEVS=" "
     719fi
    687720
    688721echo "Activating a potential USB keyboard/mouse"
     
    831864    # start-netfs moved it under /tmp as the NFS share is already unmounted
    832865    if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    833         post=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
     866        pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
    834867    fi
    835868    if [ -x $pre ]; then
  • branches/2.2.10/mondo-doc/mondoarchive.8

    r2508 r2546  
    2525
    2626.SH SYNOPSIS
    27 .B mondoarchive -O
     27.B mondoarchive \-O
    2828[
    2929.I options
    3030] : backup your PC
    3131.br
    32 .B mondoarchive -V
     32.B mondoarchive \-V
    3333[
    3434.I options
     
    4141non-Linux filesystems to CD's, tape, ISO images or an NFS mount. In the event of
    4242catastrophic data loss, you will be able to restore everything, taking a PC from
    43 bare metal to its original state if necessary. 
     43bare metal to its original state if necessary.
    4444
    4545.PP
     
    6060
    6161.PP
    62 Call mondoarchive 
     62Call mondoarchive
    6363.BR without
    64 .BR flags 
     64.BR flags
    6565to make it auto-detect as many settings as possible, ask you politely for the
    6666rest, and then backup and verify your OS or a subset thereof.
    6767
    6868.PP
    69 To restore data, either run 
     69To restore data, either run
    7070.I mondorestore
    7171from the command line or boot from the emergency media generated during
     
    7878
    7979.TP
    80 .BI "-c " speed
     80.BI "\-c " speed
    8181Use CD-R drive as backup device and its (write-once) disks as backup media.
    8282
    8383.TP
    84 .BI "-w " speed
     84.BI "\-w " speed
    8585Use CD-RW drive as backup device and its (write/rewrite) disks as backup media.
    8686Mondo will wipe media before writing to them.
    8787
    8888.TP
    89 .BI "-r "
     89.BI "\-r "
    9090Use DVD drive as backup device and its disks as backup media. Growisofs decides
    9191on the best speed for your drive. Note that calling mondoarchive
    9292.B using sudo when writing to DVDs will fail
    93 because growisofs does not support this - see the growisofs manpage for
     93because growisofs does not support this \- see the growisofs manpage for
    9494details.
    9595
    9696.TP
    97 .BI "-C " speed
     97.BI "\-C " speed
    9898Use CD-R drive as a streaming device, almost like a tape streamer. Use
    9999write-once disks as backup media.
     
    101101
    102102.TP
    103 .BI "-p " prefix
    104 Use 
    105 .B prefix 
     103.BI "\-p " prefix
     104Use
     105.B prefix
    106106to generate the name of your ISO images.
    107107By default, mondoarchive names images mondorescue-1.iso, mondorescue-2.iso, ...
    108 Using 
    109 .B -p machine
     108Using
     109.B \-p machine
    110110will name your images machine-1.iso, machine-2.iso, ...
    111111
    112112.TP
    113 .BI "-i "
     113.BI "\-i "
    114114Use ISO files (CD images) as backup media. This is good for backing up your
    115115system to a spare hard drive. The
     
    118118
    119119.TP
    120 .BI "-n " mount
     120.BI "\-n " mount
    121121Use files residing on a remote share as backup media.
    122122.I mount
     
    130130
    131131.TP
    132 .BI "-t "
     132.BI "\-t "
    133133Use tape streamer as backup device and its tapes as backup media.
    134134
    135135.TP
    136 .BI "-U "
     136.BI "\-U "
    137137Use 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. 
     138your backup to a USB key or USB disk, which will be make bootable.
    139139The USB device should be attached to the system in order for this to work and
    140140its device name passed to the
    141 .BR \-d 
     141.BR \-d
    142142option. Do not use the partition name, but the raw device name (/dev/sda e.g.)
    143143.B WARNING: All the data on the related device will be removed.
    144144
    145145.TP
    146 .BI "-u "
     146.BI "\-u "
    147147Use a generic streaming device as backup device. Use this if you want to write
    148148your backup to a device that is not directly support by mondoarchive. This will
     
    152152.SH MAJOR OPTIONS
    153153.TP 13
    154 .BI "-D "
     154.BI "\-D "
    155155Make a differential backup: examine the filesystem and find which files have
    156156changed since the last full backup was carried out. Backup only those files.
    157157
    158158.TP
    159 .BI "-E " "\*(lqpath ...\*(rq"
     159.BI "\-E " "\*(lqpath ...\*(rq"
    160160Exclude path(s) from backup. The paths should be separated with a whitespace and surrounded by quotes.
    161161This is the prefered and recommended option when doing partial archiving.
     
    167167the mountlist. NB: If you exclude /dev/sdd4 then the /dev entry itself will
    168168still 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
     169N.B.: If you specify a directory with a final / its content will be
     170archived so it won't do what you expect.
     171You may also specify full disk device to this option as with \-E
     172\*(lq/dev/sda /dev/cciss/c0d0\*(rq
    171173
    172174.TP
    173175.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
     176Include paths(s) in backup. This option is mainly use to perform tests
     177in order to reduce the time taken by the archiving operation.
     178The default backup path is \*(lq/\*(rq but you may specify alternatives,
     179e.g. \-I \*(lq/home /etc\*(rq to override that.
     180You may also specify full disk device to this option as with \-I
     181\*(lq/dev/sda /dev/cciss/c0d0\*(rq
    177182N.B.: When using the
    178183.BR \-I
    179 option with the 
     184option with the
    180185.BR \-E
    181 option, the -E content should be subdirectories of those mentioned in the -I only, as -I takes precedence.
     186option, the \-E content should be subdirectories of those mentioned in
     187the \-I only, as -I takes precedence.
    182188
    183189.TP
    184190.BI "-J " "file"
    185191Specify 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.
    187193
    188194.TP
     
    206212for processing by an 'expect' wrapper, enabling the user to backup nightly via
    207213a cron job. However, if you want to run this program with an attractive but
    208 non-cron-friendly interface then use '-g'.
     214non-cron-friendly interface then use '\-g'.
    209215
    210216.TP
    211217.BI "-k " "path"
    212 Path of user's kernel, if you want to use another one than the running one.
     218Path of user's kernel. If you are a Debian (<3.0) or Gentoo (<1.4) user then specify
     219.B \-k FAILSAFE
     220as your kernel. Otherwise, you will rarely need this option.
    213221
    214222.TP
    215223.BI "-m "
    216224Manual (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. 
     225a laptop user, your CD burner has BurnProof technology or you experience
     226problems with mondo then please call mondoarchive with this switch.
    219227
    220228.TP
     
    246254CD burner using a non-standard command.
    247255.B -A
    248 understands two tokens - _ISO_ and _CD#_ - which will be translated into the
     256understands two tokens \- _ISO_ and _CD#_ - which will be translated into the
    249257ISO'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_'
    251259to feed each ISO to some magical new backup tool.
    252260
     
    254262.BI "-B " "command"
    255263This command will be called before each CD/NFS/ISO file is written. See
    256 .B -A
     264.B \-A
    257265for more information.
    258266
     
    279287.TP
    280288.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.
     289EXPERIMENTAL. Do not use in mission-critical environments. Star is an
     290alternative to afio. Mondo now supports POSIX ACLs and extended
     291attributes, so \-R is essentially redundant for now.
    282292
    283293.TP
    284294.BI "-P " "tarball"
    285295Post-nuke tarball. If you boot into Nuke Mode and everything is restored
    286 successfully then the 
     296successfully then the
    287297.I post-nuke
    288298script will be sought and executed if found. This is useful for post-restore
     
    290300just the
    291301.I post-nuke
    292 script (or binary, or whatever it is) but also any files it requires. 
     302script (or binary, or whatever it is) but also any files it requires.
    293303
    294304.TP
    295305.BI "-S " "path"
    296 Specify the full pathname of the scratchdir, the directory where ISO images are built before being
    297 archived. If you have plenty of RAM and want to use a ramdisk for scratch
    298 space, specify its path here.
     306Specify the full pathname of the scratchdir, the directory where ISO
     307images are built before being archived. If you have plenty of RAM and
     308want to use a ramdisk for scratch space, specify its path here.
    299309
    300310.TP
    301311.BI "-T " "path"
    302 Specify the full pathname of the tempdir, the directory where temporary files (other than ISO images
    303 being assembled) are stored. See
    304 .B -S
     312Specify the full pathname of the tempdir, the directory where temporary
     313files (other than ISO images being assembled) are stored. See
     314.B \-S
    305315
    306316.TP
     
    309319this unless you have really great boot disks in your hand and you are an anally
    310320retentive 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?
     321you use \-W then you'd better know what the hell you're doing, okay?
    312322
    313323.TP
     
    332342the boot loader can usually be discovered. If you specify RAW then the MBR will
    333343be 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 mandatory
     344you will also need to specify the boot device with \-f <dev>. ELILO is mandatory
    335345for IA64 machines.
    336346
     
    345355.TP
    346356.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.
     357Use extended attributes and acl for each file and store them in the
     358backup media. Use this option if you use SElinux e.g. but it will slow
     359down backup and restore time of course.
    348360
    349361
    350362.SH DIAGNOSTICS
    351363Mondo 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.
     365When seeking technical support, attach this file to your email.
    355366
    356367
     
    361372support questions.
    362373
     374
    363375.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 at
     376A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren,
     377Cafeole, Randy Delphs, Stan Benoit, and Hugo Rabson) may be found at
    366378.I http://www.mondorescue.org/docs.shtml
    367 - or in
     379\- or in
    368380.I /usr/share/doc/mondo-x.xx
    369381on your hard drive.
     
    372384It is recommend that your system has more than 64 MB ram. SCSI device order
    373385change with nuke can have unexpected results. It is recommended you use expert
    374 mode with drastic hardware reconfigurations. 
     386mode with drastic hardware reconfigurations.
    375387
    376388.SH EXAMPLES
     
    378390.BI ISO:
    379391Backup 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:-
     392for its ISO's unless you exclude it, as follows:
    381393.br
    382394.I "mondoarchive -Oi -d /mnt/foo -E '/mnt/foo /mnt/foo2' -p \`hostname\`-\`date +%Y-%m-%d\`"
     
    440452Backup PC to a Software Raid mount point, iso size 700mb:
    441453.br
    442 .I "mondoarchive -O -s 700m -d /mnt/raid" 
     454.I "mondoarchive -O -s 700m -d /mnt/raid"
    443455
    444456
     
    446458afio(1), bzip2(1), find(1), mindi(8), mondorestore(8).
    447459.SH AUTHORS
    448 Bruno Cornec (lead-development) 
     460Bruno Cornec (lead-development)
    449461.I "bruno_at_mondorescue.org"
    450462.br
    451 Andree Leidenfrost (co-developer) 
     463Andree Leidenfrost (co-developer)
    452464.I "aleidenf_at_bigpond.net.au"
    453465.br
     
    466478.br
    467479See mailing list at http://www.mondorescue.org for technical support.
    468 .
  • branches/2.2.10/mondo-doc/mondorescue-howto.sgml

    r2508 r2546  
    19701970do well to read up on the partition layout and the use of fdisk, it
    19711971gives 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>
     1972You can find a good guide at the
     1973<ulink url="http://www.tldp.org/HOWTO/Partition/index.html">Partition HOWTO</ulink>
    19741974</para>
    19751975<para>If you want to restore a subset of the backup then:</para>
     
    20412041do well to read up on the partition layout and the use of fdisk, it
    20422042gives 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>
     2043You 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>
    20462045<para>To restore manually, please:</para>
    20472046<itemizedlist>
  • branches/2.2.10/mondo-doc/mondorestore.8

    r2382 r2546  
    2525
    2626.SH SYNOPSIS
    27 .B mondorestore [-p prefix][-K loglevel][-i][-U]...
     27.B mondorestore [\-p prefix][\-K loglevel][\-i][\-U]...
    2828: restore your PC
    2929
     
    3131.PP
    3232.I mondorestore
    33 restores data previously backed up with 
     33restores data previously backed up with
    3434.I mondoarchive.
    3535
    3636.
    37 Note that mondorestore will usually automatically be called when booting a 
     37Note that mondorestore will usually automatically be called when booting a
    3838MondoRescue medium. The only exception is booting a MondoRescue medium in
    3939.B Expert
     
    4242.TP
    4343.BI "-p " prefix
    44 Use 
    45 .B prefix 
     44Use
     45.B prefix
    4646to specify the name of your ISO images.
    4747By default, mondorestore names images mondorescue-1.iso, mondorescue-2.iso, ...
    48 Using 
    49 .B -p machine
     48Using
     49.B \-p machine
    5050.B mondorestore
    5151will use images named machine-1.iso, machine-2.iso, ...
     
    5555Use ISO files (CD images) as restore media. This is good when having backed up your
    5656system to a spare hard drive. The
    57 .B -n
     57.B \-n
    5858switch is a wiser choice if you plan to restore from a remote filesystem.
    5959
     
    7575The USB device should be attached to the system in order for this to work and
    7676its device name passed to the
    77 .BR \-d 
     77.BR \-d
    7878option.
    7979
     
    8888.BI "-E " "\*(lqpath ...\*(rq"
    8989Exclude 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.
     90/mnt/cdrom, /proc, /sys, /tmp). For example, if you are restoring up
     91from an NFS mount but you do not want to restore some content, exclude it with that switch.
    9292
    9393.TP
    9494.BI "-I " "\*(lqpath ...\*(rq"
    95 Include paths(s) to restore (future dev). 
     95Include paths(s) to restore (future dev).
    9696
    9797.TP
    9898.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.
     99Specify an explicit list of files and directories to restore in a plain
     100text file, one item (file or directory) per line. Beware that
     101directories placed in that file are not managed recursively contrary to
     102what is done with the \-I option.
    101103
    102104.TP
     
    117119.BI "-m "
    118120Manual (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. 
     121a laptop user, your CD burner has BurnProof technology or you experience
     122problems with mondo then please call mondorestore with this switch.
    121123
    122124.TP
     
    132134.TP
    133135.BI "-T " "path"
    134 Specify the full pathname of the tempdir, the directory where temporary files 
    135 are stored. 
     136Specify the full pathname of the tempdir, the directory where temporary files
     137are stored.
    136138
    137139.TP
     
    144146.TP
    145147.BI "-e "
    146 Don't eject the CD or tape when restoring... 
     148Don't eject the CD or tape when restoring...
    147149
    148150.TP
     
    161163.TP
    162164.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.
     165Use extended attributes and acl for each file and store them in the
     166backup media. Use this option if you use SElinux e.g. but it will slow
     167down backup and restore time of course.
    164168
    165169.TP
    166170.BI "-Z "
    167171Specify mondorestore mode. Mode could be one of
    168 .IR nuke: 
     172.IR nuke:
    169173This mode restore everything like on the original system with no/minimal questions
    170 .IR interactive: 
     174.IR interactive:
    171175This mode asks all the questions to the user
    172 .IR compare: 
     176.IR compare:
    173177This mode just compares the system with the backup
    174 .IR iso: 
     178.IR iso:
    175179This mode restores from iso images, instead of real media
    176 .IR isonuke: 
     180.IR isonuke:
    177181This mode restores from iso images, instead of real media, with no/minimal questions
    178 .IR mbr: 
     182.IR mbr:
    179183This mode just restores the MBR (Master Boot Record)
    180184
     
    182186.SH DIAGNOSTICS
    183187mondorestore 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.
     189When seeking technical support, attach this file to your email.
    186190
    187191.SH FILES
    188192.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.
     193This log contains important information required to analyse mondorestore
     194problem reports. Mondo support highly recommends sending this file with
     195support questions. It's located under /tmp during the restore process
     196and moved under /var/log at the end.
    192197
    193198.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 at
     199A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren,
     200Cafeole, Randy Delphs, Stan Benoit, and Hugo Rabson) may be found at
    196201.I http://www.mondorescue.org/docs.shtml
    197 - or in
     202\- or in
    198203.I /usr/share/doc/mondo-x.xx
    199204on your hard drive.
     
    202207It is recommend that your system has more than 64 MB ram. SCSI device order
    203208change with nuke can have unexpected results. It is recommended you use expert
    204 mode with drastic hardware reconfigurations. 
     209mode with drastic hardware reconfigurations.
    205210
    206211.SH "SEE ALSO"
    207212afio(1), bzip2(1), find(1), mindi(8), mondoarchive(8).
    208213.SH AUTHORS
    209 Bruno Cornec (lead-development) 
     214Bruno Cornec (lead-development)
    210215.I "bruno_at_mondorescue.org"
    211216.br
    212 Andree Leidenfrost (co-developer) 
     217Andree Leidenfrost (co-developer)
    213218.I "aleidenf_at_bigpond.net.au"
    214219.br
     
    227232.br
    228233See mailing list at http://www.mondorescue.org for technical support.
    229 .
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2508 r2546  
    15921592    ********/
    15931593    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);
    15951595        return (-1);
    15961596    }
    1597     log_msg(5, "  %s looks like a device special file", dsf);
     1597    log_msg(4, "  %s looks like a device special file", dsf);
    15981598    /* Verify that the dsf exists */
    15991599    mr_asprintf(command, "ls -al %s 2>/dev/null | wc -l", dsf);
     
    16101610        return (1);
    16111611    }
    1612     log_msg(5, "  %s device special file exists", dsf);
     1612    log_msg(4, "  %s device special file exists", dsf);
    16131613
    16141614    /* Get a list of the mounted file systems */
     
    16241624    ********/
    16251625    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);
    16271627    partition_list = call_program_and_get_last_line_of_output(command);
    16281628    mr_free(command);
     
    16421642        lastpos = 0;
    16431643        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);
    16451645            partitions[i++] = token;
    16461646        }
     
    16481648    }
    16491649    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
    16511660    /*  For the rest ndsf is the new dsf to deal with */
    16521661    /********
     
    16831692        /* See if it's swap. If it is, ignore it. */
    16841693        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);
    16861695        tmp = call_program_and_get_last_line_of_output(command);
    16871696        mr_free(command);
    16881697
    1689         log_msg(4, "  Return value: %s", tmp);
     1698        log_msg(5, "  Return value: %s", tmp);
    16901699        c = strlen(tmp);
    16911700        mr_free(tmp);
     
    17171726        log_msg(4, "  It's not mounted. Checking to see if it's LVM...");
    17181727
    1719         /* Get the partition ID; 8e for LVM */
    1720         mr_asprintf(command, "parted2fdisk -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);
    17221731        tmp = call_program_and_get_last_line_of_output(command);
    17231732        mr_free(command);
    17241733
    17251734        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));
    17331749                mr_free(command);
    17341750
    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));
    17421782                    mr_free(command);
    17431783
    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);
    17501789                            mr_free(tmp);
    17511790                            mr_free(VG);
     
    17541793                        }
    17551794                        DSFptr->check = 1;
    1756                         mr_free(token);
    17571795                    }
    1758                     /********
    1759                      * Now we want to see if there are any software raid devices using
    1760                      * 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);
    18011796                }
     1797                mr_free(token);
     1798                paranoid_free(mount_list);
     1799            } else {
     1800                log_msg (4, "Error finding Volume Group for partition %s", partitions[i]);
    18021801                mr_free(tmp);
    1803                 mr_free(VG);
    1804                 continue;
    1805             }
     1802                return (1);
     1803            }
     1804            mr_free(tmp);
     1805            continue;
    18061806        } else {
    18071807            log_msg (4, "Error finding partition type for the partition %s", partitions[i]);
     
    18801880    while (DSFptr != NULL) {
    18811881        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);
    18831883            strcat(*included_dsf_list, DSFptr->mount_point);
    18841884            strcat(*included_dsf_list, " ");
     
    19071907char *not_mounted_on_dsf = NULL;
    19081908char token_chars[] =" \t\r\f\a\0\n";
     1909char *tmp = NULL;
     1910char *tmp1 = NULL;
    19091911
    19101912while ((token = mr_strtok(pathlist, token_chars, &lastpos)) != NULL) {
     
    19461948    /* A device special file was not passed in. Process it as a path. */
    19471949    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);
    19481952        if (mode == 'E') {
    19491953            /*  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);
    19521957            }
    19531958        } else {
    19541959            /*  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);
    19591967        break;
    19601968    }
  • branches/2.2.10/mondo/src/common/libmondo-fork.c

    r2508 r2546  
    586586    mr_free(command);
    587587
    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);
    589589    res = run_program_and_log_output(command, 5);
    590590    mr_free(command);
     
    703703    mr_free(command);
    704704
    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);
    706706    res = run_program_and_log_output(command, 5);
    707707    mr_free(command);
Note: See TracChangeset for help on using the changeset viewer.