A few days ago the svn database we use for our web pages
became corrupt. This was after the machine hung and had
to be reset. Svn was NOT being used at the time of the
reset and I don't know for a fact that the reset was the cause.
System: Mac OS X 10.3.7
Svn: 1.1.2 served via svnserve
error message from svnlook youngest webrep:
svn: Berkeley DB error while checkpointing after Berkeley DB transaction for filesystem webrep/db:
svn: bdb: DB_ENV->log_flush: LSN of 32/1821 past current end-of-log of 31/1033488
svn: bdb: Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment
svn: bdb: nodes: unable to flush page: 0
svn: bdb: txn_checkpoint: failed to flush the buffer cache Invalid argument
With help from http://svn.haxx.se/users/archive-2004-11/1476.shtml
I was able to recover the database. I list the exact steps here
in the hope of helping other unix wienies. You will need to substitute
your own names and paths.
BTW: I am not a member of this mailing list. I read it via the
rm __db* log.*
svnlook youngest webrep
rm __db* log.*
svnadmin dump webrep > webrepdump
* Dumped revision 0.
* Dumped revision 38
(perhaps what is important is to do the dump right
after a recover and not after a look)
mv webrep webrepJunk
svnadmin create webrep
svnadmin load webrep < webrepdump
cp webrepJunk/conf/* webrep/conf/
?? could the load have been into original webrep dir ??
Back this puppy up:
tar -czf webrep050109.tgz webrep/
My first attempt similar to the above failed so I devised and partly
tested the following scheme. I list this here just in case it becomes
necessary in the future. My latest checked out files were in
a directory named WebSource5.
To update the latest svn backup with current files
after a database corruption:
a. Restore db directory from backup.
Check permissions and fix if needed
b. Archive latest checkout.
c. Remove all .svn directories from latest checkout:
find . -name '.svn' -print | xargs rm -r
d. Create tarball
tar -czf latest.tgz WebSource5/
e. Remove and recreate checkout:
rm -r WebSource5
svn co svn://yourhost/your/path
f. Remove everything except .svn dirs:
find . -name "*\.?*" -not -path "*\.svn*" -print0 | xargs -0 rm
g. untar into purged dir:
tar -xzf latest.tgz
h. Use svn to check in changes since last backup
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Tue Jan 11 00:12:00 2005