Results 1 to 4 of 4
hi all
today i used a live cd version of linux and boot with it.
first i use this command:
" dd if=/dev/hda of=/mnt/hda.0 bs=512 count=1 "
and then this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-28-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 1
my MBR was filled with zero
hi all
today i used a live cd version of linux and boot with it.
first i use this command:
" dd if=/dev/hda of=/mnt/hda.0 bs=512 count=1 "
and then this command on my computer :
" dd if=/mnt/0.0 of=/dev/hda bs=512 count=1 "
0.0 is a text file with all zeros and has 512 bytes size.
but i forgot to save "hda.0" on a floppy disk to restore it later on MBR and reboot my computer. so this file was fully lost.
now the MBR was filled with "0", and i missed all of my partitions and OSes on my computer.
is there any trick or software , etc to restore the original my boot sector and partitios table on my computer.
thanks all
n123
- 08-28-2007 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,733
Welcome to the forums!

Try using the Parted Magic LiveCD:
Parted Magic
It comes with TestDisk, a tool that might be able to recover your partition tables. Check the website above for documentation.
Let us know how it goes.oz
- 08-28-2007 #3forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,733
I should add that if your hard drive was totally wiped, the Parted Magic LiveCD and TestDisk probably won't work.
As far as restoring the MBR goes, the SuperGrub LiveCD is a good tool for restoring that:
Super Grub Disk Webpage: Home Page
However, it probably won't do much either if the drive was wiped clean.oz
- 08-28-2007 #4Linux Newbie
- Join Date
- Dec 2005
- Location
- Toronto
- Posts
- 127
Why would you do something like that !!first i use this command:
" dd if=/dev/hda of=/mnt/hda.0 bs=512 count=1 "
and then this command on my computer :
" dd if=/mnt/0.0 of=/dev/hda bs=512 count=1 "
0.0 is a text file with all zeros and has 512 bytes size.
but i forgot to save "hda.0" on a floppy disk to restore it later on MBR and reboot my computer. so this file was fully lost.
now the MBR was filled with "0", and i missed all of my partitions and OSes on my computer.
First, you backup your MBR and later write 0s to the MBR and then, you want to write the backed up MBR. This just don't make sense. In the end, you're going to get that same MBR, eh ?
I guess, you learnt your lesson. Sure, you're gonna be careful next time you decide to deal with MBR and partition tables etc.
If it's only the MBR that you've overwritten, testdisk might be able to recover your partitions. Give it a try. If you've had changed the partition layout, before the one you lost, testdisk will present you with all the possible partitions. In other words, testdisk will look for a magic word and a valid partition table data and will assume it to be a partition and include that in the list. So, if you've played with the partitions before, changing the sizes etc. you will likely to get a long list inclusing more partitions than you previously had. If this happens to you, you will need to know the approximate sizes of the partitions you had before you wiped out the MBR. Select them and test disk should write the partition table to MBR. Make sure you save the undo information that testdisk offers you to save. SHould you do anything wrong, you can undo the changes and restart....
Good luck !
PS: There's another way of recovering your partitions. For that, you will need to manually look for Boot Sectors and partition tables and code the partition table yourself. That's what I did when I lost my partitions a while long ago. The credit for destroying my partitions shall go to stupid windoz !!


Reply With Quote
