0

I am using Ubuntu 12.04 LTS. I was trying to install Windows8 but at the partition selection I get this error "

We couldn't create a new partition or locate an existing partition

But I had installed windows several times from this media before and it worked fine. I think I am getting this error because I have Ubuntu 12.04 already. I want to dual boot with windows 8. How can I achieve that?

Zanna
  • 70,465
bl4ckh4t_SDB
  • 145
  • 1
  • 3
  • 10

1 Answers1

1

Installing Windows

Step 1) Using gparted from the Ubuntu live cd make an ntfs partition.

Step 2) Install windows 8 at this point you will lose the ability to get into ubuntu.

Live CD automatic repair

Step 3) Insert your Ubuntu CD, reboot your computer and set it to boot from CD in the BIOS and boot into a live session. You can also use a LiveUSB if you have created one in the past.

Step 4) Install and run Boot-Repair

Step 5) Click "Recommended Repair".

Step 6) Reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

Using Terminal to restore GRUB

Step 3) Open a terminal either from the menu or use the Keyboard Shortcut: CTRL + ALT + T.

Step 4) in the terminal type

sudo grub-install /dev/XXX

where XXX is the device of your Ubuntu install. (eg: grub-install /dev/sdb). Hint: You can also use /dev/disk/by-label/ if the partition you installed on has a label. You can determine the /dev node for such a device by running:

ls -l /dev/disk/by-label/

This will give the output of something like:

lrwxrwxrwx 1 root root 10 Oct 16 10:27 data -> ../../sdb2
lrwxrwxrwx 1 root root 10 Oct 16 10:27 data2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 16 10:27 fat -> ../../sda6
lrwxrwxrwx 1 root root 10 Oct 16 10:27 home -> ../../sda7
lrwxrwxrwx 1 root root 10 Oct 16 10:27 root -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 16 10:27 swap -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 16 10:27 windows -> ../../sdb1

You can also use fdisk if you do not see the /dev/disk/by-label:

$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001bc54

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       18725   150403072   83  Linux
/dev/sda2           18725       19458     5884929    5  Extended
/dev/sda5           18725       19458     5884928   82  Linux swap / Solaris

From here, find only the drive name, ignore the partition number, that is, for partitions labeled "root", "data2", "fat", "home" and "swap" it's all still just sda. This is due to the fact that GRUB is installed in the MBR of the drive, and not on a partition.

Trouble? If other things are messed up, e.g. if you have deleted the partition from where Grub was previously installed, grub-install may return an error message such as "cannot find a device for /... (is /dev mounted?)". You may have to do grub-install a bit differently. Refer to the handy guide on fixing a broken system

Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

source - https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Matt
  • 46
  • 1
    Although your answer is 100% correct, it might also become 100% useless if that link is moved, changed, merged into another one or the main site just disappears... :-( Therefore, please [edit] your answer, and copy the relevant steps from the link into your answer, thereby guaranteeing your answer for 100% of the lifetime of this site! ;-) You can always leave the link in at the bottom of your answer as a source for your material... – Fabby Apr 15 '15 at 22:13
  • 2
    Thanks for the input. i guess i didn't think about sites being moved or merged. i will try to remember and make my answers more concise in the future. – Matt Apr 16 '15 at 13:00
  • 2
    Wow! That's the best improvement I've ever seen since I started leaving this comment! I wish I could upvote twice! ;-) – Fabby Apr 16 '15 at 13:02
  • 1
    Wish I could +5 this! – Tim Apr 18 '15 at 20:15