How to add Linux Mint 12 to the Windows boot.ini?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 5:16 am

Hey guys, i had linux mint 12 installed on my computer under dev/sda6

I then installed windows XP professional via USB, to a different partition.
All is going well, however, when i boot my computer, it loads straight into WinXP

I assume this is because of me only having one OS under the [operating systems] section of the boot.ini file.
I am wondering how do i add linux mint 12 to the file, so it gives me an option to boot either WinXP or Mint12 on startup.

I do not know what the partition number would be.

Thanks.
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Linux Mint is funded by ads and donations.
 

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby dvhenry on Sun Apr 15, 2012 5:59 am

when i boot my computer, it loads straight into WinXP

I assume this is because of me only having one OS under the [operating systems] section of the boot.ini file.


Well, actually, its because windows intentionally overwrites the MBR so as to make any non microsoft OS unbootable, (No, there is no need for this).

Your best option is to reinstall the grub2 bootloader, It will auto detect both installs.
Or you could add an entry for Linux in the windows bootloader, but it's ugly.

I will leave advice on reinstalling grub2 to those who know it (I know grub legacy reasonably well, but not grub2)
dvhenry
Level 1
Level 1
 
Posts: 30
Joined: Sun Apr 01, 2012 12:11 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 6:05 am

ok, by ugly do you mean aesthetically? because if you do, i dont care if it's ugly.
how to i add the linux entry?

otherwise, to someone who knows it, how do i reinstall grub2? and will it recognise my windows system when installed?
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby wayne128 on Sun Apr 15, 2012 6:10 am

Yes, grub2 will find windows OS and provide you with grub menu to choose winXP or Linux OS

To install grub2 , what you do is

1. boot Linux OS and run live

2. open a terminal, type this command to find which partition is your Linux OS installed
Code: Select all
sudo os-prober


then look for the line that had Mint12 or other Linux OS you have.
for example , copy from my desktop

/dev/sda11:Linux Mint Debian Edition (1):LinuxMint:linux

You can see that it lists /dev/sda11 as the installed partition number.

3. mount the partition with

Code: Select all
sudo mount /dev/sda11 /mnt


just replace sda11 with your actual Mint12 partition designation

4. install grub2 to MBR
Code: Select all
sudo grub-install --root-directory=/mnt /dev/sda
wayne128
Level 10
Level 10
 
Posts: 3325
Joined: Tue Jul 13, 2010 12:15 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby sunewbie on Sun Apr 15, 2012 6:27 am

NZLinuxMan wrote:Hey guys, i had linux mint 12 installed on my computer under dev/sda6

I then installed windows XP professional via USB, to a different partition.
All is going well, however, when i boot my computer, it loads straight into WinXP

I assume this is because of me only having one OS under the [operating systems] section of the boot.ini file.
I am wondering how do i add linux mint 12 to the file, so it gives me an option to boot either WinXP or Mint12 on startup.

I do not know what the partition number would be.

Thanks.


Hi,

To check partition no, use gparted. Boot into livee CD and open Gparted.

EDIT: CLI to check partition:

Code: Select all
sudo blkid


Code: Select all
sudo fdisk -l


EDIT2: 'l' is small letter 'L'

IF unsure, post outputs of these files as code.

If you have labeled hard drives like C: to OS E: Data, in windows XP, then it will show labels too, making it easy for identification.
GRUB is overwritten by windows bootloader.

As said by other posters, windows does not detect anything other than windows OS. GRUB detects Linux / MAC OS / Windows and maybe BSD.

So it's always better to install windows first and then install any Linux Distro.

There are 2 ways.

1. Reinstall GRUB for LIVE DVD. - this will have grub bootloader.
2. Add Linux Mint to windows bootloader.

1. follow these links

community tutorial

Point 13. GRUB 2 Guide

Grub 2 documentation


2. Use EasyBCD. It's a free windows program, which detects Linux OS. follow think link

http://www.linuxbsdos.com/2011/06/11/du ... windows-7/
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 8:08 am

i booted lucid puppy 5.28 from a usb stick.

from there i went to the grubconfig
i install grub to the mbr on /dev/sda
when it asks where to put the files, /dev/sda does not work, so i put them in /dev/sda5 (Linux Mint 12)

all goes well.
menu.lst is correct

BUT when i boot, no menu shows up, it still boots directly into XP.

any suggestions?
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby wayne128 on Sun Apr 15, 2012 8:48 am

sound like you are using grub legacy ( because of menu.lst mentioned).

what you should do is use Mint12 or other Linux CD that has grub2 and follow the steps stated in earlier post to mount the Mint partition and reinstall grub2 onto MBR
wayne128
Level 10
Level 10
 
Posts: 3325
Joined: Tue Jul 13, 2010 12:15 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 9:38 am

wayne128, i did what you said, on boot i now have a grub boot menu, however, it does not have an option to boot windows xp from /dev/sda2, it only has linux mint 12 on sda6 and ubuntu 11.10 on sda1 (Which i formatted long ago, that installation no longer exists)

this is the contents of menu.lst

Code: Select all
# GRUB configuration file '/boot/grub/menu.lst'.
# generated by 'grubconfig'.  Sun Apr 15 23:21:28 2012
#
# The backup copy of the MBR for drive '/dev/sda' is
# here '/boot/grub/mbr.sda.12758'.  You can restore it like this.
# dd if=/boot/grub/mbr.sda.12758 of=/dev/sda bs=512 count=1
#
# Start GRUB global section
#timeout 30
color light-gray/blue black/light-gray
# End GRUB global section
# Linux bootable partition config begins
  title Linux (on /dev/sda1)
  root (hd0,0)
  kernel /boot/vmlinuz root=/dev/sda1 ro vga=normal
# Linux bootable partition config ends
# Other bootable partition config begins
  title Windows (on /dev/sda2)
  map (hd0,0) (hd0,1)
  map (hd0,1) (hd0,0)
  rootnoverify (hd0,1)
  makeactive
  chainloader +1
# Other bootable partition config ends
# Linux bootable partition config begins
  title Linux (on /dev/sda5)
  root (hd0,4)
  kernel /boot/vmlinuz root=/dev/sda5 ro vga=normal
# Linux bootable partition config ends
# Other bootable partition config begins
  title DOS (on /dev/sdc1)
  map (hd0) (hd1)
  map (hd1) (hd0)
  rootnoverify (hd1,0)
  makeactive
  chainloader +1
# Other bootable partition config ends
# Linux bootable initrd config begins
  title Linux initrd /tmp/boot/boot/initrd.img-3.0.0-12-generic (on /dev/sda5)
  root (hd0,4)
  kernel /boot/vmlinuz root=/dev/sda5 ramdisk_size=31137 root=/dev/ram0 rw
  initrd /tmp/boot/boot/initrd.img-3.0.0-12-generic
# Linux bootable initrd config ends
title Install GRUB to floppy disk (on /dev/fd0)
pause Insert a formatted floppy disk and press enter.
root (hd0,4)
setup (fd0)
pause Press enter to continue.
title Install GRUB to Linux partition (on /dev/sda5)
root (hd0,4)
setup (hd0,4)
pause Press enter to continue.
title -     For help press 'c', then type: 'help'
root (hd0)
title -     For usage examples, type: 'cat /boot/grub/usage.txt'
root (hd0)


any ideas?
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby wayne128 on Sun Apr 15, 2012 9:50 am

I am confused about your Mint 12 using menu.lst
Or , another question, where did you get the menu.lst?

Just to be sure
Please run on INSTALLED Mint 12. not on Live CD.

once you are running Mint 12, go to terminal, do these and paste the terminal output

1. sudo os-prober

2. cat /boot/grub/menu.lst

3. cat /boot/grub/grub.cfg

4 sudo fdisk -l

5. sudo parted -l print
wayne128
Level 10
Level 10
 
Posts: 3325
Joined: Tue Jul 13, 2010 12:15 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 9:57 am

sudo os-prober:

Code: Select all
/dev/sda2:Windows NT/2000/XP:Windows:chain


cat boot/grub/menu.lst

Code: Select all
# GRUB configuration file '/boot/grub/menu.lst'.
# generated by 'grubconfig'.  Sun Apr 15 23:21:28 2012
#
# The backup copy of the MBR for drive '/dev/sda' is
# here '/boot/grub/mbr.sda.12758'.  You can restore it like this.
# dd if=/boot/grub/mbr.sda.12758 of=/dev/sda bs=512 count=1
#
# Start GRUB global section
#timeout 30
color light-gray/blue black/light-gray
# End GRUB global section
# Linux bootable partition config begins
  title Linux (on /dev/sda1)
  root (hd0,0)
  kernel /boot/vmlinuz root=/dev/sda1 ro vga=normal
# Linux bootable partition config ends
# Other bootable partition config begins
  title Windows (on /dev/sda2)
  map (hd0,0) (hd0,1)
  map (hd0,1) (hd0,0)
  rootnoverify (hd0,1)
  makeactive
  chainloader +1
# Other bootable partition config ends
# Linux bootable partition config begins
  title Linux (on /dev/sda5)
  root (hd0,4)
  kernel /boot/vmlinuz root=/dev/sda5 ro vga=normal
# Linux bootable partition config ends
# Other bootable partition config begins
  title DOS (on /dev/sdc1)
  map (hd0) (hd1)
  map (hd1) (hd0)
  rootnoverify (hd1,0)
  makeactive
  chainloader +1
