LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub rescue console after restart (https://www.linuxquestions.org/questions/linux-newbie-8/grub-rescue-console-after-restart-4175483368/)

Daryst 11-04-2013 01:19 PM

Grub rescue console after restart
 
Hi There,

I am running a Linux based media server from a USB flash drive. Last night I had to restart my server due to a service not running properly. After the restart, it would not boot anymore and go straight into the Grub Recovery console.

I tried to boot normally by finding the active partition in the grub recovery console and figuring out which one to choose. But all of the options give back a "unknown file system" message.

I then tried to start it up using a Grub recovery disk and managed to start it up that way (only once though), but when I ask it to detect any OS, it gives me 4 entries of Unknown file system before showing a menu to boot into a version of Linux. I am not entirely familiar with what version, but I am using the below recovery software.

http://www.supergrubdisk.org/

Can anyone assist?

kbscores 11-04-2013 02:49 PM

GRUB will automatically invoke its shell at boot time if it cannot locate its configuration file. This typically happens if the file is renamed, moved, or deleted.

A couple useful things to keep in mind -
When you are in grub menu you can swap root(/) directory

Code:

  grub> root (hd0,0)
hd0,0 = /dev/sda1
hd0,1 = /dev/sda2
hd1,0 = /dev/sdb1
...etc

First number = disk
Second number = partition

you can use find command to find grub.conf, but it has to be the full path as if it were the root disk.

Example: If /dev/sda1 = /boot
and the config file exists in /boot/grub/grub.conf
then to search for it you'd type"

Code:

grub> find /grub/grub.conf
It will return the disk it is located on.

Once you have the disk - let's say it returns (hd0,2) - verify the contents by doing:

Code:

grub> cat (hd0,2)/grub/grub.conf
If everything looks good you can set it as the config file:

Code:

grub> configfile (hd0,2)/grub/grub.conf
If it does not find config file:
Try booting manually by essentially doing what the config file does...
Note: (hd0,0) would be whatever the boot partition is, kernel will be kernel version you are using, initrd will be the initrd you are using
- - if the proper files do not exist this will not work and kernel and initrd will most likely need to be rebuilt.

Code:

grub> root (hd0,0)
grub> kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/BASE-ROOT
grub> initrd /initramfs-2.6.32-358.el6.x86_64.img
grub> boot


Hopefully this helps some?

Daryst 11-05-2013 12:07 PM

Hi,

thanks for getting back to me. I tried the above mentioned options, but all I am getting back is the message "unknown file system"

When I enter "ls" the following result comes back

(hd0) (hd0,msdos5) (hd0),msdos1) (hd1)

I tried it on every above return, but all it gave back is the "Unknown file system"

One thing I noticed from the commands you mentioned is that it shows (grub>) whereas I only have (grub rescue>) Are all commands then still valid?

yancek 11-05-2013 03:42 PM

Quote:

Last night I had to restart my server due to a service not running properly.
What service? I don't see how that would create the problem you are reporting and you would need to provide more detail on what you did.

The commands kdbscores suggests above are for Grub Legacy, the information in your last post indicates you are using Grub2. It shows Grub installed to the mbr of sda and sdb as well as Grub files on sda1 and sda5. Is there any reason you do not indicate which Linux distribution you are using? If you have a Linux install on your computer which you can boot, I would suggest you google "bootinfoscript", go to the site and read the instructions and download and run the script. If you can't determine the problem, post the output, a results.txt file.

jefro 11-05-2013 04:00 PM

Some help here. http://www.supergrubdisk.org/wiki/Howto_Fix_Grub

patrick013 11-05-2013 04:31 PM

Hi,

Get the rescatux.iso from SuperGrub.

It has SuperGrub2Disk and boot-rescue-disk
both on the iso. Use dd to put it on the
flash drive.

Run SuperGrub2Disk to boot something, or the
boot-rescue-disk program to just replace grub and
run update-grub automatically.


patrick

Daryst 11-06-2013 04:10 AM

The service that I restarted was SABnzb, I did not suspect this had anything to do with it, hence me not mentioning it in detail. As for the Linux distribution. I am running OpenMediaVault (http://www.openmediavault.org/) Debian 6 squeeze

I tried the grub2 recovery disk, but it did not find any grub2 installation.

yancek 11-06-2013 09:35 AM

If the above suggestions don't help, boot the Debian or any Linux Live CD, go to the site below and read the instructions, download and run the bootinfoscript. This should provide detailed information on your drives/partitions as well as boot and other related files in a resultx.txt file.

http://sourceforge.net/projects/bootinfoscript/

Daryst 11-08-2013 06:39 AM

I will give the live cd's a go and see if I can sort it out. There is luckily no rush as the data on the raid array is unaffected by this problem.

Thank you all for your help.


All times are GMT -5. The time now is 08:53 AM.