9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: hugo rivera <uair00@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] venti backup
Date: Fri, 20 Jan 2012 18:04:35 +0100	[thread overview]
Message-ID: <CAFo14L2tVVNR12+r8SWXAkcP1JYiW=L4KW7Fi=wvEkYDXn5Z6Q@mail.gmail.com> (raw)
In-Reply-To: <20120120160236.4c62c950@wks-ddc.exosec.local>

Thanks a lot, David, for your detailed reply.
I've followed your indications and now I am able to recover from my
venti backup :-)
I must confess that I am puzzled, because some sizes and most seeks
for dd are off by 1 block from what I expect. Particulary,
why do you
% dd -if arenas2.img -of arenapart -bs 8192 -count 97
% dd -if arenas1.img -of arenas -bs 8192 -iseek 97 -count 65536
when the first arena starts after 98 blocks from the beginning of the file?

2012/1/20 David du Colombier <0intro@gmail.com>:
>> that's only 98 blocks of 8192 bytes, not 128 as you mention.
>
> Sorry, I got confused. It's 98 blocks on arena partition and
> 128 blocks on isect partition.
>
> I just tried. This is what I did.
>
> The goal is to manually recopy the first arena from
> the first Venti (arenas1.img) to the second Venti (arenas2.img).
>
> It will work for you as long as you adjust the partition
> names, the number of arenas and the sizes.
>
> # first venti
>
> % dd -if /dev/zero -of arenas1.img -bs 8192 -count 131072
> % dd -if /dev/zero -of isect1.img -bs 8192 -count 16384
> % dd -if /dev/zero -of bloom1.img -bs 8192 -count 8192
> % venti/fmtarenas arenas arenas1.img
> % venti/fmtisect isect isect1.img
> % venti/fmtbloom bloom1.img
> % echo 'index main
>    isect isect1.img
>    arenas arenas1.img
>    bloom bloom1.img' | venti/conf -w arenas1.img
> % venti/fmtindex arenas1.img
> % venti=127.1
> % venti/venti -c arenas1.img -m 20 -h tcp!127.1!8000
> % vac /sys/src/9/pc
> % hget http://127.1:8000/index
> index=main version=1 blocksize=8192 tabsize=524288
>    buckets=16287 div=263706
>    sect=isect for buckets [0,16287) buckmax=215 arena=arenas0 at index [1048576,537903104)
>    arena='arenas0' on arenas1.img at [802816,537673728)
>    version=5 created=1327069595 modified=1327069627
>    written: clumps=669 compressed clumps=600 data=4,251,763 compressed data=1,174,341 storage=1,216,488
>    indexed: clumps=0 compressed clumps=0 data=0 compressed data=0 storage=0
> % venti/sync
> % Kill venti | rc
> % bc
> 802816/8192 = 98
> 537673728/8192 = 65634
> 65634-98 = 65536
>
> # second venti
>
> % dd -if /dev/zero -of arenas2.img -bs 8192 -count 65633
> % dd -if /dev/zero -of isect2.img -bs 8192 -count 16384
> % dd -if /dev/zero -of bloom2.img -bs 8192 -count 8192
> % venti/fmtarenas arenas arenas2.img
> % venti/fmtisect isect isect2.img
> % venti/fmtbloom bloom2.img
> % echo 'index main
>    isect isect2.img
>    arenas arenas2.img
>    bloom bloom2.img' | venti/conf -w arenas2.img
> % venti/fmtindex arenas2.img
> % dd -if arenas2.img -of arenapart -bs 8192 -count 97
> % dd -if arenas1.img -of arenas -bs 8192 -iseek 97 -count 65536
> % cat arenapart arenas > arenas2.img
> % rm -f arenapart arenas
> % venti/buildindex -b arenas2.img
> 0 clumps, 16,287 buckets
> 2012/0120 14:29:29 read index
> venti/buildindex: brand-new index, no work to do
> 2012/0120 14:29:29 arena arenas0: 669 entries
> % venti=127.1
> % venti/venti -c arenas2.img -m 20 -h tcp!127.1!8000
> term% hget http://127.1:8000/index
> index=main version=1 blocksize=8192 tabsize=524288
>    buckets=16287 div=263706
>    sect=isect for buckets [0,16287) buckmax=215 arena=arenas0 at index [1048576,537903104)
>    arena='arenas0' on arenas2.img at [802816,537673728)
>    version=5 created=1327069595 modified=1327069627
>    written: clumps=669 compressed clumps=600 data=4,251,763 compressed data=1,174,341 storage=1,216,488
>    indexed: clumps=0 compressed clumps=0 data=0 compressed data=0
>    storage=0
>
> Honestly, I think you should just use venti/wrarena to write
> backed up arenas to a running Venti. It's much easier.
>
> --
> David du Colombier
>



-- 
Hugo



  reply	other threads:[~2012-01-20 17:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 12:34 hugo rivera
2012-01-17 13:02 ` Steve Simon
2012-01-17 13:14   ` hugo rivera
2012-01-17 13:04 ` David du Colombier
2012-01-19 16:11   ` hugo rivera
2012-01-19 16:45     ` David du Colombier
2012-01-19 23:04     ` David du Colombier
2012-01-20 11:03       ` hugo rivera
2012-01-20 15:02         ` David du Colombier
2012-01-20 17:04           ` hugo rivera [this message]
2012-01-20 18:19             ` David du Colombier
2012-01-20 19:10               ` hugo rivera
2012-01-20 22:39                 ` David du Colombier
2012-01-23 10:28                   ` hugo rivera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFo14L2tVVNR12+r8SWXAkcP1JYiW=L4KW7Fi=wvEkYDXn5Z6Q@mail.gmail.com' \
    --to=uair00@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).