# Other bootable partition config ends
# Linux bootable initrd config begins
  title Linux initrd /tmp/boot/boot/initrd.img-3.0.0-12-generic (on /dev/sda5)
  root (hd0,4)
  kernel /boot/vmlinuz root=/dev/sda5 ramdisk_size=31137 root=/dev/ram0 rw
  initrd /tmp/boot/boot/initrd.img-3.0.0-12-generic
# Linux bootable initrd config ends
title Install GRUB to floppy disk (on /dev/fd0)
pause Insert a formatted floppy disk and press enter.
root (hd0,4)
setup (fd0)
pause Press enter to continue.
title Install GRUB to Linux partition (on /dev/sda5)
root (hd0,4)
setup (hd0,4)
pause Press enter to continue.
title -     For help press 'c', then type: 'help'
root (hd0)
title -     For usage examples, type: 'cat /boot/grub/usage.txt'
root (hd0)


cat /boot/grub/grub.cfg

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

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root 0711992d-ff8f-4354-a4b3-b16229c73f20
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos6)'
  search --no-floppy --fs-uuid --set=root 0711992d-ff8f-4354-a4b3-b16229c73f20
  set locale_dir=($root)/boot/grub/locale
  set lang=en_NZ
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 0,0,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 12 32-bit, 3.0.0-12-generic (/dev/sda6)' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   set gfxpayload=$linux_gfx_mode
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos6)'
   search --no-floppy --fs-uuid --set=root 0711992d-ff8f-4354-a4b3-b16229c73f20
   linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=0711992d-ff8f-4354-a4b3-b16229c73f20 ro   quiet splash vt.handoff=7
   initrd   /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Linux Mint 12 32-bit, 3.0.0-12-generic (/dev/sda6) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos6)'
   search --no-floppy --fs-uuid --set=root 0711992d-ff8f-4354-a4b3-b16229c73f20
   echo   'Loading Linux 3.0.0-12-generic ...'
   linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=0711992d-ff8f-4354-a4b3-b16229c73f20 ro recovery nomodeset
   echo   'Loading initial ramdisk ...'
   initrd   /boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos6)'
   search --no-floppy --fs-uuid --set=root 0711992d-ff8f-4354-a4b3-b16229c73f20
   linux16   /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos6)'
   search --no-floppy --fs-uuid --set=root 0711992d-ff8f-4354-a4b3-b16229c73f20
   linux16   /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, with Linux 3.0.0-12-generic (on /dev/sda1)" --class gnu-linux --class gnu --class os {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set=root 5ec9bc00-03e3-4b1c-a6d4-395f87d12cd0
   linux /boot/vmlinuz-3.0.0-12-generic root=UUID=5ec9bc00-03e3-4b1c-a6d4-395f87d12cd0 ro quiet splash vt.handoff=7
   initrd /boot/initrd.img-3.0.0-12-generic
}
menuentry "Ubuntu, with Linux 3.0.0-12-generic (recovery mode) (on /dev/sda1)" --class gnu-linux --class gnu --class os {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set=root 5ec9bc00-03e3-4b1c-a6d4-395f87d12cd0
   linux /boot/vmlinuz-3.0.0-12-generic root=UUID=5ec9bc00-03e3-4b1c-a6d4-395f87d12cd0 ro recovery nomodeset
   initrd /boot/initrd.img-3.0.0-12-generic
}
### 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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi


all run from the installed mint 12
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby wayne128 on Sun Apr 15, 2012 10:01 am

OK,

run from installed Mint 12, on terminal, do this command

sudo update-grub


you should see some text on terminal, copy them and post here.
wayne128
Level 10
Level 10
 
Posts: 3325
Joined: Tue Jul 13, 2010 12:15 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 10:07 am

Code: Select all
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.0.0-12-generic
Found initrd image: /boot/initrd.img-3.0.0-12-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows NT/2000/XP on /dev/sda2
done


will now try and reboot
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby NZLinuxMan on Sun Apr 15, 2012 10:12 am

haha thanks man it worked! im posting this from WinXP right now.
NZLinuxMan
Level 1
Level 1
 
Posts: 12
Joined: Sun Apr 15, 2012 12:53 am

Re: How to add Linux Mint 12 to the Windows boot.ini?

Postby sunewbie on Sun Apr 15, 2012 11:02 am

NZLinuxMan wrote:haha thanks man it worked! im posting this from WinXP right now.


Nice to know it worked for you.

Correct is to have GRUB 2 and not GRUB Legacy, as said above.

if you Install GRUB from LIVE CD, you should use chroot method (in the links given above in my posts).

Also the partition should not be mounted at that time.

Sometimes, update-grub does not work, in that update-grub2 works.

If the problem is solved, please mark this thread [SOLVED]

to mark it as [SOLVED] hit the edit button of your first post and add [SOLVED] in the beginning of the subject line.

You can remove custom entry of Ubuntu from Grub, all explained in 2 links.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: chudx, JazzBass, Smokeyflave and 15 guests