[SOLVED] Ubuntu Startup-manager killed my windows partition entry in GRUB2
Jan0
The issue
I had a scary thing happen the other day: the windows xp entry on GRUB2’s boot screen went missing! This happened shortly after the windows partition had been encrypted with a McAfee product. Ubuntu didn’t remove the entry itself; it was actually only after I tried to make a change to the startup configuration using a program called Startup-manager (you may have it in System > Administration) that the windows entry was removed. It was bad enough that Ubuntu could no longer see any files on the windows partition (mounted as /windows), but now I had no way to boot into windows to retrieve files.
The fix
And of course, I had no freaking clue how to manually modify GRUB2’s startup screen. But after some digging, I figured out how to do it. This worked for me in Ubuntu 9.10 Karmic Koala. Hopefully it will save someone else’s day:
- Figure out where windows is. Is it /dev/sda1 (very likely)? /dev/sda2? To do this:
- System > Administration > Disk Utility
- Click each partition and find the one which matches the size of your bootable windows parition and which, when selected, shows a partition type of HPFS/NTFS. Example:

- Note the location of the partition; it is the last line of the descriptors of the partition. In the screenshot above, mine is /dev/sda1.
- Press ALT+F2
- enter the command gksudo gedit /etc/grub.d/40_custom
- below the comments in this file, and below any other entries which may have been added by one thing or another, add the following:
[/sourcecode]
echo “Adding Windows XP on {LOCATION OF YOUR WINDOWS PARTITION}” >&2
cat << EOF
menuentry “Windows XP Professional (on {LOCATION OF YOUR WINDOWS PARTITION})” {
insmod ntfs
set root=(hd0,{JUST THE LAST NUMBER OF THE LOCATION OF YOUR WINDOWS PARTITION})
drivemap -s (hd0) ${root}
chainloader +1
}
EOF[/shortcode] - Replace {LOCATION OF YOUR WINDOWS PARTITION} in the code above with the location of your windows partition.
- Replace {JUST THE LAST NUMBER OF THE LOCATION OF YOUR WINDOWS PARTITION} with the last number of the location of your windows partition. E.g. /dev/sda1 would be 1.Your file will now look something like this:

- Save the file and close the editor.
- Press ALT + F2.
- enter the command gksudo grub-mkconfig
That should be it. When you reboot, you should see your windows as a bootable option again.
Morals
The moral of this tale is to avoid startup-manager for grub configuration changes unless you’ve not got funky partitions. Keep in mind that future versions of start-up manager may fix this issue; the version i’m using is 1.9.12-ubuntu1.
Credits
I would not have been able to troubleshoot this issue if it weren’t for the following gracious contributions to the global knowledgebase.
- Grub2 Introduction by ranch hand
- Grub2 @ Ubuntu Help Wiki by many people
- HOWTO: StartUp Manager & Kernel Display Options by drs305
- many others who posted about their 40_custom grub file configurations
100 Days
Recent Posts
- DIRECT link to download JRE5 Update 20-something
- [SOLVED] “fatal: Could not read bundle ‘/path/to/your/file.ext’.” during git clone
- [SOLVED] Ubuntu Startup-manager killed my windows partition entry in GRUB2
- [SOLVED] Screen Resolution resets to something undesired in Ubuntu 9.10 Karmic
- Experiment 20090618
Categories
Tags
Archives
100 Days 2008
100 Days 2009
- Carianne Garside: 100 Paintings
- Dave Pender – 100 Drawings
- Everyone – 100 Days 2009
- Jessica Somers – 100 Photographs
- John Timmons – 100 Sounds
- Maggie Ducharme – 100 Meals
- Mindy Bray – 100 Digital Photos
- Neha Bawa – 100 Poems
- Sharrilyn – 100 Freebies
- Steve Ersinghaus – 100 Stories
- Susan Ersinghaus – Suburbs
Lifestream
-
Melissa Burwood commented on her post.— March 10th via FaceBook
-
Melissa Burwood commented on Jackie Burwood's photo.— March 10th via FaceBook
-
Daren Casey commented on Tunxis Community College's photo.— March 10th via FaceBook
-
Richard Dubey commented on your status.— March 10th via FaceBook
-
Daren Casey commented on your status.— March 10th via FaceBook
-
Richard Dubey commented on your status.— March 10th via FaceBook
-
Neha Bawa commented on your status.— March 10th via FaceBook
-
Jessica Somers commented on your status.— March 10th via FaceBook
-
Neha Bawa commented on your status.— March 10th via FaceBook
-
Kerry Ann Kowar commented on your status.— March 10th via FaceBook
