LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-30-2014, 01: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 01:22 PM.
 
Old 04-30-2014, 02:02 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

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

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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, 09: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, 10:09 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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, 10:12 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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



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 09:21 PM
Boot problem with grub2 - Windows doesnot boot miros84 Linux - Software 11 01-12-2013 03:35 PM
Set up Windows as boot option in Grub2 arubin Slackware 1 09-07-2012 07:21 AM
grub2 can not boot windows 7 jtrol Slackware 1 12-10-2010 04:50 AM
[SOLVED] Multi-boot grub2 destroyed on windows 7 reboot hhoyt Linux - Software 5 08-17-2010 03:01 PM

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

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