How do I edit boot menu for Grub 2?
I just installed Debian squeeze. I installed grub to the MBR. It uses Grub 2. Apparently I'm not supposed to edit /boot/grub/grub.cnf, but /etc/default/grub and /etc/grub.d.
I looked at these and read The Readme as well as a tutorial at http://www.dedoimedo.com/computers/grub-2.html I'm still not sure of what to do. When I boot up I get 4 choices: 2 for Squeeze and two for another linux distro. I would like to edit the print out I get when I boot up, as well as add the partition for XP which wasn't included. This is /etc/default/grub: Quote:
This is /etc/grub.d Quote:
|
WinXP should have been detected and added to the grub2 menu. There is a script in /etc/grub.d (30_os-prober) whose job it is to detect installed OSs and add them to the menu. Since that didn't happen, you have to add the menu entry manually.
To add an entry for xp to the grub2 menu, edit file /etc/grub.d/40_custom to add the entry. Here's how: Quote:
I haven't found clear-cut instructions in the grub2 manual on how to remove a menu entry. After a few minutes of searching via www.google.com/linux, I found a method to do it. Disable /etc/grub.d/30_os-prober my making it non-executable: sudo chmod -x /etc/grub.d/30_os-prober. If you run grub_mkconfig at this point, you will have NO MENU ENTRIES. So, it's necessary to add the menu entries you do want to see to the /etc/grub.d/40_custom file BEFORE you run grub_mkconfig. Just copy the menu entries you want from /boot/grub/grub.cfg and paste them into /etc/grub.d/40_custom in the order you want to see them when you boot your machine. |
Thanks for the help. I ran grub-update and it detected the XP partition.
If I want to edit the menu entries that print out at boot from the bios: eg. Debian... (on /dev/sda2) to Lenny or Debian...(on /dev/sda6) to Squeeze I need to make my own custom scripts and then disable the other scripts; I can't edit the titles otherwise. Am I understanding this correct? Thanks |
Quote:
Please re-read the last paragraph I wrote. You need to disable the file that generates menu entries, and make entries in the 40_custom file. You do not have to write a script. Here is the comment from the 40_custom file. Quote:
At any time in the future, you can enable 30_os-prober and delete the entries in 40_custom to return the menu to it's normal state by running grub-mkconfig. |
All times are GMT -5. The time now is 05:06 PM. |