Date: Sat, 28 Oct 1995 21:06:00 +0100 (MET) From: Andreas Klemm <andreas@knobel.gun.de> To: hackers@freebsd.org, current@freebsd.org Cc: jkh@freebsd.org, rb@gtn.com, mg@gtn.com, mlc@wup.de Subject: several diffs for dump(8) to display write throughput and such...c Message-ID: <Pine.BSF.3.91.951028202808.3163A-100000@knobel.gun.de>
next in thread | raw e-mail | index | archive | help
Hi ! The dump utility in Solaris 2.4 has the nice feature, to show the write throughput, when dumping to tape. I missed this one in FreeBSD's dump utility. Therefore I added this feature and am really satisfied with the result ;-) Look this dump using a 5GB Sun DAT (Archive Python with data compression): DUMP: Date of this level 0 dump: Sat Oct 28 20:28:29 1995 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rsd0s3d (/local) to /dev/nrst0 DUMP: mapping (Pass I) [regular files] DUMP: mapping (Pass II) [directories] DUMP: estimated 687051 tape blocks on 0.14 tape(s). DUMP: dumping (Pass III) [directories] DUMP: dumping (Pass IV) [regular files] DUMP: 18.62% done, finished in 0:21 DUMP: 40.41% done, finished in 0:14 DUMP: 63.04% done, finished in 0:08 DUMP: 83.35% done, finished in 0:03 DUMP: DUMP: 688558 tape blocks on 1 volumes(s) >>DUMP: DUMP: finished in 1451 seconds, throughput 474 KBytes/sec DUMP: level 0 dump on Sat Oct 28 20:28:29 1995 DUMP: Closing /dev/nrst0 DUMP: DUMP IS DONE I hope you like this feature, too. Please, could someone apply these diffs to FreeBSD-current and FreeBSD-stable (2.1) if you should agree with me, that it's worth to add these changes ?! Some other things that I changed in the hope, it's useful to everybody: o changed the default tape from /dev/rmt8 to /dev/nrst0 Since rmt8 doesn't exist anymore and /dev/nrst0 is the first tape device. I choosed the no rewind device, since it's the default in nowadays, to write multiple volumes to one large DAT or Tape or whatelse. And updated the manpage o changed the example in the manpage. Choosed /dev/nrst0 instead of /dev/nrst1. Not important, but why not use the first SCSI tape drive ? I think most people only have one main backup device... o added a note in the manpage, that the blocksize has to be equal or less 32 Kbyte (b option). Using values over 32 is ok, too. dump runs without problems, BUT YOU ARE UNABLE TO RESTORE THAT BACKUP, since when using restore, the scsi tape subsystem (st(4)) reports to you the following message, if you try to read a dump with blocksizes over 32K: "st0: 33792-byte record too big" Perhaps dump should report an error directly ?!?! What do you think of this ?! I could add this feature, if you like. BTW, who can tell me the reason for that limitation concerning st(4) ?! I don't understand it. When using Suns dump/restore and ufsdump/ufsrestore commands, then I can use blocksizes up to 96 (recommended from Sun for DAT's) and 128 for Exabytes (if I remember right)... Why only 32K in FreeBSD ??? It's a message from the st(4) driver.... Best regards Andreas /// *** main.c.orig Sat Oct 28 18:53:47 1995 --- main.c Sat Oct 28 20:08:38 1995 *************** *** 440,445 **** --- 440,446 ---- (void)dumpino(dp, ino); } + (void)time((time_t *)&(tend_writing)); /* AKL end time */ spcl.c_type = TS_END; for (i = 0; i < ntrec; i++) writeheader(maxino - 1); *************** *** 448,453 **** --- 449,457 ---- else msg("DUMP: %ld tape blocks on %d volumes(s)\n", spcl.c_tapea, spcl.c_volume); + msg("DUMP: finished in %d seconds, throughput %d KBytes/sec\n", + tend_writing-tstart_writing, + spcl.c_tapea/(tend_writing-tstart_writing)); /* AKL */ putdumptime(); trewind(); broadcast("DUMP IS DONE!\7\7\n"); *** pathnames.h.orig Thu May 26 08:34:04 1994 --- pathnames.h Sat Oct 28 20:08:54 1995 *************** *** 35,41 **** #include <paths.h> ! #define _PATH_DEFTAPE "/dev/rmt8" #define _PATH_DTMP "/etc/dtmp" #define _PATH_DUMPDATES "/etc/dumpdates" #define _PATH_LOCK "/tmp/dumplockXXXXXX" --- 35,41 ---- #include <paths.h> ! #define _PATH_DEFTAPE "/dev/nrst0" /* AKL */ #define _PATH_DTMP "/etc/dtmp" #define _PATH_DUMPDATES "/etc/dumpdates" #define _PATH_LOCK "/tmp/dumplockXXXXXX" *** dump.h.orig Tue May 30 08:08:52 1995 --- dump.h Sat Oct 28 18:57:58 1995 *************** *** 79,84 **** --- 79,85 ---- int blockswritten; /* number of blocks written on current tape */ int tapeno; /* current tape number */ time_t tstart_writing; /* when started writing the first tape block */ + time_t tend_writing; /* after writing the last tape block AKL */ struct fs *sblock; /* the file system super block */ char sblock_buf[MAXBSIZE]; long dev_bsize; /* block size of underlying disk device */ *** dump.8.orig Sat Jul 15 16:46:33 1995 --- dump.8 Sat Oct 28 20:22:30 1995 *************** *** 85,91 **** This option overrides the calculation of tape size based on length and density. .It Cm b Ar blocksize ! The number of kilobytes per dump record. .It Cm h Ar level Honor the user .Dq nodump --- 85,92 ---- This option overrides the calculation of tape size based on length and density. .It Cm b Ar blocksize ! The number of kilobytes per dump record. The maximum value ! is 32. .It Cm h Ar level Honor the user .Dq nodump *************** *** 102,108 **** .Ar file may be a special device file like ! .Pa /dev/rmt12 (a tape drive), .Pa /dev/rsd1c (a disk drive), --- 103,109 ---- .Ar file may be a special device file like ! .Pa /dev/rst0 (a tape drive), .Pa /dev/rsd1c (a disk drive), *************** *** 256,262 **** .It Always start with a level 0 backup, for example: .Bd -literal -offset indent ! /sbin/dump 0uf /dev/nrst1 /usr/src .Ed .Pp This should be done at set intervals, say once a month or once every two months, --- 257,263 ---- .It Always start with a level 0 backup, for example: .Bd -literal -offset indent ! /sbin/dump 0uf /dev/nrst0 /usr/src .Ed .Pp This should be done at set intervals, say once a month or once every two months, *************** *** 282,288 **** rotated out of the dump cycle and fresh tapes brought in. .Sh FILES .Bl -tag -width /etc/dumpdates -compact ! .It Pa /dev/rmt8 default tape unit to dump to .It Pa /etc/dumpdates dump date records --- 283,289 ---- rotated out of the dump cycle and fresh tapes brought in. .Sh FILES .Bl -tag -width /etc/dumpdates -compact ! .It Pa /dev/nrst0 default tape unit to dump to .It Pa /etc/dumpdates dump date records *************** *** 334,336 **** --- 335,346 ---- A .Nm dump command appeared in Version 6 AT&T UNIX. + .Pp + Additional dump message (similar to Solaris 2) + by Andreas Klemm <andreas@knobel.gun.de> reporting + .Nm backup time + in seconds and + .Nm write performance + in Kbytes per second. Changed default dump device from + the old fashioned rmt8 device to /dev/nrst0. + Appeared first in FreeBSD 2.2. -- $$ apsfilter - magic print filter 4lpd @home : andreas@knobel.gun.de $$ ftp://sunsite.unc.edu @work : andreas@sunny.wup.de $$ /pub/Linux/system/Printing/aps-491.tgz knobel: >>> powered by FreeBSD <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951028202808.3163A-100000>