Add the a' option (`auto-size'') to bypass all tape length

considerations, and dump right to the end of medium.
This commit is contained in:
Joerg Wunsch 1997-02-01 23:44:19 +00:00
parent 10c4031d64
commit af00957e47
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22192
4 changed files with 44 additions and 15 deletions

View File

@ -41,7 +41,7 @@
.Nd filesystem backup .Nd filesystem backup
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm dump .Nm dump
.Op Cm 0123456789BbhfusTdWn Op Ar argument ... .Op Cm 0123456789BTWabcdfhnsu Op Ar argument ...
.Op Ar filesystem .Op Ar filesystem
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm Dump .Nm Dump
@ -56,7 +56,11 @@ option below for doing remote backups).
A dump that is larger than the output medium is broken into A dump that is larger than the output medium is broken into
multiple volumes. multiple volumes.
On most media the size is determined by writing until an On most media the size is determined by writing until an
end-of-media indication is returned. end-of-media indication is returned. This can be enforced
by using the
.Cm a
option.
.Pp
On media that cannot reliably return an end-of-media indication On media that cannot reliably return an end-of-media indication
(such as some cartridge tape drives) (such as some cartridge tape drives)
each volume is of a fixed size; each volume is of a fixed size;
@ -85,8 +89,19 @@ level is 9.
The number of dump records per volume. The number of dump records per volume.
This option overrides the calculation of tape size This option overrides the calculation of tape size
based on length and density. based on length and density.
.It Cm a
.Dq auto-size .
Bypass all tape length considerations, and enforce writing
until an end-of-media indication is returned. This fits best
for most modern tape drives. Use of this option is particularly
recommended when appending to an existing tape, or using a tape
drive with hardware compression (where you can never be sure about
the compression ratio).
.It Cm b Ar blocksize .It Cm b Ar blocksize
The number of kilobytes per dump record. The number of kilobytes per dump record.
.It Cm c
Change the defaults for use with a cartridge tape drive, with a density
of 8000 bpi, and a length of 1700 feet.
.It Cm h Ar level .It Cm h Ar level
Honor the user Honor the user
.Dq nodump .Dq nodump
@ -325,10 +340,12 @@ Each reel requires a new process, so parent processes for
reels already written just hang around until the entire tape reels already written just hang around until the entire tape
is written. is written.
.Pp .Pp
restore(8) is currently unable to restore dumps that were created Currently,
with a blocksize larger than 32 on some tape drives. This is likely .Xr physio 9
a bug in the tape driver. Workaround for safety reasons: slices all requests into chunks of 64 KB. Therefore, it is
dump aborts with an error message when choosing a blocksize > 32. impossible to use a larger tape blocksize, so
.Nm dump
will prevent this from happening.
.Pp .Pp
.Nm Dump .Nm Dump
with the with the

View File

@ -74,6 +74,7 @@ long tsize; /* tape size in 0.1" units */
long asize; /* number of 0.1" units written on current tape */ long asize; /* number of 0.1" units written on current tape */
int etapes; /* estimated number of tapes */ int etapes; /* estimated number of tapes */
int nonodump; /* if set, do not honor UF_NODUMP user flags */ int nonodump; /* if set, do not honor UF_NODUMP user flags */
int unlimited; /* if set, write to end of medium */
int notify; /* notify operator flag */ int notify; /* notify operator flag */
int blockswritten; /* number of blocks written on current tape */ int blockswritten; /* number of blocks written on current tape */

View File

@ -168,11 +168,18 @@ main(argc, argv)
case 'b': /* blocks per tape write */ case 'b': /* blocks per tape write */
ntrec = numarg('b', "number of blocks per write", ntrec = numarg('b', "number of blocks per write",
1L, 1000L, &argc, &argv); 1L, 1000L, &argc, &argv);
/* XXX restore is unable to restore dumps that /*
were created with a blocksize larger than 32K. * XXX
Possibly a bug in the scsi tape driver. */ * physio(9) currently slices all requests to
if ( ntrec > 32 ) { * 64 KB chunks. So now, if somebody entered
msg("please choose a blocksize <= 32\n"); * e.g. 96 KB block size here, he would effectively
* yield one 64 KB and one 32 KB block, which
* restore cannot handle.
* Thus we currently enforce pyhsio(9)'s limit
* here, too.
*/
if ( ntrec > 64 ) {
msg("please choose a blocksize <= 64\n");
exit(X_ABORT); exit(X_ABORT);
} }
break; break;
@ -186,6 +193,10 @@ main(argc, argv)
cartridge = 1; cartridge = 1;
break; break;
case 'a': /* `auto-size', Write to EOM. */
unlimited = 1;
break;
/* dump level */ /* dump level */
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '5': case '6': case '7': case '8': case '9':
@ -235,7 +246,7 @@ main(argc, argv)
if (blocksperfile) if (blocksperfile)
blocksperfile = blocksperfile / ntrec * ntrec; /* round down */ blocksperfile = blocksperfile / ntrec * ntrec; /* round down */
else { else if (!unlimited) {
/* /*
* Determine how to default tape size and density * Determine how to default tape size and density
* *
@ -361,7 +372,7 @@ main(argc, argv)
anydirskipped = mapdirs(maxino, &tapesize); anydirskipped = mapdirs(maxino, &tapesize);
} }
if (pipeout) { if (pipeout || unlimited) {
tapesize += 10; /* 10 trailer blocks */ tapesize += 10; /* 10 trailer blocks */
msg("estimated %ld tape blocks.\n", tapesize); msg("estimated %ld tape blocks.\n", tapesize);
} else { } else {

View File

@ -138,7 +138,7 @@ alloctape()
* repositioning after stopping, i.e, streaming mode, where the gap is * repositioning after stopping, i.e, streaming mode, where the gap is
* variable, 0.30" to 0.45". The gap is maximal when the tape stops. * variable, 0.30" to 0.45". The gap is maximal when the tape stops.
*/ */
if (blocksperfile == 0) if (blocksperfile == 0 && !unlimited)
tenths = writesize / density + tenths = writesize / density +
(cartridge ? 16 : density == 625 ? 5 : 8); (cartridge ? 16 : density == 625 ? 5 : 8);
/* /*
@ -302,7 +302,7 @@ flushtape()
asize += tenths; asize += tenths;
blockswritten += ntrec; blockswritten += ntrec;
blocksthisvol += ntrec; blocksthisvol += ntrec;
if (!pipeout && (blocksperfile ? if (!pipeout && !unlimited && (blocksperfile ?
(blocksthisvol >= blocksperfile) : (asize > tsize))) { (blocksthisvol >= blocksperfile) : (asize > tsize))) {
close_rewind(); close_rewind();
startnewtape(0); startnewtape(0);