Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ Messed up MBR and GRUB

Posted by: Nighthawk4900 Apr 27 2009, 10:48 AM

I had windows xp pro working perfectly fine. Recently I got a CD for kubuntu 8.10 and I figured I'd try it out. I checked my partitions, and it turned out that I already had two partitions. One partition where windows was install and then a smaller secondary partition that I wasn't really using before. I figured I'd install Kubuntu to that partition. Well I installed and everything worked fine... except for the fact that the Windows installation was not recognized by Grub and therefore I could no longer boot into Windows. I tried by adding an entry into the grub file for windows following suggests from other forums where people had similar problems, but that didn't work either. I guess I got desperate at this point and tried a bunch of things, but nothing worked. Furthermore, now grub doesn't load either, so basically nothing works.

I tried to use the XP recovery CD but even that isn't recognizing my XP installation now. =( It also keeps asking for an administrator password, and says the pw I enter is wrong. Anyways...

I'm on an ubuntu live cd at the moment. I used gparted to check out the partitions and oddly, there is 7mb unallocated space at the beginning, followed by the 253 gb ntfs (XP) partition, then a 25gb ext3 partition where i installed Kubuntu, and finally a 7mb unallocated space.

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 300.0 GB, 300090728448 bytes
240 heads, 63 sectors/track, 38764 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x00000001

Device              Boot      Start         End      Blocks         Id     System
/dev/sda1             *           2          38764   293048280    f       W95 Ext'd (LBA)
/dev/sda5                          2          35217   266232928+   7    HPFS/NTFS
/dev/sda6                     35218       38763    26807728+   e     W95 FAT16 (LBA)

It should be noted, I was able to mount the ntfs partition and am able to access all of my data. Also, upon inspection of the NTFS partition, I noticed that the boot.ini file was missing??

I need to fix things so that i can boot right back into windows

Posted by: michaelk Apr 27 2009, 04:36 PM

It is not normal for a windows installation that is not multiboot to be installed in a logical partition.
If you have a windows 98 CD you can boot to DOS and run fdisk /mbr. Not sure if that will work.

Most linux distributions installers like to create multiple partitions. Your main or / and a swap partition. A swap partition is the same thing as windows virtual memory. Windows uses a file and not a partition. It is best to leave unallocated space instead of an existing partition.

Posted by: Nighthawk4900 Apr 27 2009, 05:12 PM

as far as the creation of multiple partitions, I manually set up the partitions while installing ubuntu... Originally there was one partition called sda5, after a bit of trial and error (meaning the installer didnt let me continue) i created one partition as ext3 with mountpoint as / and then a small 2gb swap partition. They were automatically named sda6 and sda7 respectively. interestingly enough, the fdisk doesnt show the swap partition, does it...

Posted by: michaelk Apr 27 2009, 05:26 PM

It is interesting. Does not look like the partition changes were ever changed.
Does Kubuntu still boot?

Posted by: Nighthawk4900 Apr 27 2009, 05:49 PM

Nope, at the moment nothing boots. It just stops and waits, i guess...

also an update: I tried to install ubuntu into the "partition" that had Kubuntu. I resized that part. and made it 2gb smaller. I then made a 2gb swap partition. the installation went through fairly well, except at the end it said that grub couldnt be installed-fatal error.

where exactly is this grub supposed to go? i clicked the advance button on that option and it said (hd0,0) but then I looked at the "suggestions" it had /dev/sda5... /dev/sda6... /dev/sda7 etc there for each of the partitions. I didnt know better so i just left it as (hd0,0)

thanks in advance for the help though. would there be anything i can do with norton ghost or anythign?

Posted by: michaelk Apr 27 2009, 06:13 PM

In your case grub should go in hd0,0 which is the Master Boot Record (MBR).
I do not think that ghost would help.

boot.ini is a hidden file. I've never paid attention to see if it was visible from linux.

Posted by: Nighthawk4900 Apr 27 2009, 06:17 PM

would putting grub at /dev/sda (via those advance options) make any difference?

i guess ill find out in a few minutes...

also, i had checked the show hidden files options, still nothing...

Posted by: michaelk Apr 27 2009, 06:38 PM

It might. Please let us know.

Posted by: Nighthawk4900 Apr 27 2009, 06:45 PM

turns out it does... now it installed grub successfully and the computer boots into Ubuntu all by itself. All i did was change the location from '(hd0,0)' to '/dev/sda'

Grub still (not surprisingly) didnt see that windows installation there... maybe I can use that article from before now...

also, there seems to be a bit of issue mounting that ntfs volume....... there was no problem before, its just not mounting now...

Posted by: michaelk Apr 27 2009, 07:30 PM

Try manually mounting it.
sudo mkdir /media/windows
sudo mount -t ntfs-3g /dev/sda5 /media/windows

Powered by Invision Power Board (
© Invision Power Services (