-   Linux - Newbie (
-   -   I think I corrupted MBR by copying to /dev/sdb1 (

locksoflove 05-15-2010 06:43 AM

I think I corrupted MBR by copying to /dev/sdb1
Dear all,
rather by accident, I copied a file to a USB drive by saying

cp <file> /dev/sdb1

rather than

cp <file> /media/USBDISK

I was surprised that this was at all possible (without root privileges and all), but now the drive cannot be mounted.

I did a

dd if=/dev/sdb of=corrupted.disk

but I don't know how to recover the data.

Any help appreciated.


unSpawn 05-15-2010 07:45 AM

Overwriting part of a filesystem structure with the contents of a file is a good way to destroy that filesystem structure. Since you haven't posted any disk, partition, file size and filesystem details I can only suggest you run 'testdisk /debug /log /path/to/corrupted.disk' to see if you can examine, and possibly salvage, remaining contents of the partition.

pixellany 05-15-2010 09:14 AM

I hope you ran that dd command so that "corrupted.disk" went to a different physical drive.

Regardless, do not do anything to that drive that could cause a write. If the OS is on there, then do not boot it. Mount the drive in another computer such that you control any use of it. (Or simply boot the current computer from a different physical drive.

One standard advice is to first clone the problem drive. If that "corrupted.disk" file is on another drive, then you have done this. BUT---check to be sure the file is the right size. It should be equal to the total capacity of the drive, regardless of how it is partitioned, or what data is on it.

In addition to testdisk, the other standard tool is photorec (both from the same author)

Not really relevant, but writing to partition as you describe should not affect the MBR.

All times are GMT -5. The time now is 10:34 AM.