Something to keep in mind - when you install a kernel update, which usually happens every few months or even more frequently, all your work will be undone.
This is because there is a script called update-grub which is run when a new kernel is installed. This script changes all of the menu entries that are inside the area of the menu.lst file that is bounded by:
Code:
### BEGIN AUTOMAGIC KERNELS LIST
at the beginning, and
Code:
### END DEBIAN AUTOMAGIC KERNELS LIST
at the end. But you can decide exactly how this script operates. The script takes it's commands from the first part of that area, that looks like this:
Code:
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=b8744f06-3942-4dca-9e0d-1f367aaf1054 ro
# kopt_2_6=root=/dev/hdb1 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)
## [there is more like this]
## ## End Default Options ##
In this section, anything with only one '#' is actually a command to the update-grub script. Comments in this area have '##'. So all that commented text is telling you what you can do with the options. The options for update-grub that I have set, are:
Code:
# kopt=root=UUID=b8744f06-3942-4dca-9e0d-1f367aaf1054 ro
# kopt_2_6=root=/dev/hdb1 ro
# groot=(hd1,0)
# alternative=true
# lockalternative=false
# defoptions=quiet splash
# lockold=false
# altoptions=(recovery mode) single
# howmany=2
# memtest86=true
(Please do not copy and paste these into your own file, by the way, especially not the first one - it refers to a specific partition on a specific disk, mine)
Now I don't actually understand all of those options, but I do know that the 'howmany=2' means that it will only look for my two most-recent kernels and give me menu entries for those, and the 'alternative=true' and 'altoptions=(recovery mode) single' options mean that for each of those two kernels I will get another (alternative) menu entry which will have the same name except that it will have '(alternative)' at the end, and it will be the same as the standard entry except that the 'single' parameter will be passed to the kernel, which tells it to boot in single-user (root) mode.
So you might want to edit this area as well.
But, before you do I suggest you take a copy of the file:
Code:
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.working
then if anything goes wrong you can restore it like this:
Code:
sudo cp /boot/grub/menu.lst.working /boot/grub/menu.lst
Just remember that if things go wrong after you've installed a new kernel, you should run the update-grub script as well:
I hope this is helpful.
Bookmarks