Linux Grub Problem

I was playing with Partition Magic 7.0 , redistributing unused memory. When i rebooted my machine for changes to be applied, my Grub hanged. All I see is the grub> prompt.

I had Linux (obviously) and Windows XP dual boot.
I was googling for some answers but found none. Here is the output from fdisk /status command. Not sure if this helps,,,:))
Partitions on 1st hard disk (8024.6 Mb, 1023 cyinders):
No Drive    Start     End     MB       Status    Type
1    ------      0        1023    10048.4   N     Linux Filesystem
2    ------     1023    1023    972.6      N    VFAT LBA (2)
3   ------       1023    1023   27117.5   A    NTFS/HPFS
This is in Standard Mode.
Please help me save my PC and data.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it seems like you changed your partition table and grub cant find its way... The part of grub that is in MBR looks for the grub config file, but now its looking in the wrong place... i think you can solve that by running the grub-install again. You might have to reconfigure your grub config file ( /boot/grub/menu.lst) too, but first thing is first... getting in :)

if you dont have a bootable floppy that works, a good way of getting in is using knoppix ( if you can get one or have one around. If you dont, you can also make a boot floppy.

Depending on your reply Ill will try to guide you through the process :D

suhas_jainAuthor Commented:
I've a bootable disk from Partition Magic. I'm able to run DOS through this.
well, the grub installation would requiere a linux boot disk, and from a normal dos disk you will be able to access the linux filesystems. (it can be done, but it is a hassle)

is it posible to get a copy of knoppix? its a live cd, it runs a whole linux system from a cd without having to install anything, great for emergencies...

with debian you can use the install cd 1 to boot up your sistem, i think this can also be done with the redhat cd 1. Try booting with your redhat cd1. When you boot up from the cd1 you will probably have different options, and recovery will be one.

Do you have only one harddrive? If so
once you get to the command line type:

grub-install /dev/hda

and then reboot... without the cd. lets see if you get to the grub command line.. :D

IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

suhas_jainAuthor Commented:
I tried using redhat cd1's rescue mode. Here is what went on. I wasnt sure what to do after the last step.

1. After choosing the language and keyboard options i got the following message.

The rescue environment will now attempt to find your Red Hat
Linux installation and mount it under the directory
/mnt/sysimage.  You can then make any changes required to your
system.  If you want to proceed with this step choose
'Continue'. You can also choose to mount your filesystem
read-only instead of read-write by choosing 'Read-only'.
If for some reason this process fails you can choose 'Skip'
and this step will be skipped and you will go directly to a
command shell.

I selected continue...

2. Then i got this message.

What partition holds the root partition for installation hda2 or hda5.

I think mine is on hda2...

3. Then this message,

Your system has been mounted on /mnt/sysimage
Press return to get a shell. if you would like to make ur system the root env, run the command

chroot /mnt/sysimage

the sys will reboot automatically when u exit the shell.

Do i need to run chroot command? if i exit without running the chroot command and reboot the system i get the grub> prompt as before. i tried using grub-install command...but the command doesnt exist. there is an install command at this prompt but install /dev/hda2 or /dev/hda throws an error saying...partition doesnt exist.

by the way there seems to be a problem with knoppix website. :)

have a check here to see this can help

the knoppix website has the page "closed" protesting against software patents, you can click on the KNOPPIX link on that page or just follow:

Ok, you got your sistem working. More or less.. :) The cd boots its "own" operating system, then it mounts your root partition (/dev/hda) to /mnt/sysimage

So you can find all your partition contents at /mnt/sysimage

I guess grub-install is not included in the redhats boot cd system, but you should still be able to find it in your mounted system, it depends on you distro, but its probably at: /sbin/grub-install

so when you boot with the redhat cd in recovery mode:

/mnt/sysimage/sbin/grub-install /dev/hda

then reboot...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
suhas_jainAuthor Commented:
I think I should have been more patient!!! :(  I googled further for anwers and came across some similar problems that others's what I did,

1. Booted my pc from XP cd.
2. Deleted Linux partitions.
3. Used fixboot and fixmbr on C:
4. This didnt help as expected.
5. Re-installed XP.

This worked but I lost my 10gb space that I had previously allocated to Linux, and now everytime I boot my machine it works fine for sometime and throws me this error before it shuts down automatically....:((

Remote Procedure Call (RPC) service terminated unexpectedly. System will shut down in 60sec. From NT AUTHORITY/SYSTEM.

Will formatting my hard disk get me back my lost space and re-installing XP from scratch stop my system from shutting down automatically?

Can you help me out of this? I would really appreciate it.


suhas_jainAuthor Commented:
Well, guess what. that was the msblast virus...!!! I got rid of it though.

But i still dont know how to get back my lost linux disk space....:(

since you have delete your linux partitions as per your last 2nd comment point 2, you can use the disk manager of XP to view the partition status, is there any diskspace which is not used?

or you can try to put your linux cd and do the installation, during your installation your linux should show you the unuse partition and you can make it active and install your linux, since you already install winXP, you no need to use your Partition Magic to repartition, just use your linux CD can do.

For about the dual boot XP with linux using GRUB  have a check here

Hope this info can help

Post any queries if need help.
First of all, are you sure the virus is gone? The first thing I would do is backup your data, if posible to a cd. Read all the documentation available to your virus, make sure it does not stay in memory.

Since you already deleted your linux partitions, and MS seems to be a little bit messy, I would recommend to reformat and reinstall both operating systems.

The howtos above explain are good to mutliboot with grub.

From a dos boot disk I would delete all partitions and repartition you hd from scratch, do a:

fdisk /mbr  

before installing XP. Install XP first, then install linux, include the grub packages, but dont install grub to the mbr, but make sure you make a boot disk during your installation to access your linux. Reboot and boot using your boot disk, once inside modify your grub config files acording to your needs, all the info you need are in the howtos. Then make a grub-install to a floppy (not your boot floppy), and booting with that floppy into windows and linux.

If everything is Ok, you can install grub into the MBR of your hard disk.

I think this is all described in the howtos anyways.. :D

Good luck!  

suhas_jainAuthor Commented:
Thanks ash and paul for all your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.