b5media.com

Advertise with us

Enjoying this blog? Check out the rest of the Technology Channel Subscribe to this Feed

New Linux User

Adding Other Operating Systems to GRUB

by Kyle on February 18th, 2007

Today I installed a second operating system to my laptop and I was surprised that Ubuntu did not automatically add the new operating system to GRUB. The solution is simple. To add another operating system to grub type the following into the terminal:

gksudo gedit /boot/grub/menu.lst

Scroll all the way to the bottom of the file and type the following:

title Your New Operating System’s Name
root (hd0,0)
makeactive
chainloader +1

Let me explain a bit about this command. The root (hd0,0) command will probably have to be changed in your case. “hd0″ is related to the hard disk. If you only have one hard drive (like most people) leave this alone. Now the second part after the comma is related to the actual partition. My new operating system is located at hdc3 so I changed the command to root (hd0,2). Whatever partition your new operating system is located at, you will need to change this number to be one less. For example: hdc1 becomes root (hd0,0), hdc2 becomes root (hd0,1), hdc3 becomes root (hd0,20), etc. You get the point.

Resave the file and reboot and you should be able to boot into your new OS.

POSTED IN: How To

6 opinions for Adding Other Operating Systems to GRUB

  • Jason
    Feb 18, 2007 at 10:11 pm

    Ok, what I need to know is how to change the default OS in GRUB. Right now, it’s booting up Ubuntu by default (Ubuntu uses the first 3 or 4 entries) and the final entry is XP, which I want set as the default.

  • Kyle
    Feb 19, 2007 at 4:44 am

    @Jason: In that same /boot/grub/menu.lst file under Ubuntu there will be a line that says “savedefault” remove that line and put it under your Windows entry and Windows will become the default operating system.

  • Dennie Barker
    May 1, 2007 at 12:54 pm

    What about adding 2 OS? Would the chainloader be +1 still or would it be +2 for the next OS?

  • TeeJay
    Aug 18, 2007 at 11:48 am

    Dennie:

    It would still be chainloader +1…… at least it is based on my menu.lst booting Vista, XP, and Ubuntu.

    TJ

  • Casey Stamper
    Sep 4, 2007 at 2:08 am

    Kyle and Jason: There is also a line in menu.lst that reads “default 1″ or whatever the number is. If you have 4 menu entries, this will default to the 2nd (numbered 0 through 3). So, if XP is your 4th menu entry, change the line to read “default 3″ and save it. Upon reboot, XP will boot by default.

  • Nick
    May 11, 2008 at 6:04 pm

    If you could re explain the entire process to me for my particular situation for instance i have vista, ubuntu, and xp pro on scsi 1 as my primary hard drive (120 gb) and Mac OSx86 on scsi 3 as my 2ndary hard drive (120 gb)……Please explain to me how i would make it work

Have an opinion? Leave a comment:




Check Spelling
Activate Spell Check while Typing