From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20120120160236.4c62c950@wks-ddc.exosec.local> References: <20120117140404.04923461@wks-ddc.exosec.local> <20120120000437.099dd3df@gmail.com> <20120120160236.4c62c950@wks-ddc.exosec.local> Date: Fri, 20 Jan 2012 18:04:35 +0100 Message-ID: From: hugo rivera To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] venti backup Topicbox-Message-UUID: 6019a15a-ead7-11e9-9d60-3106f5b1d025 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 > =C2=A0 =C2=A0isect isect1.img > =C2=A0 =C2=A0arenas arenas1.img > =C2=A0 =C2=A0bloom bloom1.img' | venti/conf -w arenas1.img > % venti/fmtindex arenas1.img > % venti=3D127.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=3Dmain version=3D1 blocksize=3D8192 tabsize=3D524288 > =C2=A0 =C2=A0buckets=3D16287 div=3D263706 > =C2=A0 =C2=A0sect=3Disect for buckets [0,16287) buckmax=3D215 arena=3Dare= nas0 at index [1048576,537903104) > =C2=A0 =C2=A0arena=3D'arenas0' on arenas1.img at [802816,537673728) > =C2=A0 =C2=A0version=3D5 created=3D1327069595 modified=3D1327069627 > =C2=A0 =C2=A0written: clumps=3D669 compressed clumps=3D600 data=3D4,251,7= 63 compressed data=3D1,174,341 storage=3D1,216,488 > =C2=A0 =C2=A0indexed: clumps=3D0 compressed clumps=3D0 data=3D0 compresse= d data=3D0 storage=3D0 > % venti/sync > % Kill venti | rc > % bc > 802816/8192 =3D 98 > 537673728/8192 =3D 65634 > 65634-98 =3D 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 > =C2=A0 =C2=A0isect isect2.img > =C2=A0 =C2=A0arenas arenas2.img > =C2=A0 =C2=A0bloom 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=3D127.1 > % venti/venti -c arenas2.img -m 20 -h tcp!127.1!8000 > term% hget http://127.1:8000/index > index=3Dmain version=3D1 blocksize=3D8192 tabsize=3D524288 > =C2=A0 =C2=A0buckets=3D16287 div=3D263706 > =C2=A0 =C2=A0sect=3Disect for buckets [0,16287) buckmax=3D215 arena=3Dare= nas0 at index [1048576,537903104) > =C2=A0 =C2=A0arena=3D'arenas0' on arenas2.img at [802816,537673728) > =C2=A0 =C2=A0version=3D5 created=3D1327069595 modified=3D1327069627 > =C2=A0 =C2=A0written: clumps=3D669 compressed clumps=3D600 data=3D4,251,7= 63 compressed data=3D1,174,341 storage=3D1,216,488 > =C2=A0 =C2=A0indexed: clumps=3D0 compressed clumps=3D0 data=3D0 compresse= d data=3D0 > =C2=A0 =C2=A0storage=3D0 > > 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 > --=20 Hugo