Skip to contentSkip to conversation

Intercept write to disk

DISCUSSION Mishael A Sibiryakov 3 participants 4 messages May 26, 2006 – May 27, 2006

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 6 lines · Mishael A Sibiryakov

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

#2 lore raw
Quoted 10 lines · Bernd Eckenfels
Quoted 6 lines · Mishael A Sibiryakov

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.

#3 lore raw
Quoted 4 lines · Mishael A Sibiryakov

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.