Results 1 to 10 of 16

Thread: Add Windows XP to Grub 2

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Location
    Norway
    Beans
    2
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Add Windows XP to Grub 2

    I recently installed Ubuntu 9.10 Karmic Koala and Grub2 followed with it. But my Windows XP installation did not follow in the Grub2 setup, does anyone know how to add Windows XP to grub2?

    For the record Grub2 does not contain a menu.lst file, it got a grub.cfg file, this file does not use the standard grub code that i am used to. It looks like this
    Code:
    #
    # 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
    set timeout=5
    set root=(hd1,7)
    search --no-floppy --fs-uuid --set 7cece53a-77f2-4714-abd2-cd4d29e14c16
    if loadfont /usr/share/grub/ascii.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
    ### END /etc/grub.d/00_header ###
    
    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=cyan/blue
    set menu_color_highlight=white/blue
    ### END /etc/grub.d/05_debian_theme ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, Linux 2.6.30-10-generic" {
    	set root=(hd1,6)
    	search --no-floppy --fs-uuid --set c85c3571-0842-4cc7-bcf0-c4b02b43fbf6
    	linux	/vmlinuz-2.6.30-10-generic root=UUID=7cece53a-77f2-4714-abd2-cd4d29e14c16 ro  quiet splash
    	initrd	/initrd.img-2.6.30-10-generic
    }
    menuentry "Ubuntu, Linux 2.6.30-10-generic (recovery mode)" {
    	set root=(hd1,6)
    	search --no-floppy --fs-uuid --set c85c3571-0842-4cc7-bcf0-c4b02b43fbf6
    	linux	/vmlinuz-2.6.30-10-generic root=UUID=7cece53a-77f2-4714-abd2-cd4d29e14c16 ro single 
    	initrd	/initrd.img-2.6.30-10-generic
    }
    menuentry "Ubuntu, Linux 2.6.30-9-generic" {
    	set root=(hd1,6)
    	search --no-floppy --fs-uuid --set c85c3571-0842-4cc7-bcf0-c4b02b43fbf6
    	linux	/vmlinuz-2.6.30-9-generic root=UUID=7cece53a-77f2-4714-abd2-cd4d29e14c16 ro  quiet splash
    	initrd	/initrd.img-2.6.30-9-generic
    }
    menuentry "Ubuntu, Linux 2.6.30-9-generic (recovery mode)" {
    	set root=(hd1,6)
    	search --no-floppy --fs-uuid --set c85c3571-0842-4cc7-bcf0-c4b02b43fbf6
    	linux	/vmlinuz-2.6.30-9-generic root=UUID=7cece53a-77f2-4714-abd2-cd4d29e14c16 ro single 
    	initrd	/initrd.img-2.6.30-9-generic
    }
    menuentry "Ubuntu, Linux 2.6.30-8-generic" {
    	set root=(hd1,6)
    	search --no-floppy --fs-uuid --set c85c3571-0842-4cc7-bcf0-c4b02b43fbf6
    	linux	/vmlinuz-2.6.30-8-generic root=UUID=7cece53a-77f2-4714-abd2-cd4d29e14c16 ro  quiet splash
    	initrd	/initrd.img-2.6.30-8-generic
    }
    menuentry "Ubuntu, Linux 2.6.30-8-generic (recovery mode)" {
    	set root=(hd1,6)
    	search --no-floppy --fs-uuid --set c85c3571-0842-4cc7-bcf0-c4b02b43fbf6
    	linux	/vmlinuz-2.6.30-8-generic root=UUID=7cece53a-77f2-4714-abd2-cd4d29e14c16 ro single 
    	initrd	/initrd.img-2.6.30-8-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    	linux	/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    	linux	/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/40_custom ###
    # This file is an example on how to add custom entries
    ### END /etc/grub.d/40_custom ###

  2. #2
    Join Date
    Jun 2007
    Location
    Oz
    Beans
    501
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Add Windows XP to Grub 2

    Add this entry with a sudo text editor (gksu gedit /boot/grub/menu.lst):
    Code:
    title Windows bootloader access
    rootnoverify (hd0,0)
    chainloader (hd0,0) +1
    You adjust hd(0,0) to match the partition where xp's boot.ini file resides.

    Sometimes you have to add the map function if xp was installed on a different drive whaich was addressed differently after the addition of Ubuntu. That's like this:
    Code:
    title Windows bootloader access
    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd1,0)
    chainloader (hd1,0) +1
    Last edited by swerdna; June 30th, 2009 at 12:09 PM.

  3. #3
    Join Date
    Nov 2009
    Beans
    3

    Re: Add Windows XP to Grub 2

    Hi,

    I have upgraded to Ubuntu 9.10 recently, which resides in a partition of my first drive:

    Code:
    /dev/sda7: UUID="ddca03a1-2716-4b14-8436-f77784f25b88" TYPE="ext4"
    Now I'd like to add the existing Windows XP boot to the Grub2 boot loader. The Windows XP boot.ini and the OS itself are in this partition of the second drive:

    Code:
    /dev/sdb5: UUID="4A6077FC6077ED57" LABEL="Windows" TYPE="ntfs"
    I added the code below to menu.lst and then run 'sudo update-grub', but still no luck.

    Code:
    title Windows bootloader access
    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd1,5)
    chainloader (hd1,5) +1
    I then added this at the bottom of grub.cfg:

    Code:
    menuentry "Windows NT/2000/XP (loader) (on /dev/sdb5)" {
        insmod ntfs
        set root=(hd1,5)
        search --no-floppy --fs-uuid --set 4a6077fc6077ed57
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    The menu entry is displayed in the Grub boot screen, but when I select the Windows XP Loader option, a blank screen appears. I guess I'm not addressing the partition correctly so the boot.ini file is not found.

    Could somebody help me editing the Grub boot loader?

    Thanks!
    Last edited by Ayrton; November 7th, 2009 at 04:44 PM.

  4. #4
    Join Date
    May 2007
    Location
    Virginia, USA
    Beans
    13,263
    Distro
    Ubuntu Mate Development Release

    Re: Add Windows XP to Grub 2

    Quote Originally Posted by swerdna View Post
    Add this entry with a sudo text editor (gksu gedit /boot/grub/menu.lst):
    Did you even bother to read the thread title? It clearly says "Grub 2" -- which does NOT use menu.lst!
    Ubuntu 17.04 Mate, Mint 18.1 Mate; MS Win 8.1, MS Win10 Pro.
    Will not respond to PM requests for support -- use the forums.

  5. #5
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Add Windows XP to Grub 2

    You should not directly edit grub.cfg. You can add entries to /etc/grub.d/40_custom or create new files with 2 digits and an underscore where the numeric order is where the custom entries get added into grub.cfg.

    If you directly edit grub.cfg the next update will erase your entries.

    Copy your entry to 40_custom but try changing the drivemap from hd0 to hd1.
    drivemap -s (hd1) ${root}
    Or try drivemap with hd0 and hd1 in place of the root
    drivemap -s (hd0) (hd1)

    I do not know if 40_custom defaults to executable or not but all files must be flagged executable to be included in grub.cfg.

    Finally, don't forget to run either the 'sudo update-grub' or 'sudo grub-mkconfig' command.
    sudo grub-mkconfig -o /boot/grub/grub.cfg
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  6. #6
    Join Date
    Nov 2009
    Beans
    3

    Re: Add Windows XP to Grub 2

    Thanks a lot oldfred! I'll give it a try and let you know if it works.

  7. #7
    Join Date
    Sep 2008
    Location
    Sharpsburg, GA, USA
    Beans
    221
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Add Windows XP to Grub 2

    I suspect you just need to run update-grub2 as root.
    The definition of insanity is doing the same thing over and over and expecting different results.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •