9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] old fossil vac scores
  2003-03-26 16:38 [9fans] old fossil vac scores rog
@ 2003-03-26 16:37 ` Fco.J.Ballesteros
  2003-03-26 16:53   ` Russ Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Fco.J.Ballesteros @ 2003-03-26 16:37 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

I use the vac command from fossilcons(8)
to print (lp ☺) the vac numbers when I dump the
venti arenas to cdroms.

I think that does what you want.

[-- Attachment #2: Type: message/rfc822, Size: 1187 bytes --]

From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: [9fans] old fossil vac scores
Date: Wed, 26 Mar 2003 16:38:32 0000
Message-ID: <233d7344eb001abe8b9a41684c738596@vitanuova.com>

is it possible to find out a vac score that was printed
out previously from snap -a and not recorded?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] old fossil vac scores
@ 2003-03-26 16:38 rog
  2003-03-26 16:37 ` Fco.J.Ballesteros
  0 siblings, 1 reply; 9+ messages in thread
From: rog @ 2003-03-26 16:38 UTC (permalink / raw)
  To: 9fans

is it possible to find out a vac score that was printed
out previously from snap -a and not recorded?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
  2003-03-26 16:37 ` Fco.J.Ballesteros
@ 2003-03-26 16:53   ` Russ Cox
  0 siblings, 0 replies; 9+ messages in thread
From: Russ Cox @ 2003-03-26 16:53 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

Also you can do

fn h2d { echo 'ibase=16;' print `{echo $1|tr a-z A-Z} |bc }
header=`{dd -bs 1024 -iseek 128 -count 1 -if /dev/sdC0/fossil | xd -b | sed 1q}
bsize=`{h2d $header(8)^$header(9)}
super=`{h2d 0$header(10)^$header(11)^$header(12)^$header(13)}
dd -bs $bsize -iseek $super -count 1 -if /dev/sdC0/fossil | xd -b |
	sed '1,2d;3s/^.......  .. .. //;4s/^.......  (.. .. .. .. .. ..).*/\1/;4q' | tr -d ' '

to get the most recent one, though I like nemo's way better.

[-- Attachment #2: Type: message/rfc822, Size: 2954 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 152 bytes --]

I use the vac command from fossilcons(8)
to print (lp ☺) the vac numbers when I dump the
venti arenas to cdroms.

I think that does what you want.

[-- Attachment #2.1.2: Type: message/rfc822, Size: 1187 bytes --]

From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: [9fans] old fossil vac scores
Date: Wed, 26 Mar 2003 16:38:32 0000
Message-ID: <233d7344eb001abe8b9a41684c738596@vitanuova.com>

is it possible to find out a vac score that was printed
out previously from snap -a and not recorded?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
  2003-03-27  8:49   ` Fco.J.Ballesteros
@ 2003-03-27 13:51     ` Russ Cox
  0 siblings, 0 replies; 9+ messages in thread
From: Russ Cox @ 2003-03-27 13:51 UTC (permalink / raw)
  To: 9fans

> Does that mean that `vac /archive/2003' gives a score that
> is not useful for flfmt -v?

Yes it does.  The archive that gets printed by
vac /archive/2003/0123 is only for that tree.
The vac scores printed by the archiver are for
the entire tree (rooted at /).

Compare mounting each with vacfs and you'll see.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
  2003-03-27  3:26 ` Russ Cox
@ 2003-03-27  8:49   ` Fco.J.Ballesteros
  2003-03-27 13:51     ` Russ Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Fco.J.Ballesteros @ 2003-03-27  8:49 UTC (permalink / raw)
  To: 9fans

> good point.  most of that is paged out of my brain.
> the tree you get from running a vac command is only
> for the root of the active file system on that day.

Does that mean that `vac /archive/2003' gives a score that
is not useful for flfmt -v?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
  2003-03-26 19:21 rog
@ 2003-03-27  3:26 ` Russ Cox
  2003-03-27  8:49   ` Fco.J.Ballesteros
  0 siblings, 1 reply; 9+ messages in thread
From: Russ Cox @ 2003-03-27  3:26 UTC (permalink / raw)
  To: 9fans

> i'd assumed that wasn't possible because the shape of
> the vac archive you get is different between a vac
> as produced by
> 
> 	vac /archive
> 
> and that produced after a snap -a.
> 
> the former is rooted at /archive (as you might expect);
> the latter contains /active, /snapshot and /archive
> directories in its root.
> 
> it's quite possible fltmt is clever about this, but given
> the comment in the man page, i doubt it.

good point.  most of that is paged out of my brain.
the tree you get from running a vac command is only
for the root of the active file system on that day.

the one printed after an archive step has the 
entire fs -- snap, dump, and active (though snap
doesn't work since it has pointers to data in the
write buffer).

