Diffs to 4.3BSD dump to dump live file systems
Dave Curry
davy at pur-ee.UUCP
Sun Dec 28 10:29:22 AEST 1986
I'm posting this here since this is where the original discussion
started, and because it's short. No lectures about net.sources
from the news police, please. Sorry it's not a follow up to the
original discussion, buf for some reason Pnews completely choked
on things ("inews: you didn't really want to post THAT!", whatever
that means).
----------
These are the diffs to 4.3BSD dump in order to allow safer dumping of
live file systems. We originally made the mods to 4.2BSD dump, so you
should be able to use that if you don't have 4.3BSD yet. Beware that
the line numbers may differ though.
The code causes dump to ignore any inode which has been changed or
modified during the dump. This will occasionally cause restore to
print "resync restore" messages, however I have never seen restore
actually choke on anything.
We have been using this code for over a year with no ill effects. As
always you should try to do dumps when there is as little activity on
the file system as possible. We do our partials just after midnight
every morning. Our fulls however run from two to three hours a piece,
and we do them on Saturday and Sunday mornings when there are plenty
of users on the system. We've had no trouble with this, so the code
seems to be pretty effective.
--Dave Curry
Purdue University
Engineering Computer Network
davy at intrepid.ecn.purdue.edu
ihnp4!pur-ee!davy
*** /tmp/,RCSt1016242 Sat Dec 27 19:02:43 1986
--- dumpmain.c Sun Aug 3 12:43:40 1986
***************
*** 10,15
#include "dump.h"
int notify = 0; /* notify operator flag */
int blockswritten = 0; /* number of blocks written on current tape */
int tapeno = 0; /* current tape number */
--- 10,18 -----
#include "dump.h"
+ #if PURDUE_EE
+ int filepass;
+ #endif
int notify = 0; /* notify operator flag */
int blockswritten = 0; /* number of blocks written on current tape */
int tapeno = 0; /* current tape number */
***************
*** 287,292
pass(dirdump, dirmap);
msg("dumping (Pass IV) [regular files]\n");
pass(dump, nodmap);
spcl.c_type = TS_END;
--- 290,298 -----
pass(dirdump, dirmap);
msg("dumping (Pass IV) [regular files]\n");
+ #if PURDUE_EE
+ filepass = 1;
+ #endif
pass(dump, nodmap);
#if PURDUE_EE
filepass = 0;
***************
*** 288,293
msg("dumping (Pass IV) [regular files]\n");
pass(dump, nodmap);
spcl.c_type = TS_END;
#ifndef RDUMP
--- 294,302 -----
filepass = 1;
#endif
pass(dump, nodmap);
+ #if PURDUE_EE
+ filepass = 0;
+ #endif
spcl.c_type = TS_END;
#ifndef RDUMP
*** /tmp/,RCSt1016249 Sat Dec 27 19:03:03 1986
--- dumptraverse.c Sun Aug 3 12:43:50 1986
***************
*** 7,12
#ifndef lint
static char sccsid[] = "@(#)dumptraverse.c 5.3 (Berkeley) 1/9/86";
#endif not lint
#include "dump.h"
--- 7,15 -----
#ifndef lint
static char sccsid[] = "@(#)dumptraverse.c 5.3 (Berkeley) 1/9/86";
#endif not lint
+ #if PURDUE_EE
+ extern filepass;
+ #endif
#include "dump.h"
***************
*** 45,50
BIS(ino, dirmap);
if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) &&
!BIT(ino, nodmap)) {
BIS(ino, nodmap);
if (f != IFREG && f != IFDIR && f != IFLNK) {
esize += 1;
--- 48,60 -----
BIS(ino, dirmap);
if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) &&
!BIT(ino, nodmap)) {
+ #if PURDUE_EE
+ if (ip->di_mtime >= spcl.c_date || ip->di_ctime >= spcl.c_date){
+ if (f != IFDIR) {
+ return;
+ }
+ }
+ #endif
BIS(ino, nodmap);
if (f != IFREG && f != IFDIR && f != IFLNK) {
esize += 1;
***************
*** 138,143
i = ip->di_mode & IFMT;
if (i == 0) /* free inode */
return;
if ((i != IFDIR && i != IFREG && i != IFLNK) || ip->di_size == 0) {
spclrec();
return;
--- 148,160 -----
i = ip->di_mode & IFMT;
if (i == 0) /* free inode */
return;
+ #if PURDUE_EE
+ if (ip->di_mtime >= spcl.c_date || ip->di_ctime >= spcl.c_date) {
+ if (filepass) {
+ return;
+ }
+ }
+ #endif
if ((i != IFDIR && i != IFREG && i != IFLNK) || ip->di_size == 0) {
spclrec();
return;
More information about the Comp.unix.wizards
mailing list