dm-lazymirror advice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have recently been writing a blog article on hard disk recovery, and think I have found an approach that would lend itself to a device mapper.

The idea is this:
Most tools currently try and copy the whole hard disk as best they can using an approach like ddrescue, this seems inefficient and risky if your disk is only partially used and you think it is about to fail (you've just replaced the heads for example).
Really what you want to recover first are the users' most important files, but to get to those first you need to read the partition table and filesystem(s) of which there are many to choose from. Of course you can access the filesystems using any number of tools like testdisk, fdisk, fsck, etc, but you don't get a copy. I think it would be most efficient to copy every disk access on the origin device to a backup device just in case the origin disk fails, but in a filesystem-agnostic way. Of course I'm talking of reads mostly, but also maybe writes if for example testdisk has been able to repair the partition table.

Having had a good search for a method of doing this, the closest available seems to be dm-cache. Having set the sequential_threshold and random_threshold both to 0, I assume dm-cache will copy all origin accesses to the cache device, and keep a record of the blocks in the cache and their physical location on the origin in the metadata device. This is very close, but to be able to restore the backup copy I need to be able to parse the metadata and reconstruct the copy in userspace.

Questions:
  1. Does this seem to be a good match for a device mapper or is there a better way of doing this?
  2. Would this be best placed as a new device-mapper target or could this be implemented as a new operating mode or policy of an existing dm target?
  3. Are there any userspace tools planned for the dm-cache metadata (like thin-provisioning-tools), and if not which kernel files would I look in as a start to writing a parser?
In 'cache.txt' it states: "The target reuses the metadata library used in the thin-provisioning library." but I tried those tools and they didn't appear to work, failing with "bad checksum in superblock".

I would be interested in writing some kernel code since I do know C, but having never written any kernel code before I feel this might be a rather steep learning curve. I rather feel that my skills might be best placed writing a parser instead. I think at first I should at least prove the concept!

Many thanks in advance, and keep up the excellent work. I'm a long-time Linux user, since Redhat 5.2 I think!
Regards,
Richard
--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux