Replacing windows boot loader by GRUB
Hi,
I have a dual boot ubuntu edgy and win xp. After not using win xp for a long time, it crashes so i was forced to reinstall it and now my GRUB doesn't appear when I boot my computer. I don't know how I can go to rescue mode in ubuntu, whereas in fedora there was such option. Anyhow, I used ubuntu cd live and loaded windows and I mounted my linux partition used grub-install /dev/hda but it doesn't recognize it. my windows partition is in /dev/hda1 file system is in /dev/hda2 and swap is in /dev/hda3 Any idea how to get rid off windows boot loader? |
From the live CD do
Code:
mkdir /mnt/temp |
You should prabaly use a live cd distribution such as knoppix or Ubuntu to reinstall grunb and grub shold land on the NBR of /dev/hda.
|
I prefer the grub shell method.
You say that Linux is on /dev/hda2---I assume that there is no separate partition for /boot. do this (as root): Code:
grub |
Either pljvaldez or pixellany proposal would solve the problem.
The reason the grub-install did not work in Post #1 is because it was not issued "inside" hda2. pljvaldez proposal is to get "inside" hda2. The method will work for any Live CD because it uses the Live CD kernel in combination with Ubuntu's Bash shell (which has Grub inside). pixellany proposal achieves the same task from "outside" hda2 and looks simpler but it requires a Live CD having Grub inside in order to invoke a Grub shell. I am here just to offer an explanation and to make a connection between the two proposals. Where is the response from the Original Poster? |
Sorry for late reply,
Thank you for your responds, but non of them worked for me. when I issue command: root@ubuntu:/# grub-install /dev/hda2 I get the following result /dev/hda2: Not found or not a block device. and when I go inside grub program and I write: root@ubuntu:/# grub-install /dev/hda2 I get following errir: /dev/hda2: Not found or not a block device. |
I don't think you are doing it right.
First of all hda2 is shown up by your Ubuntu after mounting it so it must exist and is a block device. Secondly I don't think anybody here asking you to do a grub-install in hda2. It is hda or the whole disk which is equivalent to the MBR of hda. Thirdly when you go inside Grub program "grub-install" doesn't work because it is a Linux script and not a command in a Grub shell. Obviously my explanation has produced the opposite effect. Please post here the output of Code:
fdisk -l |
root@ubuntu:/home/ubuntu# fdisk -l
Disk /dev/hda: 40.0 GB, 40007761920 bytes 255 heads, 63 sectors/track, 4864 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 1912 15358108+ 7 HPFS/NTFS /dev/hda2 1913 4736 22683780 83 Linux /dev/hda3 4737 4864 1028160 82 Linux swap / Solaris |
By the way, I have followed both posts exactly as they stated; I didn't run grub-install within grub.
|
Any idea how I can add ubuntu entry to windows boot loader so that I can boot my ubunu?
|
Quote:
You don't say if you tried my grub-shell method |
Your commands work actually. I had a mistype when writing them. Now I have grub back but I am not able to boot it due to following error:
/bin/bash can't access tty |
i got it working by editing grub menu when booting. instead of hda2 it was written hda3 and so on. Thanks for help
|
I hate to repeat it but it is 10 times harder to get Windows NTLDR to boot a Linux.
Not many users realise that in order for NTLDR to work the Linux must has a working boot loader first so that its first 512 bytes can be copied into Windows "c" because Windows is so lazy or dumb to come out to fetch it from a partition foreign to itself. You then have to find a way to write the boot loader into a NTFS partition, unhide boot.ini to add Linux's entry, hide boot.ini again and it may not even work reliably. If your Linux uses Lilo and you may need to alter Lilo a few times then you will know what I mean by 10 times harder. |
All times are GMT -5. The time now is 09:15 PM. |