Virtual WORM device

John Bradford
2003-01-07T18:32:51Z

> There is a project waiting for someone who wants
> to contribute. It only slightly involves the kernel,
> but is quite useful.

> Somebody should then modify `rm` and the kernel unlink
> to `mv' files to the dumpster directory on the
> file-system, instead of really deleting them.

Another possibility would be to create a meta-device that works like a
cross between the loopback device, and WORM device, I.E. start at the
begining, and allocate sectors sequentially. Whenever a sector would
normally be overwritten, a new one is allocated instead. This way,
you could always access the filesystem as it was at any mount in time.

Hypothetically, you could do something like:

mkmetawormdevice /dev/mw0 /dev/hda2

to create a device /dev/mw0, which uses /dev/hda2 for physical
storage.

Then:

write foo to sector 0 of /dev/mw0 - actually writes foo to sector 0 of
/dev/hda2

write bar to sector 1 of /dev/mw0 - actually writes foo to sector 1 of
/dev/hda2

write foobar to sector 0 of /dev/mw0 - actually writes foobar to
sector 2 of /dev/hda2, and notes the date and time that the virtual
'overwrite' happened.

Due to the sequential nature of the writes, the data could even be
compressed quite easily.

John.