here's a better version of the script i posted earlier.
run lastfossil to get the most recent score, and then
vacchain to work your way back to what you want.

# To unbundle, run this file
echo /usr/rsc/bin/rc/vacchain
sed 's/.//' >/usr/rsc/bin/rc/vacchain <<'//GO.SYSIN DD /usr/rsc/bin/rc/vacchain'
-#!/bin/rc
-
-rfork e
-
-switch($#*){
-case 1
-	vac=$1
-case *
-	echo 'usage: vacchain vac:score' >[1=2]
-	exit usage
-}
-
-if(! ~ $vac vac:????????????????????????????????????????){
-	echo bad score >[1=2]
-	exit 'bad score'
-}
-
-score=`{echo $vac | sed 's/vac://'}
-
-tmp=/tmp/vacchain.$pid
-fn die{
-	echo $* >[1=2]
-	rm -f $tmp
-	exit ''
-}
-nl='
-'
-while(){
-	echo vac:$score
-	if(! venti/read $score 1 >$tmp)
-		die could not find $score
-	if(! ~ `{ls -l $tmp | awk '{print $6}'} 300)
-		die block $score too short
-	score=`{dd -bs 1 -iseek 280 -count 20 -if $tmp >[2]/dev/null |
-		xd -b | sed 's/^.......(  )?//' | tr -d $nl^' '}
-}
//GO.SYSIN DD /usr/rsc/bin/rc/vacchain
echo /usr/rsc/bin/rc/lastfossil
sed 's/.//' >/usr/rsc/bin/rc/lastfossil <<'//GO.SYSIN DD /usr/rsc/bin/rc/lastfossil'
-#!/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)
-
//GO.SYSIN DD /usr/rsc/bin/rc/lastfossil



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
@ 2003-03-26 19:21 rog
  2003-03-27  3:26 ` Russ Cox
  0 siblings, 1 reply; 9+ messages in thread
From: rog @ 2003-03-26 19:21 UTC (permalink / raw)
  To: 9fans

> I dont understand. AFAIK, you rewind to one of /archive/....,
> and they have a score printed by vac.
> I think you can use that score to call flfmt (would really
> like to know if I'm mistaken :-) ).

i'd assumed that wasn't possible because the shape of
the vac archive you get is different between a vac
as produced by

	vac /archive

and that produced after a snap -a.

the former is rooted at /archive (as you might expect);
the latter contains /active, /snapshot and /archive
directories in its root.

it's quite possible fltmt is clever about this, but given
the comment in the man page, i doubt it.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
  2003-03-26 17:53 rog
@ 2003-03-26 18:19 ` Fco.J.Ballesteros
  0 siblings, 0 replies; 9+ messages in thread
From: Fco.J.Ballesteros @ 2003-03-26 18:19 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

I dont understand. AFAIK, you rewind to one of /archive/....,
and they have a score printed by vac.
I think you can use that score to call flfmt (would really
like to know if I'm mistaken :-) ).

[-- Attachment #2: Type: message/rfc822, Size: 1536 bytes --]

From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] old fossil vac scores
Date: Wed, 26 Mar 2003 17:53:27 0000
Message-ID: <664e1d8999ebe8d577a9a044ee14c160@vitanuova.com>

> Also you can do
[...]
> to get the most recent one, though I like nemo's way better.

unfortunately, as far as i can see, it's not possible to get the vac
command to print a score for the entire arena as expected by flfmt -v,
so nemos solution doesn't cut it for me.

i was just wondering if it was possible to rewind the entire fossil
state to a previously archived state without keeping track of all
those scores externally.

  rog.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] old fossil vac scores
@ 2003-03-26 17:53 rog
  2003-03-26 18:19 ` Fco.J.Ballesteros
  0 siblings, 1 reply; 9+ messages in thread
From: rog @ 2003-03-26 17:53 UTC (permalink / raw)
  To: 9fans

> Also you can do
[...]
> to get the most recent one, though I like nemo's way better.

unfortunately, as far as i can see, it's not possible to get the vac
command to print a score for the entire arena as expected by flfmt -v,
so nemos solution doesn't cut it for me.

i was just wondering if it was possible to rewind the entire fossil
state to a previously archived state without keeping track of all
those scores externally.

  rog.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-03-27 13:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-26 16:38 [9fans] old fossil vac scores rog
2003-03-26 16:37 ` Fco.J.Ballesteros
2003-03-26 16:53   ` Russ Cox
2003-03-26 17:53 rog
2003-03-26 18:19 ` Fco.J.Ballesteros
2003-03-26 19:21 rog
2003-03-27  3:26 ` Russ Cox
2003-03-27  8:49   ` Fco.J.Ballesteros
2003-03-27 13:51     ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).