I made an oopsie- insofar as a filesystem with important data was overwritten as an LVM volume. I never actually wrote any data to the disk though, only hosed enough of the partition table to mark it as LVM. Is there any way to recover the contents of the disk?

Anything is better than nothing.

  • 1
    Whatever you do, your first step must be to backup your whole disk to another one with dd. – Sven Dec 5 '10 at 22:22

If you only overwrote the partition table, and remember the previous layout, you can just restore it. (Tip: always use sfdisk -O to save the partition table before doing anything possibly destructive.) As long as the start is the same and the end is at least as far as the filesystem extended, it will be fine.

If you can't remember the previous layout, TestDisk can automatically find the locations of your partitions.

If you've managed to write over part of the filesystem, then it becomes a little more challenging and depends on what the filesystem was.

  • Looks good so far.. it's found a partition which may have teh data I need. Failing that I'll have to see if I can dig it out from the other partition.. which I think will be an issue :/ – richo Dec 5 '10 at 22:32
  • Worked perfectly. Later discovered that the files were on a different machine, but I was not already aware of testdisk which is a BRILLIANT utility. Thanks Mate :) – richo Dec 6 '10 at 0:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.