Changeset 1235 in MondoRescue for branches/stable/mondo


Ignore:
Timestamp:
Mar 11, 2007, 5:21:56 PM (17 years ago)
Author:
Bruno Cornec
Message:

Patch from Scott Cummings (<rsc_at_usfamily.net>):
No compression for iso backup is probably not a commonly used option (-0),
but I wanted to run a backup and a verify as quickly as possible just to try out mondo. In the
process I also tested the case of a verify with a missing big file in
the filesystem (after the backup). That caused a segfault when it tried
to read the non-existent file.
Attached patch changes make "verify_all_slices_on_CD" actually
verify the uncompressed big file slices (instead of just skipping them).

It also has small message enhancements for -0 compression verify.

  • really verify uncompressed big file slices
  • log 'cat' (0 compression) errors
  • detect if no zip_suffix (in case forget -0 on command line)
  • avoid segfault in fread if bigfile fails to open on filesystem
  • report missing filesystem big file
  • generate hundreds of errors about ntfs filesystem not comparing :)

(does it do this for any change in ntfs partition? maybe something

else was going on.)

Yet to do is make afioballs auto detect if they are uncompressed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-verify.c

    r1179 r1235  
    264264           does_file_exist(slice_fname
    265265                           (bigfile_num, slice_num, mountpoint, ""))) {
    266 // handle slices until end of CD
     266        // handle slices until end of CD
    267267        if (slice_num == 0) {
    268268            mr_msg(2, "ISO=%d  bigfile=%ld --START--",
     
    286286            if (!(forig = fopen(tmp2, "r"))) {
    287287                mr_msg(2, "Failed to open bigfile. Darn.");
     288                log_to_screen(_("%s/%s not found on live filesystem"),
     289                            bkpinfo->restore_path,
     290                            biggiestruct.filename);
     291                mr_asprintf(&tmp, "echo \"%s/%s not found\" >> /tmp/biggies.changed",
     292                            bkpinfo->restore_path,
     293                            biggiestruct.filename);
     294                system(tmp);
     295                mr_free(tmp);
     296
     297                bigfile_num++;
     298                slice_num = 0;
    288299                retval++;
     300            } else {
     301                slice_num++;
    289302            }
    290303            mr_free(tmp2);
    291 
    292             slice_num++;
    293         } else if (does_file_exist
    294                    (slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
     304        } else if (does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, "")) &&
     305                   (length_of_file(slice_fname(bigfile_num, slice_num, mountpoint, "")) == 0)) {
    295306            mr_msg(2, "ISO=%d  bigfile=%ld ---END---",
    296307                    g_current_media_number, bigfile_num);
     
    299310            slice_num = 0;
    300311        } else {
    301             mr_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
     312            mr_msg(2, "ISO=%d  bigfile=%ld  slice=%ld",
    302313                    g_current_media_number, bigfile_num, slice_num);
    303             if (bkpinfo->compression_level > 0) {
     314            if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
    304315                mr_asprintf(&command, "%s -dc %s 2>> %s", sz_exe,
    305                         slice_fname(bigfile_num, slice_num, mountpoint,
    306                                     bkpinfo->zip_suffix),
     316                        slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix),
    307317                        MONDO_LOGFILE);
    308318            } else {
    309                 mr_asprintf(&command, "cat %s",
    310                         slice_fname(bigfile_num, slice_num, mountpoint,
    311                                     bkpinfo->zip_suffix));
     319                /* can we set up bkpinfo->compression_level = 0
     320                 * without needing '-0' on command line?
     321                 * here and in afio verify */
     322                mr_asprintf(&command, "cat %s 2>> %s",
     323                        slice_fname(bigfile_num, slice_num, mountpoint, ""), MONDO_LOGFILE);
    312324            }
    313325            if ((pin = popen(command, "r"))) {
     
    331343                }
    332344                paranoid_pclose(pin);
    333                 if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) {
     345                if (res && !strncmp(biggiestruct.filename, "/dev/", 5)) {
    334346                    mr_msg(3,
    335347                            "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.",
Note: See TracChangeset for help on using the changeset viewer.