I am in a very strange situation and need some help: I installed Ubuntu 11.10 through Wubi a while back so that I can use it alongside Windows 7. I was running out of space on my disk when trying to install applications. Without understanding how Wubi worked, I partitioned my C drive (creating a new 90 GB partition) in Windows, booted from the Ubuntu 11.10 install/live disk, and used the "something else" option to create a ext4 (setting the mount point to root) and swap space partitions (/sda5 and /sda6). After the install, my computer no longer boots with the previous Wubi menu and is now using the Linux grub. The options I have are /sda2, which boots Windows 7; /sda1, which doesn't do anything and reloads the same menu, and the run Linux options. So I now have Ubuntu running on a separate partition, as well as the original Wubi install. I want to delete the seperate partition and go back to running Ubuntu on Wubi...if I remove the partition will I need the Windows 7 disk to restore the boot loader? I dont have the Windows 7 disk on me so what is the best way to clean this up so I get rid of the seperate partition?



thank you so much for your response. Actually, it would be fantastic if I could migrate my Wubi install into the new partition because I had downloaded the AOSP on the Wubi install (as well as other files) and would love to preserve them. If i can do that and work on the new partition with the old files than that would be great, and I can worry about wiping out the partition completely later on i.e. when I have the windows disk or something. Can you tell me how to do this migration?? So when I select the /sda2, it loads up my Windows. If i click on the Linux, it loads up the newly install Linux (my files that were on the Wubi install aren't there) fine. If I click on the /sda1 (SYSTEM_DRIVE... this is what the Wubi was using to boot the menu that let me select Windows 7 or Ubuntu)... it fails and just reloads the original menu.

Here is the link to my boot info script http://pastebin.com/dMrY0NL3

------------------------------------------------------EDIT 2-------------------------------------------------

I really appreciate the help bcbc. So I used the repair disk to run the "bootrec /fixboot", which now brings me to the Wubi Windows boot menu... It asks to select Windows 7 or Ubuntu just like it originally did. If I select Windows 7, it boots Windows without any problems. However, if I choose Ubuntu, it starts to boot Ubuntu by displaying the Ubuntu logo with the progress bar, then displays the purple screen. After this, it goes to dark screen and just sits there until I have to power off. The first time I tried it, it gave me a black screen with some few lines of output::

*Checking battery state... [ok] grub_editenv: error: cannot write to file /boot/grub/grubenv.new *Stopping System V runlevel compability [ok] *Starting CUPS printing spooler/server [ok]

It hung here for a while.. then printed [3672.070711} iwlagn 0000:03:00.0: Aggregation not enabled for tid 0 because load 0.

Is this problem/error you mentioned I might have in my Wubi boot?? Can you help me fix it :) ??

  • 1
    Is it that you want to run your old install (that happens to be wubi), or that you want to run Ubuntu using the wubi method? Because you can migrate your Wubi install to the 90GB partition and have both the same, old install as well as the increased space. Also, maybe run the bootinfoscript, pastebin it, and include the link. Also, when you select Windows, you still get to see Windows and Ubuntu (right?) and then when you select Ubuntu it still boots okay (your wubi install) or fails? Please update your questions with any response. – bcbc Nov 8 '12 at 2:06
  • Somehow you've got grub installed on /dev/sda1 which explains why selecting this just goes back to the grub menu. You'll have to fix this before proceeding... and for that you require a Windows repair CD (or I guess testdisk might work as well). Here's an old but still valid guide on how to fix it (just one typo - bootrect should be bootrec): sourceforge.net/apps/mediawiki/bootinfoscript/… – bcbc Nov 8 '12 at 18:10
  • I would only migrate if you're going to remove Wubi. If you plan to go back to Wubi later, then don't bother migrating (or you'll have to manually copy back changed files to the Wubi install) – bcbc Nov 8 '12 at 18:12
  • PS I also noticed that the Wubi root.disk has a problem (note this is sometimes benign - it might still boot okay), but once you get your Windows boot manager back, if Wubi doesn't boot, let me know and I'll show you how to fsck it. – bcbc Nov 8 '12 at 18:23
  • I added some fsck instructions. PS when you make an edit to your questions, please add a comment as well (it sends me a notification). Thanks – bcbc Nov 9 '12 at 21:50

Whenever you install Ubuntu in a dual boot (non-Wubi), it replaces your Windows bootloader with Grub. Grub's bootloader is more complex than Windows' and has to load up modules from the Ubuntu partition. So, if you delete the partition, Grub will fail to load successfully, and will be unable to boot Windows. Instead you'll see a grub rescue prompt.

So the first step in uninstalling is to replace the Grub bootloader with a Windows equivalent.

To install a Windows bootloader, boot Windows and create a Repair CD. Boot from the repair CD (or from your original Windows DVD) to a repair prompt and run:

bootrec /fixmbr

(If you use Windows XP then the command is: fixmbr)

If you can't boot Windows and can't create a repair CD, you can install something like lilo which works the same. Boot from an Ubuntu CD/USB and select "Try Ubuntu", connect to the internet and drop to a terminal (Ctrl+Alt+T):

sudo apt-get update
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

Note, when you install lilo it will popup a big warning. You can ignore this - Tab to OK and hit enter. Also, if you don't boot from /dev/sda change as appropriate.

Once you're replaced the bootloader, make sure that the computer boots straight into Windows. After that you can go and delete the Ubuntu partition and swap partition and reclaim the space etc.


If you install Ubuntu as a dual boot and find that Windows no longer boots, then run the bootinfoscript. If you see something like this:

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Grub2 (v1.99)
    Boot sector info:   Grub2 (v1.99) is installed in the boot sector of sda1
                       and looks at sector 856028928 of the same hard drive
                       for core.img. core.img is at this location and looks
                       for  on this drive. No errors found in the Boot
                       Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD

Then it means that grub has overwritten the Windows boot sector and Windows cannot boot. Sometimes it just goes straight back to the grub menu, but not always. First, file a bug as this should never happen, and then fix it either by booting from a Windows repair CD and, from a repair prompt, run:

bootrec /fixboot

Or, from Ubuntu, you can recover the backup boot sector... First install testdisk:

sudo apt-get install testdisk
sudo testdisk

Then restore the backup boot sector using this guide to the testdisk screens:

First   screen:  Select "No Log" and press enter.
Second  screen:  Select the hard drive containing  the Windows system partition and  choose "proceed".
Third   screen:  "intel"
Fourth  screen:  "advanced",
Fifth   screen:  Select the Windows system partition  and choose "boot"
Sixth   screen:  "BackupBS"
Seventh screen:  type "Y" to confirm

Edit 2

If you run the bootinfoscript and see something like:

sda2/Wubi: _____________________________________________________________________

    File system:       ext3
    Boot sector type:  -
    Boot sector info:  
    Mounting failed:   mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Then it indicates some internal file system corruption in the root.disk. What you need to do is fsck the root.disk. (I'd also recommend running chkdsk /f in Windows beforehand for good measure because there could be corruption there as well).

In your particular case you can mount and fsck the root.disk from your other install:

sudo mount /dev/sda2 /mnt
sudo fsck /mnt/ubuntu/disks/root.disk
sudo umount /mnt

Note: you can supply options to fsck such as -fvy. (force/verbose output/answer yes to all prompts).

  • Thank you so much for your help bcbc. Unfortunately, I wasn't able to boot after performing the fsck to /sda1. My boot would go to the purple Ubuntu screen, then dark... nomodeset didn't help at all and I was unable to solve the problem. Due to time constraints, I wiped out Wubi and restarted building everything for AOSP on the new partition. Thanks again – Pareen Nov 14 '12 at 21:32
  • You're welcome for the help! Unfortunately it didn't turn out well. Not all corrupted Wubi installs are recoverable - and it's unclear to me what the major factors are in deciding this or even which Wubi installs become corrupted, but certainly many corrupted root.disks are recoverable through chkdsk and fsck. I think you'll be better off on the new partition. – bcbc Nov 14 '12 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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