2006-05-26 20:52:41

by Mishael A Sibiryakov

[permalink] [raw]
Subject: Intercept write to disk


Hi.

Probably i have a stupid question but i can't find adequate solution for
it. I want to intercept write to real disk partition or entire disk
(except of swap partition of course). As i understood vfs and Co i think
that i need to work on level between fs driver and disk driver. But it's
unclean for me. Please tell me is it possible and if possible then say
how or put me to some documentation.

I need a offset from start or CHS value with buffer for save it.


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2006-05-26 21:21:46

by be-news06

[permalink] [raw]
Subject: Re: Intercept write to disk

Mishael A Sibiryakov <[email protected]> wrote:
> Probably i have a stupid question but i can't find adequate solution for
> it. I want to intercept write to real disk partition or entire disk
> (except of swap partition of course). As i understood vfs and Co i think
> that i need to work on level between fs driver and disk driver. But it's
> unclean for me. Please tell me is it possible and if possible then say
> how or put me to some documentation.

You can write a devmapper module, or maybe pre-load a shared user mode
library.

Gruss
Bernd

2006-05-26 21:40:43

by Mishael A Sibiryakov

[permalink] [raw]
Subject: Re: Intercept write to disk

On Fri, 2006-05-26 at 23:21 +0200, Bernd Eckenfels wrote:
> Mishael A Sibiryakov <[email protected]> wrote:
> > Probably i have a stupid question but i can't find adequate solution for
> > it. I want to intercept write to real disk partition or entire disk
> > (except of swap partition of course). As i understood vfs and Co i think
> > that i need to work on level between fs driver and disk driver. But it's
> > unclean for me. Please tell me is it possible and if possible then say
> > how or put me to some documentation.
>
> You can write a devmapper module, or maybe pre-load a shared user mode
> library.

Hm, i need a somthing transparent, this tool is for make image of entire
disk/partition on fly. Because tool is get some time for work i need to
store changes between start and end of the process for append it to
image. Probably i thinking in wrong way and i need a something else.


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2006-05-27 07:24:25

by Michael Raskin

[permalink] [raw]
Subject: Re: Intercept write to disk

Mishael A Sibiryakov wrote:
> Hm, i need a somthing transparent, this tool is for make image of entire
> disk/partition on fly. Because tool is get some time for work i need to
> store changes between start and end of the process for append it to
> image. Probably i thinking in wrong way and i need a something else.

Maybe you want to back up a partition as it was at some moment in the
past (exactly)? Then you have to make a device-mapper-snapshot out of
it. You need to install device-mapper module and userspace tools, and
make the following: original device is never used directly; instead a
snapshot-origin mapping is made of it and is always used. When you need
snapshot, you create a file (on another partition, of course; maybe even
in the memory if you are sure you will do everything quickly enough),
make it a loopback device, and make a snapshot out of snapshot-origin
you have and this loopback for changes rollback. Maybe it is also better
to mount -o remount,sync the device for the time of creating snapshot
device in order to have less problems with consistency. And remount it
back when you start copying.