LinuxQuestions.org
Review your favorite Linux distribution.
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 12-29-2006, 06:53 PM   #1
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211

Rep: Reputation: 32
want to nuke the MBR & create new MBR


I've been struggling with this one all last night and all day today. Any help greatly appreciated.


So, I am trying to get a (Debian) Myth box to startup. I installed it via the KnoppMyth disc. But those distro's aren't the issue. The problem is the previous MBR wouldn't leave. KnoppMyth failed to overwrite the previous Mandriva bootloader. So out of desperation, I downloaded and installed something called "Partition Boot Manager" which is a shareware product. Now on startup, the Partition Boot Manager fails and exits saying to boot the install disk and choose "repair" which is an option absent from that disk.

I have reformatted this 300gb hard drive several times now trying to clean it using Partition Magic and Gparted. Tools I have at my disposal include a seperate Windows XP computer that I can hook this hard drive to via a USB 2.0 housing. The 300gb hard drive is the ONLY drive in the Myth box and contains no data of value. I have various Linux discs like Mandriva 2006, Knoppix 5.0, Insert, etc.

I have also booted from the INSERT disc and run commands like "grub-install -e1 /dev/hdc1 " without error, but no success on reboot. A nice person on the Myth forums suggested "dd if=/dev/zero of=/dev/hdc1 bs=512 count=8" which also executes fine, but doesn't destroy the MBR..

If you can offer the most extreme suggestion short of microwaving this entire computer, I'll try it.

Appreciatively,

di11rod
 
Old 12-29-2006, 08:03 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Is /dev/hdc1 the correct place to install GRUB. On most systems that would mean "the first partition of the third mounted HD." GRUB can use its own drive designations: Try
Code:
# grub
> root (hd<tab> # to see the list of available hard drives (<tab> means "press the tab key")
> install (hd0) # assuming that's the only drive shown.
> quit
or, once you know how GRUB wants to refer to the drive, try grub-install (hd0) (assuming that hd0 is the correct GRUB drive designation.

Check the BIOS settings: You may have "virus protection," or a similar option, enabled. Did you try zeroing (or rewriting) the MBR from the XP system? (If you have a Linux "Live DVD" you could even run Linux on the XP box to redo the MBR from there.)

Also, check you HD drive jumpers. It's possible (although I've never heard of this) that some jumper setting is "protecting" the HD MBR.

Alternatively, you may have a brain-dead BIOS like the one on this laptop that won't boot unless XP is installed. (You don't have to use it, but you have to boot to it, so I have a dual-boot laptop with wasted space on the HD. But that's just a rant about Gateway, nothing to do with your problem,)

<edit> Sorry for the edits -- the cat is "helping" me type today . . .</edit>

Last edited by PTrenholme; 12-29-2006 at 08:11 PM.
 
Old 12-29-2006, 08:49 PM   #3
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by PTrenholme

Did you try zeroing (or rewriting) the MBR from the XP system? (If you have a Linux "Live DVD" you could even run Linux on the XP box to redo the MBR from there.)
How should I do that? I was afraid to do anything to the MBR while booted in XP on my other computer (with the 300gb drive connected externally) because I didn't want it to hose the MBR on my working XP computer. I do have several Live linux discs such as Knoppix and INSERT. I could boot those on either computer, but I don't know what I'm supposed to do to 'redo the MBR'.


Quote:
Originally Posted by PTrenholme
Check the BIOS settings: You may have "virus protection," or a similar option, enabled.
No virus protection enabled in bios. Anything else I need to watch for in the bios settings? This is an older mobo, btw-- Abit BP6 dual celeron.


Quote:
Originally Posted by PTrenholme
Also, check you HD drive jumpers. It's possible (although I've never heard of this) that some jumper setting is "protecting" the HD MBR.
Not an issue because other linux distros have been able to write their MBR to this drive and this dumb shareware program called Boot Partition Manager has writted to the MBR.


Quote:
Originally Posted by PTrenholme
Alternatively, you may have a brain-dead BIOS like the one on this laptop that won't boot unless XP is installed.
I'm open to some problem existing in the bios. This computer has run multiple versions of Mandrake over the past five years, though, so nothing is specific to windows. These mandrake installs had their own working bootloader.


