LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-30-2014, 02:20 PM   #1
Changes
Member
 
Registered: Oct 2008
Posts: 190

Rep: Reputation: 16
Getting Grub2 to boot LMDE and two Windows versions


My netbook's HD is partitioned like this:

sda1 ext4 Linux Mint Debian Edition
sda2 NTFS Win7
sda3 NTFS WinXP
sda4 NTFS user data

In the beginning I only had LMDE and Win7, then I installed XP and as expected it screwed up the bootloader, so I had to restore grub2. However, after I did the computer would only boot XP. Then I ran the Win7 restore from the USB installer and told it to repair the startup process. After a further grub2 restore I can now boot LMDE and Win7, but not WinXP.

I then had a go at modifying grub2 manually, so I went in /etc/grub.d, removed os_prober and added the following to 40_custom:

Code:
menuentry “Windows 7” –class windows –class os {
        set root=(hd0,1)
        insmod ntfs
        chainloader +1
}

menuentry “Windows XP” –class windows –class os {
        set root=(hd0,2)
        insmod ntfs
        chainloader +1
}
I now have the relevant entries in grub2, but no matter what Windows version I choose only 7 ever starts.

How on Earth do I get the selection to work properly and boot LMDE, 7 or XP?

Last edited by Changes; 04-30-2014 at 02:22 PM.
 
Old 04-30-2014, 03:02 PM   #2
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, puppy, ubuntu
Posts: 2,507

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
change windows xp set root entry to (hd0,3)
 
Old 04-30-2014, 04:29 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,150

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
Windows bootloaders are backware compatible and the problems you report are a direct result of installing xp after windows 7. If you had reversed that process, all you would have had to do is install Mint to the mbr again. It is possible to boot win 7 from xp but the reverse is much easier.

Your partition information and the menuentries you posted conflict. Grub2 counts drives from zero and partitions from one and according to the partition information you posted, win 7 is on sda2 which would give it a menuentry (hd0,2), xp should be (hd0,3) as suggested. If the suggestion above fails, I'd take a look in the windows partitions to see if the correct boot files are on each.
 
Old 05-01-2014, 10:45 AM   #4
Changes
Member
 
Registered: Oct 2008
Posts: 190

Original Poster
Rep: Reputation: 16
I thought grub2 counted partitions from hd0,0. I fixed the entries to boot 7 from hd0,2 and xp from hd0,3. Now 7 boots as intended, but XP returns a "NTLDR missing" error. I guess the problem now belongs to another message board... thanks for the help.
 
Old 05-01-2014, 11:09 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,150

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
Quote:
I thought grub2 counted partitions from hd0,0
No, the original Grub Legacy did but that changed with Grub2. If you get an NTLDR is missing message when booting xp, you should be able to mount its partition from Mint and take a look to see if the file is indeed there. If it's not, you might look on the win 7 partition to see if it and the other xp boot files are there. Should be easy to tell as windows 7 bootloader and boot files are different from xp.
 
Old 05-01-2014, 11:12 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 10,178
Blog Entries: 7

Rep: Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519Reputation: 2519
first you should try rebuilding /boot/grub/grub.cfg with one of the grub commands.

sometimes it does not recognize other os'es, although os-prober does, so if that doesn't work, you can run
Code:
/etc/grub.d/30_os-prober > somefile
and extract the appropriate menuentry from there.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub2 refuses to boot Windows 7 pwrightfl Debian 12 02-12-2014 10:21 PM
Boot problem with grub2 - Windows doesnot boot miros84 Linux - Software 11 01-12-2013 04:35 PM
Set up Windows as boot option in Grub2 arubin Slackware 1 09-07-2012 08:21 AM
grub2 can not boot windows 7 jtrol Slackware 1 12-10-2010 05:50 AM
[SOLVED] Multi-boot grub2 destroyed on windows 7 reboot hhoyt Linux - Software 5 08-17-2010 04:01 PM

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

All times are GMT -5. The time now is 06: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration