9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@gmx.de
To: 9fans@9fans.net
Subject: Re: [9fans] Disk backup?
Date: Mon, 25 Mar 2013 08:19:45 +0100	[thread overview]
Message-ID: <b554ab3d58d82e0786362357907ebace@rei2.9hal> (raw)
In-Reply-To: <CCCB7481-E1C0-4DA7-8A4E-1F2331F265F1@ar.aichi-u.ac.jp>

the block bitmap on a fakeworm is at the end of the sub
device/partition. see fworm.c:

int
fwormread(Device *d, Off b, void *c)
{
	Iobuf *p;
	Device *fdev;
	Devsize l;

	if(chatty > 1)
		fprint(2, "fworm read  %lld\n", (Wideoff)b);
	fdev = FDEV(d);
	l = devsize(fdev);
	l -= l/(BUFSIZE*8) + 1;
	if(b >= l)
		panic("fworm: rbounds %lld", (Wideoff)b);
	l += b/(BUFSIZE*8);

	p = getbuf(fdev, l, Brd|Bres);
	if(!p || checktag(p, Tvirgo, l))
		panic("fworm: checktag %lld", (Wideoff)l);
	l = b % (BUFSIZE*8);
	if(!(p->iobuf[l/8] & (1<<(l%8)))) {
		putbuf(p);
		fprint(2, "fworm: read %lld\n", (Wideoff)b);
		return 1;
	}
	putbuf(p);
	return devread(fdev, b, c);
}

the block tags do not really matter for the backup. you use the
fakeworm only as a backend for the cw device so you can just
copy all the blocks that got ther bit set in the bitmap compared
to the backup.

--
cinap



  reply	other threads:[~2013-03-25  7:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-24 22:10 trebol
2013-03-25  0:33 ` erik quanstrom
2013-03-25  2:04   ` trebol
2013-03-25  3:14     ` arisawa
2013-03-25  4:36       ` cinap_lenrek
2013-03-25  5:46         ` arisawa
2013-03-25  7:19           ` cinap_lenrek [this message]
2013-03-25  7:32             ` arisawa
2013-03-25 13:43         ` erik quanstrom
2013-03-25 15:03       ` erik quanstrom
2013-03-26  7:27         ` arisawa
2013-03-26 13:19           ` erik quanstrom
2013-03-26 18:34             ` cinap_lenrek
2013-03-26 18:56               ` erik quanstrom
2013-03-26 19:07                 ` cinap_lenrek
2013-03-26 19:10                   ` erik quanstrom
2013-03-26 19:15                   ` erik quanstrom
2013-03-26 19:23                     ` cinap_lenrek
2013-03-26  7:07     ` arisawa
2013-03-26 12:52       ` erik quanstrom
2013-03-26 23:22     ` trebol
2013-03-28  7:51       ` arisawa
2013-03-28 13:17         ` erik quanstrom

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=b554ab3d58d82e0786362357907ebace@rei2.9hal \
    --to=cinap_lenrek@gmx.de \
    --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).