← Back to team overview

ubuntuforums-unanswered team mailing list archive

Re: [Question #78588]: Removing old versions of Ubuntu 9.04 from boot list.

 

Question #78588 on Ubuntu changed:
https://answers.launchpad.net/ubuntu/+question/78588

Sam posted a new comment:
> howmany=2
> Note that system files often have a lot of lines starting with # as this stops the machine taking any notice of > what's on the line.

Unfortunately that is uncorrect for section 'Automagic Kernel List', including the 'howmany_command'.
The comment symbol # has a special role in menu.lst, which is a control file only used by GRUB. In the inner section will be parameters saved for the support app 'update-grub'. Since GRUB doesn't understand them, it was an agreement to avoid syntax errors that parameters for 'update-grub' have one # comment symbol. 
Real comments have two ## symbols.

For the record:
Lines with two or more ## are always comments.
Lines with one # in the inner block are commands for update-grub, if these keywords follow #
alternative, altoptions, defoptions, groot, howmany, kopt, lockalternative, lockold, memtest86, nonaltoptions, recovery, savedefault, updatedefaultentry, xenhopt, xenkopt
Other lines with one # are comments.
Lines without # are commands for GRUB itself

Hence, recommendation is using a text editor which supplies syntax highlighting, e.g. nano, vim
http://media.ubuntuusers.de/wiki/attachments/10/28/menu.lst-nano-bunt.png

Quote menu.lst
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

e.g.
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=2


Markers in menu.lst are:

### BEGIN AUTOMAGIC KERNELS LIST
## ## Start Default Options ##
## ## End Default Options ##
### END DEBIAN AUTOMAGIC KERNELS LIST

-- 
You received this question notification because you are a member of UF
Unanswered Posts Team, which is an answer contact for Ubuntu.