.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dump.8.in,v 1.23 2001/03/23 14:40:12 stelian Exp $
+.\" $Id: dump.8.in,v 1.24 2001/03/28 12:59:48 stelian Exp $
.\"
.Dd __DATE__
.Dt DUMP 8
last dump of a lower level.
The default level is 9.
.It Fl B Ar records
-The number of 1 KB blocks per volume.
+The number of 1 kB blocks per volume.
This option overrides the end-of-media detection, and calculation
of tape size based on length and density.
.It Fl a
.It Fl b Ar blocksize
The number of kilobytes per dump record.
Since the IO system slices all requests into chunks of MAXBSIZE
-(typically 64KB), it is not possible to use a larger blocksize
+(typically 64kB), it is not possible to use a larger blocksize
without having problems later with
.Xr restore 8 .
Therefore
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.40 2001/03/23 14:40:12 stelian Exp $";
+ "$Id: main.c,v 1.41 2001/03/28 12:59:48 stelian Exp $";
#endif /* not lint */
#include <config.h>
}
if (sizest) {
- printf("%.0f\n", ((double)tapesize + 11) * TP_BSIZE);
+ printf("%.0f\n", ((double)tapesize + 1 + ntrec) * TP_BSIZE);
exit(X_FINOK);
} /* stop here for size estimate */
if (pipeout || unlimited) {
- tapesize += 11; /* 10 trailer blocks + 1 map header */
+ tapesize += 1 + ntrec; /* 1 map header + trailer blocks */
msg("estimated %ld tape blocks.\n", tapesize);
} else {
double fetapes;
/* count the dumped inodes map on each additional tape */
tapesize += (etapes - 1) *
(howmany(mapsize * sizeof(char), TP_BSIZE) + 1);
- tapesize += etapes + 10; /* headers + 10 trailer blks */
+ tapesize += etapes + ntrec; /* headers + trailer blks */
msg("estimated %ld tape blocks on %3.2f tape(s).\n",
tapesize, fetapes);
}
continue;
#ifdef __linux__
/*
- * No need to check here for deleted and not yes reallocated inodes
- * since this is done in dumpino().
+ * No need to check here for deleted and not yet reallocated
+ * inodes since this is done in dumpino().
*/
#endif
(void)dumpino(dp, ino);
tend_writing = time(NULL);
spcl.c_type = TS_END;
- for (i = 0; i < ntrec; i++)
+ /*
+ * Finish off the current tape record with trailer blocks, to ensure
+ * at least the data in the last partial record makes it to tape.
+ * Also make sure we write at least 1 trailer block.
+ */
+ for (i = ntrec - (spcl.c_tapea % ntrec); i; --i)
writeheader(maxino - 1);
tnow = trewind();
((double)spcl.c_tapea * TP_BSIZE / 1048576),
spcl.c_volume);
- /* report dump performance, avoid division through zero */
+ /* report dump performance, avoid division by zero */
if (tend_writing - tstart_writing == 0)
msg("finished in less than a second\n");
else
if (compressed) {
long tapekb = bytes_written / 1024;
double rate = .0005 + (double) spcl.c_tapea / tapekb;
- msg("Wrote %ldkB uncompressed, %ldKB compressed, %1.3f:1\n",
+ msg("Wrote %ldkB uncompressed, %ldkB compressed, %1.3f:1\n",
spcl.c_tapea, tapekb, rate);
}
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.39 2001/03/23 14:40:12 stelian Exp $";
+ "$Id: tape.c,v 1.40 2001/03/28 12:59:48 stelian Exp $";
#endif /* not lint */
#include <config.h>
xferrate += txfrate;
if (compressed) {
double rate = .0005 + (double) blocks / (double) volkb;
- msg("Volume %d %ldKB uncompressed, %ldkB compressed,"
+ msg("Volume %d %ldkB uncompressed, %ldkB compressed,"
" %1.3f:1\n",
tapeno, blocks, volkb, rate);
}
/ blockswritten * tapesize;
if (tnow > tstart_volume)
(void)snprintf(msgbuf, sizeof(msgbuf),
- "%3.2f%% done at %ld KB/s, finished in %d:%02d\n",
+ "%3.2f%% done at %ld kB/s, finished in %d:%02d\n",
(blockswritten * 100.0) / tapesize,
(spcl.c_tapea - tapea_volume) / (tnow - tstart_volume),
(int)(deltat / 3600), (int)((deltat % 3600) / 60));
#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.30 2001/03/23 14:40:12 stelian Exp $";
+ "$Id: traverse.c,v 1.31 2001/03/28 12:59:48 stelian Exp $";
#endif /* not lint */
#include <config.h>
#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT3_FEATURE_INCOMPAT_RECOVER | \
EXT2_FEATURE_INCOMPAT_FILETYPE)
#endif
+#ifndef EXT2_RESIZE_INO
+#define EXT2_RESIZE_INO 7
+#endif
int dump_fs_open(const char *disk, ext2_filsys *fs)
{
retval = EXT2_ET_UNSUPP_FEATURE;
ext2fs_close(*fs);
}
- else if (es->s_feature_compat &
+ else {
+ if (es->s_feature_compat &
EXT3_FEATURE_COMPAT_HAS_JOURNAL &&
journal_ino && !exclude_ino(journal_ino)) {
- iexclude_list[iexclude_num++] = journal_ino;
- msg("Added ext3 journal inode %u to exclude list\n",
- journal_ino);
+ iexclude_list[iexclude_num++] = journal_ino;
+ msg("Exclude ext3 journal inode %u\n",
+ journal_ino);
+ }
+ if (!exclude_ino(EXT2_RESIZE_INO))
+ iexclude_list[iexclude_num++] = EXT2_RESIZE_INO;
}
}
return retval;
#ifndef lint
static const char rcsid[] =
- "$Id: rmt.c,v 1.12 2000/12/21 11:14:54 stelian Exp $";
+ "$Id: rmt.c,v 1.13 2001/03/28 12:59:49 stelian Exp $";
#endif /* not linux */
/*
int rval = 0;
char c;
int n, i, cc;
+ unsigned long block = 0;
argc--, argv++;
if (argc > 0) {
tape = open(device, atoi(filemode), 0666);
if (tape < 0)
goto ioerror;
+ block = 0;
goto respond;
case 'C':
- DEBUG("rmtd: C\n");
+ DEBUG1("rmtd: C (%lu blocks)\n", block);
getstring(device); /* discard */
if (close(tape) < 0)
goto ioerror;
tape = -1;
+ block = 0;
goto respond;
case 'L':
case 'W':
getstring(count);
n = atoi(count);
- DEBUG1("rmtd: W %s\n", count);
+ DEBUG2("rmtd: W %s (block = %lu)\n", count, block);
record = checkbuf(record, n);
for (i = 0; i < n; i += cc) {
cc = read(0, &record[i], n - i);
rval = write(tape, record, n);
if (rval < 0)
goto ioerror;
+ block += n >> 10;
goto respond;
case 'R':
getstring(count);
- DEBUG1("rmtd: R %s\n", count);
+ DEBUG2("rmtd: R %s (block %lu)\n", count, block);
n = atoi(count);
record = checkbuf(record, n);
rval = read(tape, record, n);
(void)sprintf(resp, "A%d\n", rval);
(void)write(1, resp, strlen(resp));
(void)write(1, record, rval);
+ block += n >> 10;
goto top;
case 'I':