LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-19-2010, 07:35 AM   #1
JerzJim
LQ Newbie
 
Registered: Jun 2009
Location: Raleigh, NC
Distribution: Debian/Gnu Linux (Lenny)
Posts: 4

Rep: Reputation: 0
Grub Vs Windows XP Pro


I have looked around and see many posts concerning losing Linux, grub, or windows, during the install of one or the others. But I have a dual boot system with Windows XP Pro in my primary drive /dev/sda and a secondary drive for Linux /dev/sdb. I installed grub to the MBR of the Windows disk back when I installed Linux and set it up for dual boot. It worked fine, however.... Every now and then, without any perceptible reason, the system loses grub apparently because it will only boot to windows. So, I go through the process of re installing Grub into the MBR of the windows disk and things are fine again until the next time it does it. Its easy to reinstall it, but its annoying to come down and expect to get on the computer only to find out that you have to find the install CD and jump through some hoops before you can get started. Can anyone tell me why this is happening and is there anything I can do to stop it?
 
Old 11-19-2010, 08:12 AM   #2
module0000
Member
 
Registered: Feb 2010
Location: USA
Distribution: RHEL
Posts: 36

Rep: Reputation: 15
Can you give us any more data? When you say it loses grub, do you mean that the other boot entries won't work..or that the grub menu does not appear at all?
 
Old 11-20-2010, 08:04 AM   #3
JerzJim
LQ Newbie
 
Registered: Jun 2009
Location: Raleigh, NC
Distribution: Debian/Gnu Linux (Lenny)
Posts: 4

Original Poster
Rep: Reputation: 0
Grub Vs. Windows

what I mean is that it no longer shows the grub menu, it just boots to windows only. I also should of mentioned that it was a Debian Squeeze system. I just thought it was apparent, by my having to reinstall grub. But I should of been more specific. There is no menu at all, its like linux does not exist. Its just like it is a computer with windows xp pro on it only. You restart and it goes right into windows. So, like I said, I reinstall Grub and its fine after that until the next time it does it. Very strange. Easy enough to fix, but a pain nonetheless. I just wish I knew why it was happening. I hate having to write to the MBR also, as one day it might mess it up and I may have to reinstall the OS or something.
 
Old 11-21-2010, 10:18 AM   #4
module0000
Member
 
Registered: Feb 2010
Location: USA
Distribution: RHEL
Posts: 36

Rep: Reputation: 15
Could you post your /etc/default/grub and /boot/grub/grub.cfg?

Wondering if you have the boot last as default set with a short timeout...that would cause it to boot directly to windows by default after you manually selected it once in grub.
 
Old 11-21-2010, 12:02 PM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
If windows will boot my guess is that it happens when you get a windows upgrade or repair. If you remove XP that should solve your problem.
 
Old 11-21-2010, 12:46 PM   #6
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
What I think here is you have two drives (sda and sdb) and one of them has a winduhs and the other one is linux. Check the bios and make sure about that. In bios you will also find the boot options as to what os to boot. Can you tell us what the grub entries are - they would help us clarify what is happening.
Hope thos helps.
 
Old 11-22-2010, 06:34 AM   #7
JerzJim
LQ Newbie
 
Registered: Jun 2009
Location: Raleigh, NC
Distribution: Debian/Gnu Linux (Lenny)
Posts: 4

Original Poster
Rep: Reputation: 0
Windows Vs. Grub

Well, here are the file listings you requested. I guess I am not doing a great job of explaining this issue due to some of the replies. I stated I have a dual boot system in the original post. I also stated that it was two drives, /dev/sda and /dev/sdb. sda is the windows drive and sdb is the linux drive. It boots to the windows drive as I had windows on here before linux and I did not change that. I just installed grub into the MBR of the windows drive (sda). So, it would be more correct to say it boots to grub which happens to be on sda in the MBR. I also said, that this works fine most of the time. Its just that every so often it dumps grub from the MBR and then naturally boots to windows only at that point. Until I reinstall grub. I really dont think getting rid of windows is any kind of answer to my problem. If I did not need windows, you think I would put up with this stuff? There are things on my windows drive I cannot do without and they are not available for Linux. I would like to move to Linux and someday I will be able to, but for now that is not an option. Yes, no grub menu at all, just boots directly into windows. Once I reinstall grub its fine again. Its been fine for a couple weeks now, but it will do it again at some point. Anyway, here are the file listings. Here is the grub file.

