Re: Recover stupid mistake

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

 



Mike Martin wrote:
> Hi when I was trying (and failing) to get a bootable pen-drive, with
> the F13 live image I accidentally did the following
> 
> dd if=/dev/zero of=/dev/sdb bs=512 count=1
> 
> which returned nearly immediately and now I have no data on the disk.

Which is a sick feeling. There isn't anyone who fiddles with stuff
who hasn't done something like that at least once.

> The disk is 750 gig , of which about 400 is used. I am hoping that
> only the partition table is gone, if not is there any way to recover
> from my disaster

Well, there are always backups, but let's see if there isn't
a way without having to go that far.

Presuming for the moment that /dev/sdb is a real disc, then
it appears that you have overwritten the first block of the
disc. If the disc had the standard (MSDOS) style format
as a whole, then you overwrote the Master Boot Record (MBR)
which contains both boot code and the Partition Table (PT).
The PT is not the only thing in the first block. However,
if you know how the disc was partitioned before the mistake,
and know what you had in the code portion of the MBR, then
it should be pretty easy to recover. Even if not, there are
tools which "look" for Boot Records (BRs) and attempt to figure
out what the original PT looked like. Using one of them may
give you a good start on reconstructing the PT portion of the
MBR.

It appears likely that you can recover fairly easily, if you
do know.

What was in the code portion? GRUB? How was the disc partitioned?

Anyway, the steps to recover are first to ascertain what your
partitions are and fix up the PT, then reinstall your boot
loader in the code portion of the MBR. If this disc is not used
for boot, then it's not necessary to replace the code portion,
though it's considered good practice to put code in there that
displays something like "this is not a boot disc".

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux