Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
Whatever you do, your first step must be to backup your whole disk to another one with dd. –  SvW Dec 5 '10 at 22:22
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.