Recently, I executed the following command:grub2-mkconfig -o /boot/grub2/grub.cfgNow I have 6-7 Linux entries + 1 windows entry.How do I remove older kernel entries?I don't want to remove all the recovery kernel options by using: GRUB_DISABLE_LINUX_RECOVERY=true
How can I remove GRUB2 entries in Fedora 16?
fedora;grub2
The file /boot/grub2/grub.cfg is generated automatically by the grub2-mkconfig command, which will be run automatically when a new kernel is installed.  This command iterates over available  kernel packages on your system.  Attempts to directly edit this file will ultimately fail (because the entries you commented out will simply be regenerated).As @jw013 says, the easiest solution is to simply remove kernel packages if you don't want to use them anymore.If you need to edit options in this file, you can edit /etc/default/grub, which defines shell variables used in the generation scripts.  You can also look in /etc/grub.d, which is a collection of shell scripts that are run to generate the configuration.