James Revillini

Say 'no' to styrofoam.

Tag: ubuntu

[SOLVED] Ubuntu Startup-manager killed my windows partition entry in GRUB2

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:

  1. Figure out where windows is.  Is it /dev/sda1 (very likely)? /dev/sda2?  To do this:
    1. System > Administration > Disk Utility
    2. 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:
    3. 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.
  2. Press ALT+F2
  3. enter the command gksudo gedit /etc/grub.d/40_custom
  4. 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 language=”plain”][/sourcecode][/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]

  5. Replace {LOCATION OF YOUR WINDOWS PARTITION} in the code above with the location of your windows partition.
  6. 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:
  7. Save the file and close the editor.
  8. Press ALT + F2.
  9. 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.

[SOLVED] Screen Resolution resets to something undesired in Ubuntu 9.10 Karmic

Assuming you have a monitor that supports some high resolution, say 1680 x 1050, and you’re using an nvidia card:

  1. System > Administration > Hardware Drivers
  2. Make sure the latest recommended nvidia proprietary driver is activated (if not, do it and reboot)
  3. System > Preferences > Display (it should ask if you want to use the proprietary config screen – select ‘Yes’)
  4. Select X Server Configuration
  5. Set the resolution to what you want and ‘Apply’, then quit the nvidia-settings screen.
  6. System > Preferences > Display (when it asks this time, select ‘No’)
  7. Click ‘Apply’
  8. Click ‘Keep configuration’ (assuming everything looks OK)
  9. Click Close

When you reboot, everything should be preserved.  I still notice a flicker on the boot-up screen when I think it tries to reset it to something else, but it should stay at the resolution you specified.

© 2017 James Revillini

Theme by Anders NorenUp ↑