Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Ubuntu 12.04 via Wubi a couple of weeks ago, and today used the script on https://help.ubuntu.com/community/MigrateWubi to move it to a new partition. Now I'm having a bit of confusion about how to clean up the original Wubi install.

Here's the setup: two hard drives, /dev/sda contains my Windows 7 install, and /dev/sdb is a secondary drive with a large partition for data. I had Wubi installed on /dev/sdb1, and have now created two new partitions sdb2 and sdb3 for the installation and swap respectively.

On booting, the computer starts the Windows boot manager with two options, Windows and Ubuntu (this is the behaviour I want, as I use Windows the majority of the time and don't want to accidentally boot to Ubuntu while Windows is hibernated); but now the grub loader on choosing the Ubuntu option has suddenly become rather crowded. It seems that Wubi has been left intact at the top of the list, with the migrated version (on /dev/sdb2) pushed lower down on the list.

This has left me with two questions:

  1. How do I remove the Wubi installation from the grub list?
  2. Is it safe now to uninstall Wubi from within Windows while still allowing its boot manager to direct to Grub on the second drive?

Cheers.

EDIT: I've tried using the Ubuntu-Tweak program as advised below, and it raised rather an interesting question. There were a couple of old kernel versions which were also being shown in the grub list, and that I'd removed. Trying to run any of those gives an error along the lines of "You need to load the kernel first". sudo update-grub didn't take them off the list, and in fact according to the status output it should have also added Windows to grub (which it hadn't). Rebooted into Windows and ran bcdedit, and it looks like it's using Wubi's version of grub with the new version added (hence why update-grub isn't helping at all). This is the relevant section from the bcdedit output:

Real-mode Boot Sector
---------------------
identifier              {816916df-c233-11e0-a9e6-883a7e390b89}
device                  partition=G:
path                    \ubuntu\winboot\wubildr.mbr
description             Ubuntu

where "G:\ubuntu" was the original install folder for Wubi.

When I ran the migration script in the first place it said that it was installing Grub to /dev/sdb - but this on its own isn't a partition. Is there somewhere particular where the migration script could have installed Grub, i.e. somewhere I can point the bootloader so that it will use the correct version of Grub? (After that I'm pretty sure the question about uninstalling Wubi is a moot point)

share|improve this question
    
I've separated your questions from the main body of text for clarity. I can't say anything for the second one, but you might want to check this out for help with the first askubuntu.com/questions/2793/… –  Chris Wilson Mar 5 '13 at 16:57
    
@ChrisWilson Thanks for the link, I'll add my response as an edit as I think it'll be too long to fit here. –  Jez W Mar 5 '13 at 17:51
    
I am doing something similar HERE!!! askubuntu.com/questions/366001/ubuntu-13-10-grub-2-0 –  toobsco42 Oct 26 '13 at 5:29

1 Answer 1

up vote 1 down vote accepted

The Wubi migration will only ever install the Grub bootloader on the drive you are migrating to. In this case /dev/sdb. It does this to make things simpler (and I believe it's the safest option). So the easiest way to boot the migrated install is to set /dev/sdb to boot first in the BIOS options.

The way Wubi boots - and the way you are booting right now - is from the Windows Boot Manager (BCD store), wubildr.mbr (in the \ubuntu\winboot directory), then wubildr (C:\wubildr), then the grub.cfg from inside the Wubi install (the root.disk). This is where you are booting your migrated install from. If you uninstall Wubi ALL these things will be removed (not the Windows Boot Manager but it won't show, because the Wubi entry is deleted).

So you cannot boot the migrated install with the Wubi boot method after getting rid of Wubi. You can instead install grub to the migrated partition and use easyBCD to do it. But personally I wouldn't recommend this. If you have to boot from the drive containing windows (in your case /dev/sda) instead do this:

  1. Boot the migrated install
  2. Install grub to the MBR. Assuming the drive you boot from is /dev/sda you would run: sudo grub-install /dev/sda
  3. Change the boot order so Windows is first.

Code:

sudo mv /etc/grub.d/30_os-prober /etc/grub.d/09_os-prober
sudo update-grub

These last commands just change the order in which Grub generates the menu entries, placing the Windows entry (generated out of 30_os-prober) first.

PS. since you have already tweaked your grub menu on the migrated install, you probably just have to install Grub to /dev/sda to get things to work right and can leave the grub scripts alone.

share|improve this answer
    
Aye, thought as much on the uninstalling Wubi front, was holding off until I was sure it'd work otherwise. Were it only so simple as your "PPS" option - alas, this laptop's BIOS doesn't allow me to choose which HDD to use, just the order of CD/HDD/USB/etc. Then again this machine (an HP DV7) has a list of weird behaviours as long as my arm so not all that surprised. Thanks for pointing me in the right direction - I went with easyBCD in the end - as mentioned I prefer to load the Windows manager first, then if there's a hibernated session it'll boot automatically so I don't lose it. –  Jez W Mar 5 '13 at 20:47
    
Glad that worked out okay. I've used easyBCD before and it's good. But I'm pretty sure that Ubuntu won't mount a hibernated Windows partition (it requires you to force mount it). And unless you have the partition mounted automatically in /etc/fstab it shouldn't mess with it at all. In fact, I booted my 12.04 install today, and then rebooted back into my hibernated Windows 8 install with no issues at all (of course I didn't try to mount the `C:` partition but it would just refuse if I did). –  bcbc Mar 5 '13 at 20:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.