Edit grub Menu In Ubuntu 9.10 and Older
Posted by cquirke on 20 November 2009
Windows users who install Ubuntu as a dual boot installation to try it out, will usually want their PCs to boot into Windows by default. Ubuntu makes this possible, but not easy; it’s a major “paper cut” to address.
Ubuntu 9.04 and older
Before Ubuntu 9.10, you would start a Terminal session and do this:
You can set an explicit default boot entry, but I prefer to leave grub to boot the first entry as it does by default, but make that first entry the one I want.
So, when editing the menu.lst file, I usually cut the entry at the end of the file that launches Windows, and paste it into the top of the section that defines the boot menu entries. I then rename the displayed text from something horrible like “Microsoft Operating System” to what I want, e.g. “Windows 7 Pro 64”. Then I page down and delete the redundant do-nothing “Other Operating Systems” entry at the end.
Ubuntu 9.10 with grub 2
Ubuntu 9.10 uses a newer version of grub that works differently; do this:
You can’t edit the menu text that will be displayed in the boot menu anymore, because the new grub version doesn’t use your setting file directly. Instead, it builds a new internal “don’t edit this” settings file that combines your settings with what it detects – and the menu entry text is built from what it detects, not your settings. The update-grub command is needed to force a new build of the internal settings file.
When I edit the grub file, I don’t try to specify which boot menu entry to use by default, nor re-arrange the order of these entries with my choice at the top. Because update-grub spawns a new menu that may differ from what is in effect as I edit the grub file, the first approach could misfire, and the second approach won’t work.
Instead, I use a new “saved” value for the “default” setting, which has the happy effect of defaulting to whatever the user chose last time.
But by default, the grub boot menu is not displayed, so I change entry to force it to be displayed, and set the timeout value after which the default kicks in:
If you dual-boot Ubuntu (or similar, using grub) and Windows, have multiple Windows-visible partitions, and use WAIK or OPK imaging tools (WinPE, ImageX) then there’s a serious bum-biting trap waiting for you – not so much a bug, as a natural consequence of how grub works.