LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-26-2004, 08:58 PM   #1
bandofmercy
Member
 
Registered: Dec 2002
Distribution: Slack 9
Posts: 84

Rep: Reputation: 15
should i wipe my mbr?


up until two days ago, i was running a slack/xp dual boot, but my friend told me about this new ubuntu linux and i decided to give it a try... i like it a lot, even compared to slack, but i made the mistake of letting it install grub when i already had a functioning lilo on my system that i could have fixed... now, several re-installs later, i have taken slack out altogether and have not been able to get into windows, period. at one point, when i was at my worst, i was back with lilo but being sent to a grub shell when i picked XP, which i'd added to my lilo.conf manually since it had failed to autodetect.

i'd really prefer to not re-install windows, which would mean losing a whole lot of data that i could not/would not get back.

more details on my problem can be found here, along with current hardware and such:
http://www.linuxquestions.org/questi...hreadid=235239

i've been getting a lot of help from a very savvy friend, both over gaim and by letting him use my shell through openssh, but he's not around right now and i've been abusing our friendshipt anyways. i think i may have found the answer, but i'm not very advanced with linux or filesystems in general, so i want to throw it out there before i do anything.

this idea is especially significant because up until now most of my repair work over the last two nights has been done while i was drinking copious amounts of wine, but right now i am completely sober.

here is my plan:
#1 use ubuntu's package manager to make sure both lilo and grub are uninstalled.
#2 wipe my mbr clean with the command
Code:
dd if=/dev/zero of=/dev/hda bs=512 count=
#3 either reinstall a bootloader or get a bootloader boot disk from somewhere (where?) and try to get things right.

is this suicide... or brilliant?
 
Old 09-26-2004, 09:33 PM   #2
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,463

Rep: Reputation: 299Reputation: 299Reputation: 299
Just reinstall whatever you installed on your mbr.
http://lilo.go.dyndns.org/
http://www.gnu.org/software/grub/
 
Old 09-26-2004, 09:41 PM   #3
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Suicide! By taking out your MBR like that, you will also clobber the partition table on that drive. If you have anything at all on that drive you want to keep, don't run that command! (it is possible to recover from, but I wouldn't want to do it, and I certainly wouldn't want to try and help someone else do it)

You can do this instead to wipe the MBR while leaving your partition table intact:

Code:
dd if=/dev/zero of=/dev/hda bs=446 count=1
But I'm not sure why you would want to wipe the MBR, unless the system is not booting at all (and even then, just use a boot disc to reinstall the bootloader). I think you should reinstall grub, as it is more forgiving of a bad configuration (you can find tutorials online that would let you boot XP or linux from the grub shell, for example), but if you want to stick with lilo, it can always reinstall itself even if the MBR is totally ruined.
 
Old 09-26-2004, 09:53 PM   #4
bandofmercy
Member
 
Registered: Dec 2002
Distribution: Slack 9
Posts: 84

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by CroMagnon
Suicide! By taking out your MBR like that, you will also clobber the partition table on that drive. If you have anything at all on that drive you want to keep, don't run that command! (it is possible to recover from, but I wouldn't want to do it, and I certainly wouldn't want to try and help someone else do it)

You can do this instead to wipe the MBR while leaving your partition table intact:

Code:
dd if=/dev/zero of=/dev/hda bs=446 count=1
But I'm not sure why you would want to wipe the MBR, unless the system is not booting at all (and even then, just use a boot disc to reinstall the bootloader). I think you should reinstall grub, as it is more forgiving of a bad configuration (you can find tutorials online that would let you boot XP or linux from the grub shell, for example), but if you want to stick with lilo, it can always reinstall itself even if the MBR is totally ruined.
it would seem to me that i've un-and-re-installed both lilo and grub a number of times, and that they manage to hold on to something in the mbr no matter what--even when i thought i had everything squared away with lilo, booting my xp partition sent me to a grub shell.

how do i make sure that uninstalling both also removes their jives from my mbr?
 
Old 09-26-2004, 10:08 PM   #5
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Sounds like grub may have been accidentally installed on the boot sector of your windows partition (this is different to the MBR). When either grub or lilo install to the MBR, they replace whatever was on the MBR previously. There's no way for both to coexist, so I think this must be what has happened. Grab yourself an XP CD and boot up to the recovery console using the instructions at this link http://www.microsoft.com/resources/d...d_tro_bohs.asp. Make sure you use FIXBOOT, but not FIXMBR (fixmbr will erase whatever lilo or grub install is running now).
Good luck!
 
Old 09-26-2004, 10:44 PM   #6
bandofmercy
Member
 
Registered: Dec 2002
Distribution: Slack 9
Posts: 84

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by CroMagnon
Sounds like grub may have been accidentally installed on the boot sector of your windows partition (this is different to the MBR). When either grub or lilo install to the MBR, they replace whatever was on the MBR previously. There's no way for both to coexist, so I think this must be what has happened. Grab yourself an XP CD and boot up to the recovery console using the instructions at this link http://www.microsoft.com/resources/d...d_tro_bohs.asp. Make sure you use FIXBOOT, but not FIXMBR (fixmbr will erase whatever lilo or grub install is running now).
Good luck!

i told my friend who'd been helping me via openssh about this and he said "it would explain why the ntfs volume wasn't mounting..."

and it worked! i've been up till 6 in the morning the last two nights working on this. thank you so much.
i don't even normally do smilies.
 
Old 09-26-2004, 11:14 PM   #7
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Quote:
i don't even normally do smilies.
Hey, if the best that can be said of my time is that I made someone grin like a maniac, I consider it well spent
Glad I could help.
 
  


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
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
how to wipe MBR on slave drive from windows? Ebenonce Linux - Newbie 9 08-16-2004 02:57 AM
how to wipe a drive??? trey85stang Slackware 13 05-02-2004 03:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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