From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <816a43e64340b5f06e1299d88e1b9943@plan9.escet.urjc.es> To: 9fans@cse.psu.edu Subject: Re: [9fans] simple venti question. From: Fco.J.Ballesteros In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 4 Feb 2004 08:23:38 +0100 Topicbox-Message-UUID: ccfc3e96-eacc-11e9-9e20-41e7f4b1d025 > Do I take the lastest or the firstest vac that gets printed when I do the > 8.printarenas ? Regarding the vac for your fossil, perhaps you could use the script from rsc that I include below to print the last fossil vac number, and then do a fossil/flfmt -v using that vac to recover from venti. > err 2: mistmatched number index sections: found 2 expected 1 > fatal venti error blah blah blah I've never seen this. I think that it's just that your venti index is wrong. But from the man page it seems that you'd better try venti/checkindex and then venti/buildindex, should checkindex fail. venti/checkindex [ -f ] [ -B blockcachesize ] venti.config tmp venti/buildindex [ -B blockcachesize ] [ -Z ] venti.config tmp Buildindex .... This command is typically used to build a new index for a Venti system when the old index becomes too small, or to rebuild an index after media failure. Checkindex examines the Venti index described in venti.config. The program detects various error conditions including: blocks that are not indexed, index entries for blocks that do not exist, and duplicate index entries. If requested, an attempt can be made to fix errors that are found. #!/bin/rc rfork e switch($#*){ case 0 file=/dev/sdC0/fossil case 1 file=$1 case * echo 'usage: lastfossil [/dev/sdC0/fossil]' >[1=2] exit usage } fn h2d { echo 'ibase=16;' print `{echo $1|tr a-z A-Z} |bc } header=`{dd -bs 1024 -iseek 128 -count 1 -if $file >[2]/dev/null| xd -b | sed 1q} bsize=`{h2d $header(8)^$header(9)} super=`{h2d 0$header(10)^$header(11)^$header(12)^$header(13)} x=`{dd -bs $bsize -iseek $super -count 1 -if $file >[2]/dev/null | xd -b | sed '1,2d;3s/^....... .. .. //;4s/^....... (.. .. .. .. .. ..).*/\1/;4q' | tr -d ' '} echo vac:^$x(1)^$x(2)