Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 407
Rep:
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
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.
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 407
Original Poster
Rep:
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
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 407
Original Poster
Rep:
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 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.