# Windows 8 won't boot after Ubuntu install



## BrokenString (Jan 2, 2012)

Hi, I recently installed Ubuntu 12.10 on my laptop, side by side with my windows 8.
Windows 8 appears in GRUB, but when I try to boot it,
a black screen with a "_" in the top left corner appears
(the same one at the beginning of Ubuntu's boot).
After about a second of that it returns to GRUB.
No error messages.

I've tried to get into Windows Repair with my cd, but it won't boot either.
After a long while of doing nothing it shows an error message
reading "CDBOOT: Couldn't find BOOTMGR".

Any help is appreciated, thanks.


----------



## saikee (Jun 11, 2004)

It really depends on the manner you installed the two systems.

As a rule every new operating system should always be given its own partition to reside in so that every system can be rescued by its installation CD/DVD.

If you have done that you then will have an idea which partition is Windows 8 and which one is Ubuntu in general but in particular if there is more than one partition for Windows 8.

Depending on how the order of system installation and the arrangement a hard disk is presented a Windows 8 could have a boot partition, called System Reserved, and another main partition for housing the OS itself. It is perfectly feasible and indeed occurs frequently that Grub would boot to the main Windows partition and could not find the boot manager bootmgr which is always placed inside the System Reserved partition if the system is shipped from the factory. In such a case it is just change a number in the Grub configuration file to put it right. However if you have erase the System Reserved partition to install Ubuntu the cure is much more involved and some files may be impossible to recovered.

To cure the problem you need to post the Ubuntu terminal output of the following here 

```
sudo su fdisk -l
```
This will tell us the partition arrangement of your hard disk.

```
cat /boot/grub/grub.cfg
```
This will tell us which partition Grub is booting to find Windows 8.


----------



## BrokenString (Jan 2, 2012)

fdisk -l

/dev/sda2 41945088 871036925 414545919 7 HPFS/NTFS/exFAT
/dev/sda3 871036926 976771071 52867073 5 Extended
/dev/sda5 968695808 976771071 4037632 82 Linux swap / Solaris
/dev/sda6 * 871036928 968695807 48829440 83 Linux

grub.cfg: http://pastebin.com/F9UPJhhj


----------



## saikee (Jun 11, 2004)

BrokenString,

I think you have done something on your Ubuntu/Windows8 installation but not given us the details.

My immediate concern is that you have no sda1. In a normal course sda2 and sda3 will only be formed after sda1. You could end up without sda1 if you have deleted it. That would leave a space between 0 to 41,945,088 sectors or about 200MB of hard disk storage unused. The 200MB space is about the size of the System Reserved partition.

Have you missed out the first line when posting the output of "fdisk -l" here?

The other point is the Grub.cfg you gave us does not contain a reference to Windows 8 at all. Have you posted the correct one I suggested and that is /etc/grub/grub.cfg. All the booting alternatives has the command "set root='hd0,msdos6'" suggesting the Grub could only boot to sda6 which is your Ubuntu partition and nothing else.


----------



## BrokenString (Jan 2, 2012)

Well... the strange thing is that Windows 8 doesn't even show up in grub anymore...
So I must've done something very wrong :S

fdisk -l


> Disk /dev/sda: 500.1 GB, 500107862016 bytes
> 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> ...


----------



## saikee (Jun 11, 2004)

If you haven't destroy sda1 then you might be able to get everything back.

To boot up Windows 8, assuming it did have sda1 before, you can re-create sda1, make it active (in Windows term) or bootable (in Linux term).

Here is what I suggest you to salvage the situation.

(1) boot up Ubuntu. You can then see the Windows 8 partition mounted in /media. Check to ensure if there is a /boot directory inside and see if bootmgr is available in Windows 8 partition. If both exist then you should not need sda1 to boot it, otherwise skip (2) & (3) and jump to (4) below.

(2) If bootmgr.exe and /boot exist then you should make sda2 bootable. The fdisk -l output shows sda6 has a * indicating it is the bootable partition. You can use "sudo cfdisk /dev/sda" and inside that program to select sda2 bootable and save the partition table. MS Windows boot loaders traditionally only boot from a bootable partition. In all partitioning tools when one partition is made active the existing one will be switched off.

(3) You can then reboot but do not select a system to boot. Just press the c key to drop into a Grub prompt. There is no installed system a Grub prompt cannot boot. If sda2 has /boot, bootmgr and made active it should fire up by the following commands in Grub prompt

```
set root=(hd0,2)
chainloader +1
boot
```
(4) If you need to restore sda1 you can do it with command 

```
sudo cfdisk /dev/sda
```
Inside it you will find the unallocated space in front of sda2. Just create a primary partition using the default beginning and end positions offered by the program. A partition in Linux by default is always type 83 so you need to use highlight the command "Type" and change it to 7 which is for hpfs/ntfs/exfat same as sda2. You should also highlight sda1 and make it bootable by pressing the "bootable" command. The partition will be finalised only if you select "Write" and answer with a "yes" before exiting.

(5) When you are ready to boot the new sda1 do so by typing the c key at the Grub screen and try these commands

```
set root=(hd0,1)
chainloader +1
boot
```
--------------------------------------theory------------------------------------------------

Windows 8 (win2k, Xp, Vista,or Windows 7) always installs a boot loader in the boot sector of the boot partition. The "chainloader +1" command by Grub is to terminate itself and hand over the command to Windows 8 boot loader at the +1th position. If the Windows 8 has not been damaged it will boot up like a clockwork.

Good luck and report anything that does not come out as expected.

Lastly you might have done nothing wrong in losing Windows 8. The Grub.cfg indicates a new kernel has been added so you must have accepted an update in Ubuntu which did not rebuild the Windows 8 booting alternative in Grub because it couldn't find it.


----------



## BrokenString (Jan 2, 2012)

/media only contains a folder with my username


----------



## saikee (Jun 11, 2004)

You can always mount any partition manually. Here are the commands to do it in a Ubuntu terminal.

```
sudo su
mkdir /mnt/my_windows8
mount /dev/sda2 /mnt/my_windows8
ls /mnt/my_windows8
```
The last line is to list that partition to see all the files inside. Thereafter you will see them too in the desktop by clicking the file system.

Ubuntu normally would mount every Windows partition. If it doesn't it will show it in the desktop. Clicking the desktop reference is another way to mount it too. The difference in a terminal is you are the root user (required if you mount a partition and obtainable by "sudo su" followed by your normal password) and therefore can read write all the files whereas in the desktop as an ordinary user you may be disallowed to change the files not owned by you. This generally applies to a NTFS partition used as a c-drive in Windows.


----------



## BrokenString (Jan 2, 2012)

mount -t ntfs /dev/sda2 /mnt/my_windows8
tells me the partition doesn't have a valid ntfs.


----------



## saikee (Jun 11, 2004)

In that case you might have damaged you Windows8 partition if it is not detected by Linux and cannot be mounted.

Here I show you my "System Reserved" partition used by Windows7 and then the Windows 8 partition showing both of them have bootmgr and /boot inside

```
Mint13-sda7 saikee # mkdir /mnt/boot_partition
Mint13-sda7 saikee # mount /dev/mapper/isw_cdcidibjbc_1st2 /mnt/boot_partition
Mint13-sda7 saikee # ls /mnt/boot_partition/
[COLOR="Blue"]Boot[/COLOR]  [COLOR="Red"]bootmgr[/COLOR]  BOOTSECT.BAK  System Volume Information

Mint13-sda7 saikee # ls /media/Windows8-sda1/
ANG0  [COLOR="Red"]bootmgr[/COLOR]       Documents and Settings  NST           ProgramData          Recovery      System Volume Information    Users
boot  BOOTNXT       hiberfil.sys            pagefile.sys  Program Files        $Recycle.Bin  Temp                         Windows
[COLOR="Blue"]Boot[/COLOR]  BOOTSECT.BAK  Intel
```
It looks like you need to re-install Windows 8. I would use Ubuntu to delete sda2 and give all the empty space to Windows8 installer to install Windows 8. Once it has been installed Grub will be nuked but you can restore it using a Ubuntu CD. Let us know if this what you plan to do. My advice is Linux cannot read and mount you partition then it is half dead any way.


----------



## BrokenString (Jan 2, 2012)

Luckily I just recently moved all my personal stuff to my desktop 
Guess I'll spend another day installing windows 8 and all application again,
thx for all the help


----------



## saikee (Jun 11, 2004)

Installing Windows 8 should be a half an hour job.


----------



## BrokenString (Jan 2, 2012)

I know, but there's also a lot of applications to reinstall 
And I tend to be a bit ocd about everything.
Like context menus need to be slimmed down, every possible setting has to be perfect etc


----------