-----------------------------------------------------------------------

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entrys
#GRUB_DISABLE_LINUX_RECOVERY="true"

-----------------------------------------------------------------------------

Here is the grub.cfg file:

-----------------------------------------------------------------------------

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 8bd84924-9aa5-460c-920d-e7c3c7b6a0d2
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 8bd84924-9aa5-460c-920d-e7c3c7b6a0d2
insmod png
if background_image /boot/grub/moreblue-orbit-grub.png ; then
set color_normal=black/black
set color_highlight=magenta/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, Linux 2.6.30-2-686" {
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 8bd84924-9aa5-460c-920d-e7c3c7b6a0d2
linux /boot/vmlinuz-2.6.30-2-686 root=UUID=8bd84924-9aa5-460c-920d-e7c3c7b6a0d2 ro quiet
initrd /boot/initrd.img-2.6.30-2-686
}
menuentry "Debian GNU/Linux, Linux 2.6.30-2-686 (recovery mode)" {
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 8bd84924-9aa5-460c-920d-e7c3c7b6a0d2
linux /boot/vmlinuz-2.6.30-2-686 root=UUID=8bd84924-9aa5-460c-920d-e7c3c7b6a0d2 ro single
initrd /boot/initrd.img-2.6.30-2-686
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-686" {
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 8bd84924-9aa5-460c-920d-e7c3c7b6a0d2
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=8bd84924-9aa5-460c-920d-e7c3c7b6a0d2 ro quiet
initrd /boot/initrd.img-2.6.26-2-686
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-686 (recovery mode)" {
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 8bd84924-9aa5-460c-920d-e7c3c7b6a0d2
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=8bd84924-9aa5-460c-920d-e7c3c7b6a0d2 ro single
initrd /boot/initrd.img-2.6.26-2-686
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 73dc2b1347420d71
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Windows NT/2000/XP (on /dev/sda2)" {
insmod ntfs
set root=(hd0,2)
search --no-floppy --fs-uuid --set 0d18d2a17054aa16
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

------------------------------------------------------------------------------

Hope this helps...

Jim
 
Old 11-22-2010, 12:48 PM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
I did not intend to offend you, but windows will overwrite the mbr everytime you restore or on a lot of their updates. The easiest solution I have found is to keep a live linux cd and restore the mbr. Once you get the technique, it just takes a second to do. There is also super grub disk that will restore the mbr.
 
Old 11-23-2010, 05:18 AM   #9
JerzJim
LQ Newbie
 
Registered: Jun 2009
Location: Raleigh, NC
Distribution: Debian/Gnu Linux (Lenny)
Posts: 4

Original Poster
Rep: Reputation: 0
Windows Vs. Grub

You did not offend me, so don't worry about that. Its just not any kind of solution to my problem. For me that is... Plus if I could dump Bill Gates, I would believe me. The other thing, is that in my original post, I explained a lot of the things that people were suggesting. I was confused.... it was like no one read the original post. For instance, I do reinstall grub each time... So, I know how to do that. In fact, I use a live cd basically. Its the over the net install CD actually, but it has what I need on there to do it. What I want to know is what is causing the problem to begin with and how I can fix it, if possible. Now I did not know that Windows overwrites the MBR with updates... Not sure why they would do that, ... I guess if the location of MSsys and iosys change they would have to do that. But certainly, that could cause it. I will watch for that. I appreciate the suggestions.

Jim
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
got Windows XP pro and Ubuntu installed - grub dont work krack3rz Linux - Desktop 5 06-23-2010 09:45 AM
My grub is not loading on dual operating system with windows Xp Pro causing my system marlene tack Linux - Newbie 2 03-17-2008 07:54 AM
HD1:IDE Suse 10.2 & Windows Xp Pro HD HD2: SATA XP PRO X64 HOW TO MOUNT HD 2 blazintilda2005 Linux - Hardware 1 04-13-2007 08:30 PM
FC5 New install w windows XP Pro duelboot grub kills MBR efosmi1 Fedora 2 12-07-2006 11:32 PM
SuSE 10/Windows XP Pro - GRUB Error 17 Byronious Linux - Newbie 6 11-18-2005 10:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:26 PM.

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