Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!ltuxa!we53!wucs!nz From: nz@wucs.UUCP Newsgroups: net.unix-wizards,net.bugs.4bsd Subject: Re: 4.2BSD restore(8) Message-ID: <1631@wucs.UUCP> Date: Thu, 1-May-86 15:54:47 EDT Article-I.D.: wucs.1631 Posted: Thu May 1 15:54:47 1986 Date-Received: Sat, 3-May-86 19:02:12 EDT References: <2066@hao.UUCP> <801@oliveb.UUCP> <974@tektools.UUCP> Reply-To: nz@wucs.UUCP (Neal Ziring) Distribution: net Organization: Washington U. Engineering Computer Lab Lines: 83 Keywords: 4.2BSD restore ctime Xref: watmath net.unix-wizards:17896 net.bugs.4bsd:2079 In article <974@tektools.UUCP> richl@tektools.UUCP (Rick Lindsley) writes: > In article <801@oliveb.UUCP> jerry@oliveb.UUCP (Jerry Aguirre) writes: > > I have also noticed that after a restore all the files marked as > > changed and will go on the next dump. [ ... ] > > If you really did just spend hours restoring the file system, then you > have restored all or virtually all of the file system. If you don't > want to do a level 0 dump, simply edit /etc/dumpdates to reflect > ... In fact, this problem is due to a quirk in a dump/restore, the restored files have the correct modification time, but their creation times are the time of the restore! Repeat-By: Put a file system on a dummy partition, and do a level 0 dump(8) of it. Wait a few minutes. Then, trash the partition and restore it fully from your dump. Change one file. Now, do a level 1 backup with dump(8). The backup should be extremely small (one file) but it isn't! It is the whole filesystem! To Fix: Change dump so that it looks only at the modification time, not the creation and modification times. Here is a diff for the file dump/dumptraverse.c. My change is bracketed by some #ifdef-#else-#endif.s, you can take those out if you like. *** /tmp/,RCSt1018628 Thu May 1 14:40:45 1986 --- dumptraverse.c Fri Apr 4 11:34:08 1986 *************** *** 38,43 BIS(ino, clrmap); if(f == IFDIR) BIS(ino, dirmap); if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) && !BIT(ino, nodmap)) { BIS(ino, nodmap); --- 38,44 ----- BIS(ino, clrmap); if(f == IFDIR) BIS(ino, dirmap); + #ifndef MTIME_ONLY if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) && #else if ((ip->di_mtime >= spcl.c_ddate ) && *************** *** 39,44 if(f == IFDIR) 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) { --- 40,48 ----- BIS(ino, dirmap); #ifndef MTIME_ONLY if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) && + #else + if ((ip->di_mtime >= spcl.c_ddate ) && + #endif !BIT(ino, nodmap)) { BIS(ino, nodmap); if (f != IFREG && f != IFDIR && f != IFLNK) { We use this modified version some of the time. I noticed the problem, and made the changes, after a series of disk crashes and fixes that required full restores. Boy, the next weekends backups were big! Hmmm... Anyway, I hope this is helpful to some folks out there. -- ...nz (Neal Ziring at WU ECL - we're here to provide superior computing.) {seismo,ihnp4,cbosgd}!wucs!nz OR nz@wucs.UUCP "You could get an infinite number of wires into this !*$$#!?! junction box, but we usually don't go that far in practice" -- Employee of London Electricity Board, 1959