Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I managed to install 10.04 on a system that already has 8.04 (separate partitions, of course). It also installed GRUB2 onto the MBR.

After discovering that there is no menu.lst anymore, I edited /etc/grub.d/40_custom to point to where my other OS partitions are:

menuentry "Ubuntu 8.04" {
set root=(hd0,0)
linux /boot/vmlinuz-2.6.24-28-generic
initrd /boot/initrd.img-2.6.24-28-generic
}

menuentry "Windows 7 Ultimate 64-bit" {
set root=(hd0,2)
chainloader (hd0,2)+1
}

GRUB2 displays the menu with those entries but when I select any of them, it refuses to load them, saying "No such partition".

I know the partitions are there, as 10.04's "Disk Utility" sees them without any problem.

How do I get GRUB2 to recognize them?

share|improve this question
    
Is it a good idea to install legacy GRUB and GRUB2 OSes side by side? Just out of curiosity –  user Apr 18 '11 at 15:49
add comment

2 Answers 2

Did you make your edited 40_custom file executable using a command in the form:

sudo chmod +x /etc/grub.d/filename

See the tutorials:

http://ubuntuforums.org/showthread.php?t=1195275

http://www.dedoimedo.com/computers/grub-2.html

And, of course, there is a series of steps in addition to merely editing the 40_custom file, along the lines of:

  • Run sudo update-grub to get the current available kernels.
  • Copy the desired "menuentry" listings from /boot/grub/grub.cfg to /etc/grub.d/40_custom The entry begins with the line starting with "menuentry" and ends with a line containing "}".
  • Add any other "menuentry" items you wish to see on the boot menu.
  • Edit the titles of the "menuentry" line if desired (between the quotation symbols). Do not change the lines following the "menuentry" line. Each entry should start with a "menuentry" line and end with a "}" on the last line.
  • Remove the executable bit from /etc/grub.d/10_linux, /etc/grub.d/20_memtest86+ and /etc/grub.d/30_os-prober Removing the executable bit from any file in /etc/grub.d will exclude the file from being included in grub updates. Code: sudo chmod -x /etc/grub.d/10_linux /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober
  • Run "sudo update-grub"
share|improve this answer
    
Thanks for your well guiding answer. I managed to solve the problem in the meanwhile, I will post the answer shortly. +1 from me. :) –  Android Eve Dec 31 '10 at 18:43
add comment
up vote 1 down vote accepted

Problem solved: The answer is... Unlike legacy GRUB, GRUB2 starts counting partitions from 1, not from 0.

The key was the following instructions of how to "convert" menu.lst entries to 40_custom entries, taken from the following link

https://help.ubuntu.com/community/Grub2#Creating%20the%20Custom%20Menu

The following entries from the GRUB menu listing must be changed for them to work:

    * title is changed to menuentry. The line must end with {
    * root is changed to set root=
    * kernel must be changed to linux
    * Any partition designation (sda4, sdb6) must be changed, as GRUB and GRUB 2 count the partitions differently. The first partition for GRUB 2 is 1, not 0. Devices still start the count at 0. 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.