Editing grub.cfg has removed Windows from the boot menu, though Windows is present in grub.cfg file
Editing grub.cfg has removed Windows from the boot menu, though Windows is present in grub.cfg file
After editing grub.cfg following the below steps:
1. Windows is not listed in boot menu
2. After logging in unable to access windows drives
Though menu.cfg has Windows listed, why it is not displayed in boot menu?
Followed the steps mentioned at: http://
* Run sudo update-grub to get the current available kernels.
* Copy the desired "menuentry" listings from /boot/grub/grub.cfg to /etc/grub.
* 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.
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.
* Run "sudo update-grub"
* The updated /boot/grub/grub.cfg file should now contain only sections for "00_header", "05_debian_theme" and "40_custom".
* The grub.cfg file will not be updated with the addition of a new kernel. To add a new kernel, make "10_linux" executable, run "sudo update-grub" to refresh the available kernels, and repeat these instructions.
sections of the edited file.
*******
=======
menuentry "Ubuntu, Linux" {
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 2f8cf227-
linux /boot/vmlinuz-
initrd /boot/initrd.
}
menuentry "Ubuntu, Linux (recovery mode)" {
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 2f8cf227-
linux /boot/vmlinuz-
initrd /boot/initrd.
}
### END /etc/grub.
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set e2c0e27ec0e257f5
drivemap -s (hd0) ${root}
chainloader +1
*******
=======
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 2f8cf227-
if loadfont /usr/share/
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.
### BEGIN /etc/grub.
set menu_color_
set menu_color_
### END /etc/grub.
### BEGIN /etc/grub.
# 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.
menuentry "Ubuntu, Linux" {
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 2f8cf227-
linux /boot/vmlinuz-
initrd /boot/initrd.
}
menuentry "Ubuntu, Linux (recovery mode)" {
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 2f8cf227-
linux /boot/vmlinuz-
initrd /boot/initrd.
}
### END /etc/grub.
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set e2c0e27ec0e257f5
drivemap -s (hd0) ${root}
chainloader +1
### END /etc/grub.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu grub2 Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- actionparsnip
- Solved:
- 2009-12-03
- Last query:
- 2009-12-03
- Last reply:
- 2009-12-03
you do NOT edit grub.cfg
grub.cfg is GENERATED so next time you install a new kernel any and all changes WILL be lost
You need to edit the scripts and config files which grub uses to make that file so that the extra boot is permanent between updates
If you want to test simply run:
sudo update-grub
which is ran after a kernel update is installed, your change is no longer there
I suggest you read:
https:/
| Arindam (arindam-biswas) said : | #2 |
I have not edited grub.cfg directly. I have followed the steps mentioned in the above link to edit the files under /etc/grub.d folder and then generated latest version of grub.cfg by running update-grub.
| wojox (wojox) said : | #3 |
Try a closing bracket ( } ) after chainloader +1
Yours:
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set e2c0e27ec0e257f5
drivemap -s (hd0) ${root}
chainloader +1
Mine:
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set e2c0e27ec0e257f5
drivemap -s (hd0) ${root}
chainloader +1
}
| Arindam (arindam-biswas) said : | #4 |
:-). You got it right. Thanks a lot!!
| Arindam (arindam-biswas) said : | #5 |
Thanks actionparsnip, that solved my question.

