Ignore:
Timestamp:
May 26, 2008, 7:12:52 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • Avoid to rewind the tape for OBDR by setting the blocksize in the obdr function on the non-rewinding dev.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/common/libmondo-stream.c

    r1951 r1952  
    693693    }
    694694
    695     asprintf(&command, "mt -f %s fsf 2", ntapedev);
     695    asprintf(&command, "mt -f %s fsf 2",ntapedev);
    696696    run_program_and_log_output(command, 1);
    697697    paranoid_free(command);
     698
     699    set_tape_block_size_with_mt(ntapedev, internal_tape_block_size);
    698700
    699701    paranoid_free(ntapedev);
     
    714716
    715717    /* OBDR: First block 10 kB of zero bs = 512 */
    716     asprintf(&command, "mt -f %s compression off", tapedev);
     718    asprintf(&command, "mt -f %s compression off",tapedev);
    717719    res = run_program_and_log_output(command, 1);
    718720    paranoid_free(command);
    719721
    720     asprintf(&command, "mt -f %s rewind", tapedev);
     722    asprintf(&command, "mt -f %s rewind",tapedev);
    721723    res = run_program_and_log_output(command, 1);
    722724    paranoid_free(command);
    723725
    724     asprintf(&command, "mt -f %s setblk 512", ntapedev);
     726    set_tape_block_size_with_mt(ntapedev, 512);
     727
     728    asprintf(&command, "dd if=/dev/zero of=%s bs=512 count=20",ntapedev);
    725729    res = run_program_and_log_output(command, 1);
    726730    paranoid_free(command);
    727731
    728     asprintf(&command, "dd if=/dev/zero of=%s bs=512 count=20", ntapedev);
     732    /* OBDR: then ISO boot image bs = 2048 */
     733    set_tape_block_size_with_mt(ntapedev, 2048);
     734
     735    asprintf(&command, "dd if=%s of=%s bs=2048",MINDI_CACHE"/mondorescue.iso",ntapedev);
    729736    res = run_program_and_log_output(command, 1);
    730737    paranoid_free(command);
    731738
    732     /* OBDR: then ISO boot image bs = 2048 */
    733     asprintf(&command, "mt -f %s setblk 2048", ntapedev);
    734     res = run_program_and_log_output(command, 1);
    735     paranoid_free(command);
    736 
    737     asprintf(&command, "dd if=%s of=%s bs=2048", MINDI_CACHE"/mondorescue.iso", ntapedev );
    738     res = run_program_and_log_output(command, 1);
    739     paranoid_free(command);
     739    set_tape_block_size_with_mt(ntapedev, internal_tape_block_size);
    740740
    741741    paranoid_free(ntapedev);
     
    788788    if (bkpinfo->use_obdr) {
    789789        skip_obdr(bkpinfo->media_device);
    790     }
     790    } else {
     791        set_tape_block_size_with_mt(bkpinfo->media_device,
     792                                bkpinfo->internal_tape_block_size);
     793    }
     794
    791795
    792796    insist_on_this_tape_number(1);
    793797    sprintf(outfname, "%s/tmp/all.tar.gz", bkpinfo->tmpdir);
    794798    make_hole_for_file(outfname);
    795 
    796     set_tape_block_size_with_mt(bkpinfo->media_device,
    797                                 bkpinfo->internal_tape_block_size);
    798799
    799800//  start_buffer_process( bkpinfo->media_device, g_tape_fifo, FALSE);
     
    924925    if (bkpinfo->use_obdr) {
    925926        create_obdr(tapedev);
    926     }
    927 
    928     set_tape_block_size_with_mt(tapedev, internal_tape_block_size);
     927    } else {
     928        set_tape_block_size_with_mt(tapedev, internal_tape_block_size);
     929    }
    929930    log_it("Opening OUT tape");
    930931    if (!
Note: See TracChangeset for help on using the changeset viewer.