Quackers said: manzdagratiano, what does your /etc/grub.d folder contain?
Erm... apologies for the late reply... Here's what's in my /etc/grub.d:
manjul@chaar:~$ ls /etc/grub.d/
00_header 10_linux 20_memtest86+ 40_custom README
05_debian_theme 20_linux_xen 30_os-prober 41_custom
manjul@chaar:~$ cat /etc/grub.d/41_custom
#!/bin/sh
cat <<EOF
if [ -f \$prefix/custom.cfg ]; then
source \$prefix/custom.cfg;
fi
EOF
manjul@chaar:~$ cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# 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.
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/758887
indicate, the respective multiple entries are not artifacts of leftover kernels... in fact, I am very very religious about removing old kernels after every upgrade. For example, here's my grub.cfg:
manjul@chaar:~$ cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 9904cf51-bb50-4343-a112-dbc2056bac3c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 089f196f-2f3c-4615-aff4-8babd1e6a29f
set locale_dir=($root)/grub/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 9904cf51-bb50-4343-a112-dbc2056bac3c
insmod tga
background_image -m stretch /usr/share/images/grub/Windbuchencom.tga
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 ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 9904cf51-bb50-4343-a112-dbc2056bac3c
insmod tga
if background_image /usr/share/images/grub/Windbuchencom.tga; then
true
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 089f196f-2f3c-4615-aff4-8babd1e6a29f
linux /vmlinuz-3.0.0-12-generic root=UUID=9904cf51-bb50-4343-a112-dbc2056bac3c ro quiet splash vt.handoff=7
initrd /initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, with Linux 3.0.0-12-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 089f196f-2f3c-4615-aff4-8babd1e6a29f
echo 'Loading Linux 3.0.0-12-generic ...'
linux /vmlinuz-3.0.0-12-generic root=UUID=9904cf51-bb50-4343-a112-dbc2056bac3c ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 089f196f-2f3c-4615-aff4-8babd1e6a29f
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 089f196f-2f3c-4615-aff4-8babd1e6a29f
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Arch Linux (on /dev/sda4)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set=root 9dc8bfcc-97ed-440f-876f-4fbca4d8079c
linux /boot/vmlinuz26 root=/dev/sda4
initrd /boot/kernel26.img
}
menuentry "Arch Linux (on /dev/sda4)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set=root 9dc8bfcc-97ed-440f-876f-4fbca4d8079c
linux /boot/vmlinuz-linux root=/dev/sda4
initrd /boot/initramfs-linux.img
}
menuentry "Debian GNU/Linux (wheezy/sid) (on /dev/sda7)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root 04608121-4401-49e7-9e31-40b22377ba00
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry "Debian GNU/Linux (wheezy/sid) (on /dev/sda7)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root 04608121-4401-49e7-9e31-40b22377ba00
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry "Debian GNU/Linux (wheezy/sid) (on /dev/sda7)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root 04608121-4401-49e7-9e31-40b22377ba00
linux /boot/vmlinuz-3.0.0-2-amd64 root=/dev/sda7
initrd /boot/initrd.img-3.0.0-2-amd64
}
menuentry "Debian GNU/Linux (wheezy/sid) (on /dev/sda7)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root 04608121-4401-49e7-9e31-40b22377ba00
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry "Debian GNU/Linux (wheezy/sid) (on /dev/sda7)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root 04608121-4401-49e7-9e31-40b22377ba00
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sda8)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 9badb81d-44aa-452e-b1be-301e459898f9
linux /boot/vmlinuz root=/dev/sda8
initrd /boot/initrd.gz
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sda8)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 9badb81d-44aa-452e-b1be-301e459898f9
linux /boot/vmlinuz root=/dev/sda8
initrd /boot/initrd.gz
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sda8)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 9badb81d-44aa-452e-b1be-301e459898f9
linux /boot/vmlinuz-generic-2.6.38.7 root=/dev/sda8
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sda8)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 9badb81d-44aa-452e-b1be-301e459898f9
linux /boot/vmlinuz-huge-2.6.38.7 root=/dev/sda8
}
menuentry "Gentoo Base System release 2.0.3 (on /dev/sda9)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos9)'
search --no-floppy --fs-uuid --set=root f78cc2a6-2ff1-4d06-a523-e24039710306
linux /boot/kernel-2.6.39-gentoo-r3 root=/dev/sda9
}
### 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 ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
manjul@chaar:~$ sudo mount /dev/sda7 /mnt
[sudo] password for manjul:
manjul@chaar:~$ ls /mnt/boot/
config-3.0.0-2-amd64 System.map-3.0.0-2-amd64
initrd.img-3.0.0-2-amd64 vmlinuz-3.0.0-2-amd64
manjul@chaar:~$
Edit: Oh yeah - and the entries in the root of /dev/sda7 are just symlinks:
manjul@chaar:~$ ls -al /mnt/vmlinuz
lrwxrwxrwx 1 root root 26 2011-10-18 22:22 /mnt/vmlinuz -> boot/vmlinuz-3.0.0-2-amd64
manjul@chaar:~$ ls -al /mnt/initrd.img
lrwxrwxrwx 1 root root 30 2011-10-18 22:22 /mnt/initrd.img -> /boot/initrd.img-3.0.0-2-amd64
However, despite this, I love grub2 - I think os-prober is SO much better than having to edit menu.lst. When I installed Arch on my fianceƩ's laptop, I had some trouble setting grub up to detect the Winblows (oh how I would love to wipe it off! But she needs it for some proprietary Dental school stuff) - grub2 and problem solved!