My Ubuntu-Windows dual boot disappeared!

Post image for My Ubuntu-Windows dual boot disappeared!

by bledsoe on August 20, 2009

I've been thoroughly pleased with Ubuntu, the open-source operating system I've been using for the past several months.  I installed it on both my home and work computers, keeping my original Windows XP installations on both machines so I could easily boot into either system at startup, and the whole process has been mostly painless.

A few days ago, however, I needed to boot my work computer to Windows and was surprised to discover that the initial screen which displays the boot options no longer included Windows!  I managed to fight back my initial panic, as I couldn't imagine that my entire Windows system would just spontaneously disappear; I suspected that it was still there, but for some reason I just couldn't access it from the boot screen.  It turned out that this was in fact the case, and it also turned out that the fix was pretty simple.

If your PC is set up to dual boot Ubuntu and Windows, you have a file on your computer called menu.lst (that's an "L" after the dot) that generates the boot screen when you turn your computer on, displaying all of the boot options available to you.  Every time you update your Ubuntu system (e.g., with security updates from the Update Manager), Ubuntu automatically adds your latest Ubuntu installation to the top of this list, leaving the others below it in case you need to boot to a previous version after an update.  Your Windows boot option is the last one in the list, and sometimes it gets pushed so far down the list that it's no longer visible from the boot screen.  All you have to do is comment out a few lines from your menu.lst file, thus removing a few of the older Ubuntu versions from the list, and the Windows option will move back up to where it's visible.

From within Ubuntu, open up a terminal window and type sudo gedit /boot/grub/menu.lst, and enter your admin password.  Towards the bottom of the file, you'll see a comment that says "## End Default Options ##" followed by several blocks of code that look something like this:

title        Ubuntu 9.04, kernel 2.6.28-15-generic
uuid        16cba197-6288-4261-8bbd-367d837e9f61
kernel        /boot/vmlinuz-2.6.28-15-generic root=UUID=16cba197-6288-4261-8bbd-367d837e9f61 ro quiet splash
initrd        /boot/initrd.img-2.6.28-15-generic
quiet

title        Ubuntu 9.04, kernel 2.6.28-15-generic (recovery mode)
uuid        16cba197-6288-4261-8bbd-367d837e9f61
kernel        /boot/vmlinuz-2.6.28-15-generic root=UUID=16cba197-6288-4261-8bbd-367d837e9f61 ro  single
initrd        /boot/initrd.img-2.6.28-15-generic

title        Ubuntu 9.04, kernel 2.6.28-14-generic
uuid        16cba197-6288-4261-8bbd-367d837e9f61
kernel        /boot/vmlinuz-2.6.28-14-generic root=UUID=16cba197-6288-4261-8bbd-367d837e9f61 ro quiet splash
initrd        /boot/initrd.img-2.6.28-14-generic
quiet

title        Ubuntu 9.04, kernel 2.6.28-14-generic (recovery mode)
uuid        16cba197-6288-4261-8bbd-367d837e9f61
kernel        /boot/vmlinuz-2.6.28-14-generic root=UUID=16cba197-6288-4261-8bbd-367d837e9f61 ro  single
initrd        /boot/initrd.img-2.6.28-14-generic

Each of these "Ubuntu blocks" displays a separate line on your boot screen that allows you to boot into a version of Ubuntu. Farther down, at the very bottom of the file, you should see something that looks like this:

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Microsoft Windows XP Home Edition
root        (hd0,0)
savedefault
makeactive
chainloader    +1

This "Windows block" is what displays the line on your boot screen that allows you to boot into Windows.  Move back up in the file and find the last few "Ubuntu blocks." Choose several of these blocks, and in front of each line of the block, type a "#" in order to comment out that line.  (Be sure not to comment out the Ubuntu block at the top of the list, as that's your most current version.)  I commented out four blocks in my menu.lst file, making each block look like this:

#title        Ubuntu 9.04, kernel 2.6.27-14-generic (recovery mode)
#uuid        16cba197-6288-4261-8bbd-367d837e9f61
#kernel        /boot/vmlinuz-2.6.27-14-generic #root=UUID=16cba197-6288-4261-8bbd-367d837e9f61 ro  single
#initrd        /boot/initrd.img-2.6.27-14-generic

Then save the menu.lst file and reboot your computer.  Your boot screen should once again display the Windows boot option, and you're back in business.

[For more info, check out this post and this post, both from the Ubuntu forums.]

Update (10/26/2009): It appears that this bug has been fixed in one of the recent Ubuntu updates (I'm currently running Ubuntu version 9.04, Jaunty Jackalope.)  Now when my menu.lst file gets long, my boot screen allows me to scroll down to boot options that don't fit on the screen (e.g., the Windows boot option).  I have two computers running Ubuntu with the dual boot option, and both now allow scrolling on the boot screen.  Thanks, Ubuntu software development people!

Previous post:

Next post: