LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-28-2007, 09:43 AM   #1
n123
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
MBR was filled with zeros


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
 
Old 08-28-2007, 10:06 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
There's a utlility called gpart, not to be confused with the partitioning tool, gparted. I haven't used gpart myself but it's purpose is to help recover your partition table if it gets corrupted. Here's an article that goes into gpart usage:

http://www.linux.com/articles/57748

I believe gpart is on knoppix and probably many other livecds.
 
Old 08-28-2007, 02:26 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You also need to restore the boot code (GRUB?). That can be done from the live CD. My guess is that you need to restore the partitions first.

Note that "MBR" and "boot sector" are not the same thing. The MBR is the first sector of a drive, and is not associated with any partition. Boot sector is the first sector of a partition. The code you showed would in fact erase the MBR.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, my / is 97% filled up adityavpratap Slackware 18 11-29-2005 08:13 PM
removing un-needed zeros from a number vb.net mrobertson Programming 4 09-12-2005 03:18 PM
Linux/windows frustrations/ how do I write zeros aeiou Linux - General 5 09-04-2004 09:08 PM
get zeros when i run make xconfig thematrimix Linux - Software 1 04-23-2004 04:43 PM
What if / is filled up? Manish Linux - Security 4 03-25-2002 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration