Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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
up vote 3 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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