LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-01-2004, 09:14 PM   #1
shadow11
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Rep: Reputation: 0
MS Windows overwrite the boot loader


Can anyone tell me how to prevent MS Windows from overwrite Linux boot loader?
Because the grub command will be displayed everytime after I ran the Scan Disk in MS Windows.

Thanks,
 
Old 12-02-2004, 03:58 AM   #2
olkku486
LQ Newbie
 
Registered: Nov 2004
Location: Helsinki, Finland
Distribution: Mandriva Linux 2005
Posts: 9

Rep: Reputation: 0
What do you use for a disribution?

Last edited by olkku486; 12-02-2004 at 04:00 AM.
 
Old 12-02-2004, 08:50 AM   #3
gco10996
LQ Newbie
 
Registered: Oct 2002
Location: New Windsor, NY
Distribution: Red Hat, Slackware, Smoothwall, Fedora, Mandrake, *BSD
Posts: 20

Rep: Reputation: 0
Do you mean that a reboot after running ScanDisk results in a

grub>

prompt?
 
Old 12-02-2004, 09:54 AM   #4
shadow11
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
U right gco10996.
Grub> command displays everytime after run a ScanDisk and reboot

The problem happen in FC2, but I use FC3 currently. Just want to know a way to prevent this from happening rather than have to recover the Windows and then Linux

Thanks,
 
Old 12-04-2004, 02:40 PM   #5
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
I've never seen this problem before. It doesn't make much sense. Grub works in stages. If you're getting the grub prompt, then grub is loaded in the master boot record. It sounds like it's not passing control over to grub stage 2 (the menu). Stage 2 Should not have been affected, because it should be located on your linux partition (in /boot/grub). The only thing I can guess is that scandisk saw something in the mbr that it thought was an error, and "corrected" it.

NOTE: If someone reading this thinks they know more than I do, THEY ARE PROBABLY RIGHT! Feel free to correct me.

Most distrobutions have a rescue function on their install CD's. You may want to try this first. I don't know, but I would assume that Fedora can rescue your mbr.

You can also get your system to boot from the grub prompt. Edit and use the following lines:
kernel (hd0,1)/boot/YourKernelName root=/dev/hda2 1
initrd (hd0,1)/boot/YourInitrd ( <- May not be needed)
boot

I'm not a master of the grub command line, so some additional research may be needed. I don't think you need the "root " command, if you do, then point it at your grub directory before the other commands.

Grub numbers partitions oddly. the (hd0,1) in my example above is the same as /dev/hda2. Every number is one lower than you would expect. (hd0) is the primary drive; (hd1) is the secondary; (hd0,0) is the first partition on the first drive; (hd0,1) is the second partition on the primary drive. You get the idea.

If you don't remember the names of your kernel/initrd, then get them typed in as far as you remember, and push tab. Most systems have symbolic links from "vmlinuz" and "initrd" that point to the real files. You can try those.

This command should load the kernel and dump you into the bash prompt logged in as root user. Since the line above is far from complete, the kernel may not support some things. Just concentrate on getting grub reinstalled into the mbr. typing "grub" should bring up a grub prompt, this time it should be able to reinstall to the mbr. I'm not sure the exact commands, but I think you need to do something like this:
root /boot/grub
setup (hd0)

If I'm not missing something (I'm sure I am) then this should restore your system (going from my initial assumption above). More information about grub commands can be found at:
http://www.gnu.org/software/grub/manual/
It's not the most intuitive manual, more information can be found elsewhere.

(If you need to get into windows in the meanwhile,modify this to point to your windows partition:
root (hd0,0)
chainloader +1
boot
)

Last, but not least: How to get windows to stop doing this. Still assuming the problem is a change that gets made to the mbr, the answer is actually a motherboard setting. Many motherboards have a setting in the CMOS setup (aka BIOS settings) called something like "virus protection". What that does is prevent anything from writing to the mbr of the hard drive. Once you get up and running again, see if you have that option available. It should prevent anything (includeing windows) from messing with your grub stage 1.
 
Old 12-09-2004, 09:49 PM   #6
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Cool

Use GAG Boot loader V4
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot Live CD using windows boot loader vivinuthappa MEPIS 7 06-20-2005 09:15 PM
trying to dual boot windowsxp/fc2 using windows boot loader. dr_zayus69 Linux - Software 7 02-08-2005 11:59 PM
GRUB boot loader blocking windows boot julienroger Linux - Newbie 3 10-12-2004 01:11 PM
How to get Windows boot loader? grub Linux - General 6 07-15-2003 05:37 PM
How to add a boot record which used to startup windows under my Grub boot loader? yunxiang Linux - Newbie 6 02-01-2003 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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