It's not that bad when you realize what's happened, and as such it's pretty easy to fix.
What happened:
To understand what happened here, it helps to understand how grub works.
At the very beginning of the harddisk, there's code to boot an OS (a boot loader). It must reside inside of a small area of the disk (<512 bytes total), which was fine in the early days of less-sophisticated OS's like DOS, but to support booting multiple different OS's and graphics and network booting and more, well you can see that trying to fit all this into the small start of disk (called the Master Boot Record, or MBR) becomes impossible.
So, the idea of a multi-staged bootloader came about. The code that exists in the MBR is enough to get the system going (this is "Stage 1" in GRUB parlance) and load up more code that exists outside of the MBR (it actually resides right after the MBR as this space is left unused for DOS compatibility and legacy purposes). This code (called "Stage 1.5" ) is capable of reading normal filesystems and can thus read the contents of your /boot directory and thus can pass off the rest of the booting responsibilities to code that resides here ("Stage 2" ).
Now, how Windows boots
The Windows bootloader also starts at the MBR, which then reads the first sector (a section of a hard disk, the smallest singularly accessible part of a hard disk, usually 512 bytes) of the first bootable partition it sees which, after a Windows install is C[\i],which contains [i]ntldr, the second stage that preps the system for boot and reads various boot-time config files (like boot.ini, etc.)
How to fix it
With that quick and dirty overview, what happened is that Windows overwrote what GRUB had put in the MBR during the install. All of the still-correct setup data still resides in /boot, you just need to reinstall GRUB into the MBR and let it resume it's superior job of starting the computer.
Use a Linux LiveCD of your choice or any boot recovery disks you may have, boot into Linux, start a terminal. Generally LiveCD's will either make you the root user or give you unprotected access to the sudo command, if the latter is the case, simply append sudo to the commands (except when you are in the grub shell, as you'll be "root-ified" inside)
[code:1:cc352fe236]//First and foremost, this is assuming a standard Fedora install and
//I make assumptions on harddrive layout, adjust as needed.
//ASSUMED LAYOUT: one hard disk, 3 partitions:
//1st is NTFS with Windows installed
//2nd is probably EXT2 or EXT3 and is your /boot parition
//3rd is a Linux Logical Volume Manager partition, Fedora loves to use this.
//An LVM parition can contain multiple other "partitions" (volumes), so
//your root (/) and swap probably reside here
//To verify the physical layout of the disk, use the following
/sbin/fdisk -l
//Look for the listing that matches the size of your hard disk and check
//the layout, adjust as needed. Output of above command for the proposed
//layout would be something like
Device Boot Start End Blocks Id System
/dev/sda1 * 1 7649 61440561 7 HPFS/NTFS
/dev/sda2 7650 7658 72292+ 83 Linux
/dev/sda3 7659 16413 70324537+ 8e Linux LVM
//Again, adjust as needed. This also assumes either SATA or SCSI drives,
//with IDE the listings would be for /dev/hdX, X being a,b,c,...
//Now that we see what looks to be your /boot partition (the Linux one
//that's not an LVM), check to make sure that the contents of that
//partition are infact the boot files.
cd /root // get you back to a known location
mkdir temp //make a temporary mountpoint (where you attach a physical
//filesystem to the overall filesystem currently setup)
mount /dev/sda2 temp //this makes the "attachment"
ls temp
//Output should look something like this
config-some-version-of-linux lost+found
grub System.map-some-version-of-linux
initrd-some-version-of-linux.img vmlinuz-some-version-of-linux
//Don't worry if it doesn't match exactly, just that it kinda "feels" like that.
umount temp
rmdir temp
//Now that we've verified that that's the partition we want, we have to
//go about letting grub know about it and re-install itself in the MBR
grub //After this command, you will be in the grub shell. If you have been
//using "sudo", you no longer have to/should
// A word about GRUB's hard disk numbering: It's not that bad, just
// convert from a->0, b->1, c->2.... and 1->0, 2->1, ....
// so /dev/sda4 would be (hd0,3) and /dev/sdb2 would be (hd1,1)
//Our example, /dev/sda2 is (hd0,1)
root (hd0,1) //Confusing terminology here: they actually mean
//"where is /boot located", should be called "boot" instead
//Output should confirm what we know
Filesystem type is ext2fs, partition type 0x83
//If it says something about Unknown filesystem or partition type other
//than 0x83, stop and review the steps. Come back to the forums if needed
//Otherwise, tell grub to install itself onto the MBR
setup (hd0)
//It will give you some diagnostic output here, just make sure there are
//no serious errors. If all is good, go ahead and exit the GRUB shell
quit
[/code:1:cc352fe236]
If you made it through that marathon description (sorry, but I like to know what I'm doing before just blindly following directions and assume others do too ), congrats, you should be back in business. If not or something else goes arwy, come back and we'll do our best to help you through.
Another way to do this is to mount your partitions, chroot to your root partition edit /etc/grub.conf if necessary and run /sbin/grub-install $options /dev/sd?
Where $options = --recheck
sometimes you have to specify
--grub-shell=/path/to/grub
normally
--grub-shell=/sbin/grub
and
--root-directory=/mnt/.........
normally
--root-directory=/
of course /dev/sd? is your HDD usually /dev/sda, /dev/sdb etc
but when I say "grub-install /dev/hda" it says /dev/hda:Not found or not a block!!.
above all
after "Linux rescue" it attepmts to recover the Installed Linux but it says "
it says an error occured trying to mount some or all of your system.some of it may be mounted under .mnt/sysimage.
press enter to get a shell.system reboots once you exit from the shell..
by the way when I say fdisk -l at the Boot prompt it says Could not find the Kernel Image..
but works fine on SHELL prompt.
I attepmted on Shell prompt but the problem persists still.
Do you know what exists on each of those partitions? It seems very unusual to have 4 FAT32 partitions on a single drive.
Not having hda4 is OK, as any of the partitions above hda4 are actually logical partitions encapsulated in the hda2 extended partition (a work-around to a legacy limitation on number of partitions based on the MBR's partition table).
In light of the layout of your disk, you should be able to run my instruction with the modification that you told the installer not to use LVM and as such, you need to figure out which partition (type 0x83, Linux) contains your /boot partition (likely hda8)
I would most certainly figure out a cleaner scheme for you disk layout, then again that is my personal preference.
Get a so-called grub boot disk/CD to get you to a grub prompt. Once there, since you know the layout of the disk, follow my first post's instructions from the part after the "grub" command, being mindful of the change from hda2 to hda8 and (hd0,1) to (hd0,7).
You can get a grub iso from here or simply use a livecd such as the standard ubuntu install disk.
but one problem persists eversince I installed FC5. once I getinto Graphics screen after some time System get Stuck. the only way to work around this is to restart the System. why it happens so?
but one problem persists eversince I installed FC5. once I getinto Graphics screen after some time System get Stuck. the only way to work around this is to restart the System. why it happens so?
Can you clarify here a little? Are you saying that, after having used the system for a while it will freeze or that, after using the system and logging out (going back to the login screen) it will freeze, or something else? It sounds like an X driver issue nonetheless (or possibly something worse, hardware instability 8O ), but a little more info may help narrow down the problem.
Quote :
Man are you a Linux Developer?
I am in the sense that I use Linux as my dev system but the only patch I've ever submitted for the kernel was rejected (someone did a better job of patching the problem than I).
Development does not just equal coding in my book, you have to look at the whole software life cycle. As a developer you are well aware that most of the cost in software is in the maintenance and support stage.
A kernel patch or module does carry bragging rights and membership of a fairly small club but its not the only side of Linux development. Developing user knowledge and awareness, testing new releases ahead of less experienced users. It is all part of the process.
well I dont think it is due to Hardware Instability. as I had Red Had Linux 9.0 with 2.4 Kernel Version.everything was alright with that.I did not have any sort of problems.
what happens after working for some time on XWindow the Linux system come sto halt.it hangs in other words.
but everything goes fine with Text terminals.
what could be the reason?
I have Krypton Motherboard with Nvidia Chipset. with AMD Athlon 64 Bit Processor.
What kind of VGA card do you have? Onboard nVidia? AGP? PCI-E? PCI?
Please post the full output of lspci for us.
Also when X freezes can you hit ALT + CTRL + BACKSPACE ( not delete ) to kill X and respawn the X server?
Have you checked /var/log/* for any relevant log entries?
GL :-D
Quote :
well I dont think it is due to Hardware Instability. as I had Red Had Linux 9.0 with 2.4 Kernel Version.everything was alright with that.I did not have any sort of problems.
what happens after working for some time on XWindow the Linux system come sto halt.it hangs in other words.
but everything goes fine with Text terminals.
what could be the reason?
I have Krypton Motherboard with Nvidia Chipset. with AMD Athlon 64 Bit Processor.
You are about to answer a thread that has been inactive for more than 6 months. If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.