Click to See Complete Forum and Search --> : Im in hell. Really. Critical bootblock damage.


schopenhauer101
01-14-2005, 01:21 AM
Sorry, just saw i posted this at the wrong place. Maybe someone can help me anyway?
---------------------------------------------------------------

Sigh!

I have deleted the MBR. Yes i know, then everything is lost and unrepairable.

*BUT, the thing is that i have not yet booted my computer yet*.

When i do all will be gone forever, hda1, hda2, hda3, all of it. No harddisk recovery program will ever get the system back. I have (had?) a dualbootsystem that i have optimised for a half year or so. I feel sick when i think about it. But now everything works nice, i can access all partitions everything is still here, exept when i take a look on hda with qtparted. Then hda ofcourse is totally unreadable, because it tries to read from the actual master boot record (and not from memory and the post-booted info on disk.)

THE QUESTION :
Is there anyway that i can copy the data my computer is aware of right now when it still is unbooted and put it on the mbr? Something in the /boot folder? Anything that would make it possible to once more see that lovely Debian dualbootscreen once more? Can i make a startupdisk with the help of grub? And then copy the floppy to the hda bootblock?

How did this happend?
I was going to to copy a image of the mbr of my external drive to that very drive(sda1) but by fatal error i copied to hda. Adios partitions.

The limits of language fails to express how grateful i would be if someone could offer a glimpse of salvation out of this depressing mess.

Thanks for reading this,
Björn.

Gertrude
01-14-2005, 02:22 AM
Why can't you just rewrite to the MBR with the correct partition info? Just because the MBR is messed up wont cause all the data, and partitions on the HDD to be deleted when you reboot the computer. You just wont be able to boot up normally. If you did reboot you could always use a live cd to boot back in, mount the partitions then write to the mbr.

bwkaz
01-14-2005, 07:54 PM
Originally posted by Gertrude
...mount the partitions then write to the mbr. You do NOT want partitions mounted when you write to the MBR, if you can help it... ;) (And in fact, since the partitions don't exist, they won't mount either.) For example, if you resize a partition, the kernel won't see the change in partition extents until you reboot (unless you don't have any partition anywhere on the disk mounted).

Of course, in this case, where the MBR is overwritten, you don't want to unmount anything, because the kernel won't be able to find it again to remount it, so this is one case where rewriting the partition table without unmounting the FSes is a must. But in general, if you do it from a boot CD, you won't want the FSes mounted.

Anyway, If you still haven't shut down, you can use parted's rescue command to:

rescue START END -- rescue a lost partition near START and END (that quote is from parted's help command). I don't know if qtparted has an equivalent, but I would guess that it does.

Basically, you need to know approximately where on your drive the partitions all started and ended. If you know that, parted will search near those locations for something that tells it "yes, I've found the start of a partition". For logical partitions, this is an actual partition table signature. For primary partitions (hda1 through hda4), it's something else (I think -- it may not be supported, I've never tried it).

ehawk
01-14-2005, 08:49 PM
http://www.faqs.org/docs/Linux-mini/Partition-Rescue.html

http://users.dslextreme.com/~craig.lawson/linux_notes/recovery.html

leonpmu
01-15-2005, 12:22 AM
bwkaz, are you sure?? The MBR and Partition table are not the same things, I have nuked my MBR a couple of times and had no problems building a new one Gertrude said, unless our user has nuked his partition table, which another thing altogether....

happybunny
01-15-2005, 01:09 AM
yeah...dont take my word for it but rebuilding the mbr is easy, right....well in windows anyway....
fdisk /mbr

No data lose, just get a new boot record written to the zero block of the HD.

Also....are you networked? network connect and remove the data to be sure.

bwkaz
01-15-2005, 11:11 AM
Originally posted by leonpmu
bwkaz, are you sure?? Yes. ;)

The MBR and Partition table are not the same things, Except that they are close enough. :p

The partition table is held within the last 66 bytes of the MBR (well... the last 2 bytes are the partition table signature bytes, so they're not really part of the table itself). If you overwrite the entire 512 bytes of the MBR with the MBR from another disk, you WILL also overwrite the partition table.

fdisk /mbr will only rewrite the bootloader portion of the MBR (the first 446 bytes), not the partition table itself. fdisk in normal mode will rewrite the partition table, when you tell it to modify the list of partitions.