Default Boot Specification with GRUB 2 (Ubuntu 9.10)

About this blog

Jamie's Mostly Linux Stuff

Various thoughts and adventures, including but not limited to Linux, assorted bits of hardware new and old, and occasionally Windows XP/Vista/7.

I got some good news in a comment over on Linux.com a few days ago. The problem I was looking at was setting the default boot selection on Ubuntu 9.10, or more generally with GRUB 2. The difficulty is that GRUB 2 regenerates its grub.cfg file, and during that generation it looks for additional Linux kernels in /boot and automatically includes any that it finds there. This means that when it is first installed, there are two "native" boot entries, one for a normal boot and one for a recovery boot. Additional boot options follow these two. So, for example on Ubuntu 9.10, if you want to boot Windows by default (ugh), the default would be option 4 (two for Linux and two for memtest86+, then Windows).

Unfortunately, when updates are installed and the kernel version is incremented, GRUB 2 finds another bootable kernel image, and adds it to the grub.cfg file, so now you have two for the new image, two for the old image, two for memtest86+, and uh-oh, your Windows boot has suddenly become option 6 rather than 4, and your default boot of option 4 gets you memtest86+. Probably not what you want.

What I just learned is that GRUB 2 will take not only numbers for the default boot, it will also take the "menu text" for the options. The only thing you have to be careful of is that it must be the complete text exactly as it appears in the menu. So if I want my S6510 to boot WinXP, I can set the boot default like this:

GRUB_DEFAULT="Microsoft Windows XP Professional (on /dev/sda1)"

This definition goes in the file /etc/default/grub, so that it will be preserved when GRUB regenerates its config file. Your exact text will vary, depending on what version of Windows you have, and where it is installed, of course. You can copy it out of grub.cfg the first time, to be sure you have it exactly right.

jw 19/11/2009

Post your comment

In order to post a comment you need to be registered and logged in

Log in or create your ZDNet UK account below

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

ZDNet UK Live

KC616

Oracle signs Solaris deals with HP and Dell: Find the answers in the Community FAQ free shipping wholesale product... http://bit.ly/cDUyaj

KC616

free shipping wholesale products: Read more »h handbags,NIKE shoes, jewelry, watches, and jacket and so on. We gua... http://bit.ly/cWcW1e

SpyScroll

Cyberwar defence plan is essential, says former CIA head: Michael Hayden, former head of the CIA and the National ... http://bit.ly/beLpKQ

Droid_News

SAP leads businesses into augmented reality http://bit.ly/9eMWYp | #Droid #Android

wholesalegurru

free shipping wholesale products: We mainly supply top mirror quality brand name products, such as wholesale handb... http://bit.ly/cWcW1e

CNSInstructor

Cyberwar defence plan is essential, says former CIA head: Michael Hayden, former head of the CIA and the N... http://bit.ly/9sn6ax #pdln4nx

AllAboutFashion

Oracle signs Solaris deals with HP and Dell http://bit.ly/9KVeqD

Droid_Phone

SAP leads businesses into augmented reality http://bit.ly/9eMWYp | #Droid #Android

AllAboutFashion

free shipping wholesale products http://bit.ly/c7cpX4

Droid_Phone

TalkTalk to sell mobile services via Vodafone deal http://bit.ly/bLVfxI | #Droid #Android

wholesalegurru

Oracle signs Solaris deals with HP and Dell: Find the answers in the Community FAQ free shipping wholesale product... http://bit.ly/cDUyaj

wholesalegurru

free shipping wholesale products: Read more »h handbags,NIKE shoes, jewelry, watches, and jacket and so on. We gua... http://bit.ly/cWcW1e

felixsprisci

DoJ joins whistleblower in Oracle fraud suit http://bit.ly/bMT3SJ

actatrudy

Update: free shipping wholesale products - ZDNet UK (... http://www.actahandbags.com/trends/free-shipping-wholesale-products-zdnet-uk-blog/

lisabarnes001

free shipping wholesale products: Read more »h handbags,NIKE shoes, jewelry, watches, and jacket and so on. We gua... http://bit.ly/bRvFgG

mensapparel2010

free shipping wholesale products: Read more »h handbags,NIKE shoes, jewelry, watches, and jacket and so on. We gua... http://bit.ly/9CXYG9

womensapparel20

free shipping wholesale products: Read more »h handbags,NIKE shoes, jewelry, watches, and jacket and so on. We gua... http://bit.ly/alnVOR

SharonFashion

free shipping wholesale products: Read more »h handbags,NIKE shoes, jewelry, watches, and jacket and so on. We gua... http://bit.ly/cWcW1e

ProtegoSS

Security guru demonstrates ATM machine hack http://bit.ly/augzs1

kompasstech

UK deems Google Wi-Fi data snatch safe: (Sign In or register below) Google moves to show YouTube has 'a very credi... http://bit.ly/9vHweP

Featured white papers

The need for email archiving

Without an effective system for archiving emails, organisations can find themselves unable to recover vital business records, leaving them open..

Download now

Dell Data Storage Summary

This study was conducted in the United States amoung IT decision makers with involvement in data centre purchases at companies..

Download now

Datasheet: Infrastructure as a Service

'Infrastructure as a Service' gives enterprises the flexibility to subscribe to the compute power and storage they require today with 'pay..

Download now

Community highlights

Rupert Goodwins

Picochip curries favour with Indian infrastructure partners

Blog Post Bath-based wireless company Picochip has done a multi-million pound deal with...

30 July, 2010 by Rupert Goodwins
Moley

TalkBack The ICO dodges the bullet every time. It never appears to consider the...

29 July, 2010 by Moley
J.A. Watson

Linux Mint 9 KDE Edition Released

Blog Post The final release of Linux Mint 9 KDE is available for download. It follows...

29 July, 2010 by J.A. Watson