Help - Search - Members - Calendar
Full Version: Messed up MBR and GRUB
Linuxhelp > Support > Technical Support
Nighthawk4900
Background:
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.

CODE
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)
ubuntu@ubuntu:~$



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
michaelk
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.

http://www.zyxware.com/articles/2008/07/20...ogical-parition.

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.
Nighthawk4900
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...


michaelk
It is interesting. Does not look like the partition changes were ever changed.
Does Kubuntu still boot?
Nighthawk4900
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?
michaelk
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.

Nighthawk4900
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...
michaelk
It might. Please let us know.
Nighthawk4900
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...
michaelk
Progress...
Try manually mounting it.
sudo mkdir /media/windows
sudo mount -t ntfs-3g /dev/sda5 /media/windows
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.