Solved

Linux Grub Problem

Posted on 2003-11-27
11
3,061 Views
Last Modified: 2013-12-16
Hi,
 
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.
 
thanks
-SJ
 
0
Comment
Question by:suhas_jain
  • 5
  • 4
  • 2
11 Comments
 
LVL 1

Expert Comment

by:ash4stuff
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

Ashley
0
 

Author Comment

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

Expert Comment

by:ash4stuff
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


 
0
 

Author Comment

by:suhas_jain
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. :)

thanks
suhas
0
 
LVL 12

Expert Comment

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

0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 1

Accepted Solution

by:
ash4stuff earned 400 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:

http://www.knopper.net/knoppix/index-old-en.html

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...



0
 

Author Comment

by:suhas_jain
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.

Thanks
Suhas

0
 

Author Comment

by:suhas_jain
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....:(

0
 
LVL 12

Assisted Solution

by:paullamhkg
paullamhkg earned 100 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.
0
 
LVL 1

Assisted Solution

by:ash4stuff
ash4stuff earned 400 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!  


0
 

Author Comment

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now