Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
#
# 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 ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd2,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
if loadfont /usr/share/grub/unicode.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
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/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd2,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd2,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 01c3d871f965ac80
drivemap -s (hd0) ${root}
chainloader +1
}
### 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 ###
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369
Rep:
On which drive is windows xp ?
Because on one hand it says windows on sdb1 that is (hd1,0)
But root is set for windows as (hd0,0) that is sda1
So on which drive and partition is windows xp
Ubuntu Karmic 9.10 uses grub2. See this tutorial on grub2: https://wiki.ubuntu.com/Grub2
First open a terminal and try running:
Code:
sudo update-grub
This should update your grb.cfg file and hopefully add Windows to the list so you can boot it.
Also, did you do a dist-upgrade from 9.04 to 9.10, or did you do a clean install of 9.10? If you did an upgrade then I would recommend fully upgrading to grub2 as per this part of the tutorial: https://wiki.ubuntu.com/Grub2#Instal...untu%209.10%29
Then try running: "sudo update-grub" again. Then reboot.
If updating grub does not fix the problem, you can create a custom entry for XP in /etc/grub.d/ as per this part of the same tutorial: https://wiki.ubuntu.com/Grub2#User-defined%20Entries
The entry for XP would look something like this:
Code:
echo "Adding WindowsXP" >&2
cat << EOF
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
set root=(hd0,1)
chainloader +1
}
EOF
Be sure to change (hd0,1) to your XP partition. Remember, grub2 counts hard drives from 0 like grub-legacy, but counts partitions from 1, not 0.
Be sure to run: "sudo update-grub" after creating a custom entry.
Thanks guys - FYI those outputs were the result after running sudo update-grub.
The install is a clean one from the Alternate CD, as I couldn't get a GUI from either it or the desktop ISO (that's another story!!!)
I was confused as well by the XP drive being labelled by the GRUB menu as /dev/sdb1, I thought it was /dev/sda as well. Is that to do with the different way it now counts?
I'm sure Karmic is on /dev/sdc
blkid reports XP as on /dev/sdb1, whereas fdisk says it's /dev/sda1 - am I reading that right?
I'm not on that machine atm, but I will have a go at it later (about 7 or 8 hours local time) when I get home.
oh, btw, I've checked that the XP install is still OK by changing the boot order in BIOS and booting to it.
I will report back.
Last edited by von Stalhein; 11-19-2009 at 09:26 PM.
Reason: more info
I tried the custom entry method without luck :-( Various combinations of drives/partitions. After changing options, I chmodded and updated GRUB, and then rebooted. Countlessly.
I also installed the GRUB 2 to the /dev/sda and lost the ability to boot XP when it was moved in the bIOS boot order. Even though I tried 3 times to restore the mbr with the XP disk it failed.
However, I had a Supergrub CD, and it did the job, thank the flying spaghetti monster!!!
It's weird,even though there are 3 HDDs in this box, the HDD access LED is only hooked up to the XP c: disk. When GRUB is directed to pick that menu choice (the default one from the install process - /dev/sdb1), the drive light goes on.
If I ctrl-alt-del before the blinking cursor disappears, the system will reboot.
Last edited by von Stalhein; 11-20-2009 at 05:01 AM.
I was confused as well by the XP drive being labelled by the GRUB menu as /dev/sdb1, I thought it was /dev/sda as well. Is that to do with the different way it now counts?
I'm sure Karmic is on /dev/sdc
blkid reports XP as on /dev/sdb1, whereas fdisk says it's /dev/sda1 - am I reading that right?
You have 2 NTFS partitions according to fdisk and blkid: /dev/sda5 and /dev/sdb1. Do you know which one is XP?
Your grub.cfg says:
Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 01c3d871f965ac80
drivemap -s (hd0) ${root}
chainloader +1
}
But the set root= line in grub2 is (or at least was before you used Super Grub disc) pointing to /dev/sda1 (hd0,1). Remember, grub2 starts counting hard drives from 0, but partitions start from 1.
If XP is on /dev/sdb1, that would be (hd1,1) in grub2. So a custom entry in /etc/grub.d for XP would be something like:
Code:
echo "Adding WindowsXP" >&2
cat << EOF
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root=(hd1,1)
drivemap -s (hd1) ${root}
chainloader +1
}
EOF
The lines I have put in bold may be optional. I'm not sure if you need them or not for Windows. I'm still trying to get up to speed with grub2 myself.
Do the following:
1. Set the BIOS boot order such that the hard disk "sdc" (the third HDD) gets first priority.
2. Create (add) an entry as follows in grub.cfg:
Code:
menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
set root=(hd1,1)
chainloader +1
}
Try booting to this entry n let me know what happens.
By the way if u didnt explicitly set the mappings how/from where did you list it in post #1??
Do the following:
1. Set the BIOS boot order such that the hard disk "sdc" (the third HDD) gets first priority.
2. Create (add) an entry as follows in grub.cfg:
Code:
menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
set root=(hd1,1)
chainloader +1
}
Try booting to this entry n let me know what happens.
By the way if u didnt explicitly set the mappings how/from where did you list it in post #1??
1. The boot order has /dev/sdc as the first in order. The BIOS calls /dev/sdc SCSI-0, /dev/sdb Ch0-M, and /dev/sda Ch0-S
2. Created an entry as detailed above in etc/grub.d, called it "50_addxp" and chmodded it. When selected in the GRUB 2 menu it returns "error, no such partition.
I got the device map listings by looking in /boot/grub/device.map
I tried to make it simpler for poor old GRUB by removing the disk without an OS on it. It still won't kick XP in to boot.
It might sound weird, but on selecting the XP menuentry the HDD light activates while the blinking cursor appears in the top LHS of the screen, and then it goes jet black and requires a hard reset to get back to the GRUB menu. I know it's that drive as it was the first one I installed when I built the machine, and the only one hooked up to a LED.
It's as if there's not enough of something to get it over the boot hump I've changed the boot order to check that XP boots OK, and it's fine. I wonder if there's some sort of parameter in GRUB that needs to be added or removed to let it start?
As before, in the BIOS the Karmic disk is first in order.
Grub.cfg is now:
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 ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
if loadfont /usr/share/grub/unicode.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
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=15
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/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-15-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 01c3d871f965ac80
drivemap -s (hd0) ${root}
chainloader +1
}
### 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 ###
ok.. I never needed to work in /etc/grub.d. Modifying /boot/grub.cfg always gave me the required output.
Grub will not work if you take off a HDD simply because doing so will change the device mappings.
Could you create a new grub.cfg file in /boot/grub (just rename the existing one) and just put in the following entries:
Code:
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
set root=(hd0,1)
chainloader +1
}
And see what happens... I am assuming that you have grub installed to mbr of /dev/sdb which should have higher boot priiority
ok.. I never needed to work in /etc/grub.d. Modifying /boot/grub.cfg always gave me the required output.
Grub will not work if you take off a HDD simply because doing so will change the device mappings.
Could you create a new grub.cfg file in /boot/grub (just rename the existing one) and just put in the following entries:
Code:
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
set root=(hd0,1)
chainloader +1
}
And see what happens... I am assuming that you have grub installed to mbr of /dev/sdb which should have higher boot priiority
Yes, /dev/sdb or as the BIOS calls it SCSI-0 is the first boot option.
Did what you suggested - made a grub.cfg file and then from gksudo nautilus pasted it into the /boot/grub/ dir.
The output when that menu item was selected was
Code:
GRUB_
and the bar was blinking - had to do a hard reset to get back t the GRUB menu.
Ok... that was supposed to work... but it does nt thats strange....
You seem to get the grub menu which means grub installation should be fine and i suppose the linux menu entry worked...
And since booting the windows HDD worked.... chainloader should ve worked....
Can you post output to
Code:
fdisk -l /dev/sda
fdisk -l /dev/sdb
Am assuming you ve not inserted your 3rd HDD back, yet
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.