Go Premium for a chance to win a PS4. Enter to Win


Linux Grub Problem

Posted on 2003-11-27
Medium Priority
Last Modified: 2013-12-16
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.
Question by:suhas_jain
  • 5
  • 4
  • 2

Expert Comment

ID: 9833424
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 (http://www.knoppix.org) 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


Author Comment

ID: 9833527
I've a bootable disk from Partition Magic. I'm able to run DOS through this.

Expert Comment

ID: 9833899
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.


Author Comment

ID: 9834068
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. :)

LVL 12

Expert Comment

ID: 9834956
have a check here to see this can help http://www.tldp.org/HOWTO/Multiboot-with-GRUB.html


Accepted Solution

ash4stuff earned 1200 total points
ID: 9836003
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...


Author Comment

ID: 9840276
I think I should have been more patient!!! :(  I googled further for anwers and came across some similar problems that others had....here'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.



Author Comment

ID: 9841117
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....:(

LVL 12

Assisted Solution

paullamhkg earned 300 total points
ID: 9848339
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 http://www.geocities.com/epark/linux/grub-w2k-HOWTO.html

Hope this info can help

Post any queries if need help.

Assisted Solution

ash4stuff earned 1200 total points
ID: 9866408
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!  


Author Comment

ID: 9870182
Thanks ash and paul for all your help.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question