Grub
grub not to be confused with grub2 which is completely different !
Some extracts from the mailing list that need tidying up or pointing to good places that give this same info:
> Later I did an update and the boot order got altered again, so I > had to fix it a second time. It's not a big deal, but I'd like to > know what I'm doing wrong. Windows should stay as the default (top) option if you move it to above the line:
- BEGIN AUTOMAGIC KERNELS LIST
All of the Ubuntu kernels should be listed beneath it then. Otherwise it will be reordered.
> > Later I did an update and the boot order got altered again, so I > > had to fix it a second time. It's not a big deal, but I'd like to > > know what I'm doing wrong. > > I also have a similar grub issue on Debian, since I customise all the > kernel lines to add options for serial console boot, but when you then > install new packaged kernels and it auto-updates the menu.lst you lose > those additions. Annoyingly, the hooks (kopt=) that are supposedly > there for adding default options, don't seem to do anything, at > least on Debian 3.1 anyway.. I've had this before and it was when I had a syntax error in the text following the option, which I didn't really understand becasue I didn't think it was doing any checking of syntax but there you go - I fixed it and didn't look into it further. Anyway, yeah, the menu.lst is a template file and what you need to look for are the lines like:
- kopt=root=/dev/md1 ro
- altoptions=(recovery mode) single
You edit these (leave them commented!) and then run update-grub.conf and it parses them to construct stanzas that have these options on all of them. Installing a new kernel runs update-grub.conf as well, which is why you see your changes being overwritten. If you don't like this behaviour then simply do what the file says!:
- Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
[...]
- 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
Stanzas you put between these two sections will not be touched by update-grub.conf.
> I also have a similar grub issue on Debian, since I customise all the > kernel lines to add options for serial console boot, but when you then > install new packaged kernels and it auto-updates the menu.lst you lose > those additions. Annoyingly, the hooks (kopt=) that are supposedly > there for adding default options, don't seem to do anything, at > least on Debian 3.1 anyway.. I've never had any problem with these - remember to keep them commented using a single # symbol though. They're not actual GRUB options, but just read by the update-grub script. The comments for these options have a double # symbol, presumably so that update-grub doesn't try to interpret them. For instance:
- kopt=root=/dev/hda6 ro console=tty0 console=ttyS0,9600n8
- altoptions=(recovery mode) single console=tty0 console=ttyS0,9600n8
Then run update-grub and you'll get the full entries, such as: kernel /vmlinuz-2.6.8-2-686 root=/dev/hda6 ro console=tty0 console=ttyS0,9600n8
> My problem is that when Synaptic downloads a new kernel it adds it to the > menu.lst file with the same options I used when I installed and not the running > ones. Where can I find the list of default grub options that are added for new > kernels please? On Ubuntu, it's update-grub which changes the menu.lst file. If yours is anything like mine, it's set out so:
- menu.list - blah
... some options...
- BEGIN AUTOMAGIC KERNELS LIST
- More blah
- ## Start Default Options ##
- kopt=root=/dev/hda5 ro
- other commented out default options
- ## End Default Options ##
... list of configured kernels on the system ..
- END DEBIAN AUTOMAGIC KERNELS LIST
... static configuration, other OSes, etc ... What you want to do is edit the stuff in between ".. Default Options" - you don't need to uncomment them, just edit them. Try backing up your menu.lst, make some changes and then run update-grub and see what happens. You might also want to look at the update-grub manpage.