PDA

View Full Version : Boot error (Grub)



scarvenger
16th October 2007, 12:57 AM
After deleting a partition in my HD always when i boot my fedora it only gives me the grub comand prompt, it doesn“t boot normaly. Ideas?

Dies
16th October 2007, 01:05 AM
After deleting a partition in my HD always when i boot my fedora it only gives me the grub comand prompt, it doesn“t boot normaly. Ideas?

I'm sorry, a little more info would have been great. ;)

Whatever you deleted obviously contained the files Grub used.

Are you booting into Fedora from the Grub command line or ?

Was this Grub the one installed by Fedora or some other distro ?

Crito
16th October 2007, 01:09 AM
grub needs to be able to find /boot/grub/grub.conf -- some distros use menu.lst file instead -- or that'll happen. Your choices are:
1) use a separate /boot partition and don't delete it
2) use LiLo instead

scarvenger
16th October 2007, 01:10 AM
This grub was installed by fedora, and i was booting the fedora trough the automatic grub instalation, and i don“t know how to boot from the grub comandline =).

Dies
16th October 2007, 01:18 AM
This grub was installed by fedora, and i was booting the fedora trough the automatic grub instalation, and i don“t know how to boot from the grub comandline =).

Well, I'm sorry to tell you that what you deleted was probably your /boot partition which aside from the Grub files also contained the kernel for Fedora, which means your Fedora is unbootable. :(

You can recover but if you're not very familiar with Linux or the command line then it might just be better to re-install and learn from the experience. ;)

A live CD would probably come in very handy at this point, if you have data you need on that partition.

Crito
16th October 2007, 01:21 AM
Grub loads the menu you see from that menu.lst/grub.conf file. LiLo (its alternative) stores all that info in the MBR itself. So why not just use LiLo you might ask? Well, hard drives write whole sectors at a time, and the last part of the MBR contains your partition table. Every time you make a change to lilo.conf, therefore, you have to rewrite the partition table as well. This is a potentially dangerous operation -- power loss or even a solar flare could interrupt the process and render your computer unusable. So grub may be somewhat of a pain but it's safer to use. Or conversely, LiLo might be more convenient but it's also somewhat dangerous.

stoat
16th October 2007, 02:20 AM
After deleting a partition in my HD always when i boot my fedora it only gives me the grub comand prompt, it doesn“t boot normaly. Ideas?Hello scarvenger,

EDIT FOR AN IMPORTANT NOTE: See my post farther below about partition renumbering after deleting a partition before considering anything that follows here. I think that is more likely what has happened to you.

If you have not already used that now unpartitioned space in some way for something else, the data is still there and can very likely be recovered by various means...

Manually, using fdisk in linux rescue: Create a new partition of the same type in the same exact cylinders. The data will magically "auto-restore". I have done that many times, and it is well-documented on the Internet. If you deleted only a single partition, you may even be able to figure out the exact cylinders by just examining the result of fdisk -l in linux rescue. Otherwise, additional steps and calculations may be needed to determine the original cylinders. All of this sounds worse than it really is. If you are a complete newbie, learning fdisk under these circumstances can be a challenge but not out of your reach. I am omitting any further details for now in case you are not interested.


Using a partition recovery utility: TestDisk (http://www.cgsecurity.org/wiki/TestDisk) is a free utility that can restore deleted partitions. I have not used TestDisk for that particular chore before, but it is well-known for that and can be downloaded and created as a floppy or CD, or it can be found on some LiveCDs.No promises. But it's worth a try before you reinstall from scratch and destroy the system.

scarvenger
16th October 2007, 03:46 PM
Hmm, actually i was searching for the /boot and found it o.O and i think that the kernel and all that .img , etc is there is there... what the hell has happened :(

stoat
16th October 2007, 04:14 PM
Hmm, actually i was searching for the /boot and found it o.O and i think that the kernel and all that .img , etc is there is there... what the hell has happened
Hello scarvenger,

EDIT FOR AN IMPORTANT NOTE: See my next post about partition renumbering after deleting a partition before considering anything that follows here. I think that is more likely what has happened to you.

Try booting with your Fedora DVD and select "Rescue installed system". Answer the prompts for keyboard, language, etc. Follow the instructions to chroot your system until you are at an sh prompt. Enter...
fdisk -lThat fdisk option is dash, lowercase L. Examine the result. Maybe all your Fedora partitions are there after all. If so, try just reinstalling GRUB while still there in linux rescue. If GRUB was installed in your master boot record, this command should restore it...
grub-install /dev/sda...and if you get a "No corresponding drive in BIOS" error...
grub-install --recheck /dev/sda


P.S.: Landing at a grub> prompt during booting can mean your grub.conf is missing or badly misconfigured. Were you tinkering with that before this happened? While in linux rescue, examine your grub.conf with...
cat /boot/grub/grub.conf

stoat
16th October 2007, 05:42 PM
scarvenger,

I just remembered something important <embarrassed>: If you delete a partition that is not the last one, the others after it will be renumbered. That could explain the sudden breakage of your Linux system. You can read more about that in an article about partition names (http://www.linux.org.mt/node/39). See the section entitled "Potential problem: Partition renumbering".

If you think this may be the cause of your troubles, you have two options (at least):

Recreate the partition in the same place, then use the "fix partition order" function of fdisk.
Edit your grub.conf and fstab files to try and repair the system (theoretically should work)

hermouche
16th October 2007, 06:04 PM
Yes, follow what it is said and if you can post the output of:
#fdisk -l
#cat /etc/fstab
#cat /boot/grub/grub.conf

red

scarvenger
16th October 2007, 09:26 PM
Oh, yeah, i have read that, and the problem really was the partition number, and voillį, that worked =). Thank you all!!!!