Quote:
Originally Posted by PTrenholme
Try
Code:
# grub
> root (hd<tab> # to see the list of available hard drives (<tab> means "press the tab key")
> install (hd0) # assuming that's the only drive shown.
> quit
or, once you know how GRUB wants to refer to the drive, try grub-install (hd0) (assuming that hd0 is the correct GRUB drive designation.
I'm going to try this now. Thanks a lot for the useful ideas you've thrown in here.

Appreciatively,

di11rod
 
Old 12-29-2006, 08:51 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
By definition, the mbr is the first sector of Drive #1. Drive #1, in turn, is the drive that BIOS tries to boot first.

To use dd to wipe the mbr--or to write to it--you would have hda or sda in the output field ( no partition #), AND you would not use count=8

For example, this zeros the mbr for hda:
dd if=/dev/zero of=/dev/hda bs=512 count=1

dd is totally unforgiving, so use with caution....

Reformatting and re-partitioning will normally not touch the mbr.
 
Old 12-29-2006, 09:11 PM   #5
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211

Original Poster
Rep: Reputation: 32
Thanks for the detailed explanation, Pixellany. I'm rebooting from my Knoppix disc now to try this.

di11rod
 
Old 12-29-2006, 09:20 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by pixellany
For example, this zeros the mbr for hda:
dd if=/dev/zero of=/dev/hda bs=512 count=1

dd is totally unforgiving, so use with caution....
Indeed.
This will destroy the partition table and the volume id as well - may not matter, but why take the risk. Especially on /dev/hda
The following would probably be safest in this case.
Code:
dd if=/dev/zero of=/dev/hdc bs=1 count=446
 
Old 12-29-2006, 10:20 PM   #7
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by syg00
The following would probably be safest in this case.
Code:
dd if=/dev/zero of=/dev/hdc bs=1 count=446
Thanks everyone for their helpful guidance on this issue. I've seriously spent more than an entire day trying to resolve this issue and I feel like the info you've given me in this post is creating some momentum.

I ran sygoo's above-quoted command and received this response:

dd if=/dev/zero of=/dev/hdd bs=1 count=446
446+0 records in
446+0 records out
446 bytes (446 B) copied, 0.003325 seconds, 134 kB/s

I'm booted off the INSERT cdrom right now. I think it's given the hda identifier, and the hard drive is /dev/hdd now. BTW- for future researchers, booting off the Knoppix DVD isn't helpful because it mounts the hard drive read-only. Using the INSERT cdrom, you can use gparted to mount the hard drive read-write.

Here goes a reboot....

di11rod
 
Old 12-29-2006, 10:33 PM   #8
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211

Original Poster
Rep: Reputation: 32
Ptrenholme,

I started grub and typed 'install (hd0)' and got:

Error 1: Filename must be either an absolute pathname or blocklist

Same with install (hd0,0). When I do a 'grub-install (hd0,0) I get:
bash: syntax error near unexpected token `hd0,0'

Do I need a flag for the (hd0) part?

di11rod
 
Old 12-30-2006, 01:35 AM   #9
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211

Original Poster
Rep: Reputation: 32
Problem Solved

Thanks to everyone for lending their assistance in this very frustrating situation.

Turned out to be a hardware issue. Improper jumper settings on BOTH hard drives I tried. After doing all the software-config stuff people recommended here (thanks again for the insights!), I got down and made sure the cabling and jumpers were all by-the-book. The hard drive had no jumper at all, which made it a slave. I found the proper jumper setting for it being a master on the Maxtor website and then KnoppMyth was able to install its bootloader (lilo) to the MBR properly.

I really appreciate all the suggestions people offered and will try to provide the best support I can to others in recognition.

Appreciatively,

di11rod
 
Old 12-30-2006, 08:25 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
And thank YOU for the feedback....How many posters here are never heard from again? We never know if they solved their issue, and never have the cahnce to give more help if they are stuck...
 
  


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
Restoring MBR :partitions are detected only after the reboot after MBR restoration? sharathksin Linux - Newbie 2 04-14-2006 07:48 AM
MBR zeroed. Can I verify backup MBR? TomF Linux - General 7 06-20-2005 05:28 PM
by tring to fix the MBR i damage the MBR that was help... AKAKAK Fedora 4 03-21-2005 08:18 AM
GRUB MBR overwritten by WIN98 MBR TOuseef Linux - General 7 11-14-2004 04:25 PM
A story & a question about the MBR Seventh_Warrior Linux - Software 2 09-22-2004 05:17 PM

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

All times are GMT -5. The time now is 12:51 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