Grub rescue

Post your tutorials and howtos here.
User avatar
Arjen Balfoort
Site Admin
Posts: 9361
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Grub rescue

Postby Arjen Balfoort » 15 Mar 2013 15:17

I do a lot of testing, and when you do so, you sometimes break things that you really shouldn't.
Sometimes a mount is not properly unmounted and for some reason I get this very disturbing message after a reboot:

Code: Select all

error: file not found.
grub rescue>
So...what now?
It's good to know that there's a way out of this, without the need of a live DVD (see my previous post).
Grub rescue is a prompt, a very limited prompt, but enough to get things working again.

First we need to find out where grub.cfg is located.

Code: Select all

ls
This lists all available drives like so: (hd0) (hd0,msdos1) (hd0,msdos2) (hd1) etc.
In this example I know I installed root (and grub.cfg) in the first partition, which I checked:

Code: Select all

cd (hd0,msdos1)
ls
wich listed the /boot directory.

Now, we set some variables:

Code: Select all

set prefix="(hd0,msdos1)/boot/grub"
set root="(hd0,msdos1)"
insmod normal
And start grub with this command:

Code: Select all

normal
When booted you need to install and configure grub again:

Code: Select all

sudo grub-install /dev/sda
sudo update-grub
This will repair grub permanently.


SolydXK needs you!
Development | Testing | Translations

User avatar
CjTX2
Posts: 170
Joined: 23 Feb 2013 15:42
Location: Texas

Re: Grub rescue

Postby CjTX2 » 17 Mar 2013 02:18

Schoelje, I wish I had this about 6 months ago when I got that message. I just decided to start over and set up /boot, /MyData, swap, and an extended partion which is where I installed LMDEXfce, SolydX, and two SolydX testing installs, (one with open drivers and one with Nvidia). So far it has worked beautifully, and I know exactly where to put / (root) for new installs.

I have no windows installs. I see the msdos1 in your code, would the command be different for a Linux box? :)

Building new machine named Garfield II & still using an old T42 Thinkpad that's old and slow, but just keeps on going and going . . . sorta like me! :lol:

wayne
Posts: 178
Joined: 25 Feb 2013 14:58

Re: Grub rescue

Postby wayne » 17 Mar 2013 03:24

CjTX2 wrote: I have no windows installs. I see the msdos1 in your code, would the command be different for a Linux box? :)
Hi CjTX2,

those commands are all Linux running grub.
it had nothing to do with windows OS, :mrgreen:

(hd0, msdos1) notation is used in grub, and has the same meaning in Linux OS/kernel as /dev/sda1

hopefully you do not face with grub rescue> :mrgreen: not too nice to have it..

User avatar
greywolf
Posts: 103
Joined: 27 Feb 2013 22:34
Location: Sydney, Australia

Re: Grub rescue

Postby greywolf » 17 Mar 2013 04:25

Hi CjTX2,

those commands are all Linux running grub.
it had nothing to do with windows OS, :mrgreen:

(hd0, msdos1) notation is used in grub, and has the same meaning in Linux OS/kernel as /dev/sda1

hopefully you do not face with grub rescue> :mrgreen: not too nice to have it..
Ahhhh, the old "count from zero" trick to fool the unwashed masses!! :) The first partition of the first drive, as counted by msdos. The "sda" replaced the "hd0" and the "1" just did away with the "msdos" bit.

So many folk just don't realize that the primary Microsoft operating system that they used to run was MSDOS!! Until, hmmm, WinNT4/Windows2000 I think it was "Windows" was no more than a graphical DE sitting on top of a CLI based operating system called MSDOS; no different than KDE or Gnome, etc sitting on top of CLI based Linux. You just had to be there I suppose? :)

Grub rescue is another example of Linux's ability to survive catastrophe. If you have a prompt, any prompt, a decent backup strategy and a working keyboard, you can save any Linux system! This comment is brought to you by all 'old' server admins!! :)

Nice one Schoelje.

Greywolf
It was about the dragons. It was always about the dragons!

User avatar
Arjen Balfoort
Site Admin
Posts: 9361
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Grub rescue

Postby Arjen Balfoort » 17 Mar 2013 07:15

I must admit, I was a bit surprised when I saw that the first time it happened.
On the other hand, DOS, was one of the few decent things MS has ever made...eh, produced.
And XP, I like that one, oh, and Visual Studio is a good IDE.


SolydXK needs you!
Development | Testing | Translations

User avatar
longtom
Posts: 215
Joined: 13 Mar 2013 19:53
Location: South Africa

Re: Grub rescue

Postby longtom » 17 Mar 2013 07:25

Schoelje wrote:... On the other hand, DOS, was one of the few decent things MS has ever made...eh, produced.
It certainly was quite an improvement in my house on CP/M . Anybody remembers that?
Regards

longtom

User avatar
Arjen Balfoort
Site Admin
Posts: 9361
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Grub rescue

Postby Arjen Balfoort » 17 Mar 2013 07:37

Can't say I do: my first PC was a 286, with a whopping 6MB RAM and a 20MB HD.
People asked me why I would ever need that much memory or storage (momory and storage was terribly expensive at that time).
A week ago I bought an extra HD of 3TB for 129 EUR. The benefits of mass production.


SolydXK needs you!
Development | Testing | Translations

User avatar
longtom
Posts: 215
Joined: 13 Mar 2013 19:53
Location: South Africa

Re: Grub rescue

Postby longtom » 17 Mar 2013 07:52

Mine didn't have a hard drive and run on 3" stiffies. I glued in a 3.5" stiffy drive which was able of handling 756kb. That was quite something.

It was a Schneider Amstrad 8512 .

Image

The screen came in any colour - as long as it was green ....
Regards

longtom

User avatar
CjTX2
Posts: 170
Joined: 23 Feb 2013 15:42
Location: Texas

Re: Grub rescue

Postby CjTX2 » 17 Mar 2013 08:35

My first computer had Windows 3.1, so I am familiar with the concept of a command line. I even remember No Google, when you had to have a "phone" book for the internet. That one trips out my grandsons. :lol:

Building new machine named Garfield II & still using an old T42 Thinkpad that's old and slow, but just keeps on going and going . . . sorta like me! :lol:

dyfi
Posts: 88
Joined: 15 Mar 2013 17:45

Re: Grub rescue

Postby dyfi » 17 Mar 2013 10:36

For anyone less technically minded Partedmagic .iso contains the program grub-doctor which is a gui to mend grub.
The easiest way to use Partedmagic imo is to add the .iso to grub using grub-imageboot. No CD or USB.

Obviously, in a total grub failure one would need the live CD or USB - (or multisystem USB).

coetzeer
Posts: 1
Joined: 12 Apr 2013 22:29

Re: Grub rescue

Postby coetzeer » 12 Apr 2013 22:33

Thanks very much for the good Grub recovery advice.

I just used it to rescue my SolydK installation after the update pack installation. I wasn't really paying attention to the GRUB related dialogue that popped up during the UP installation, I just accepted whatever was selected. Anyway - it seems that I must have selected the incorrect boot location or drive identifier, because subsequent boots landed me up with a kernel panic (something about 0,0 not existing).

The chroot trick recovered my grub setting nicely.

Zam
Posts: 24
Joined: 11 Apr 2014 02:42

Re: Grub rescue

Postby Zam » 16 Apr 2014 09:51

Hello,

I tried doing this, after I lost the GRUB following the April '14 updates (outlined in http://forums.solydxk.nl/viewtopic.php? ... =80#p32751). When I type

Code: Select all

insmod normal
... I get an error message that says "error: unknown filesystem". What shall I do from here? My SolydX install is less than a week old, so I could just reinstall, but thought there might be a simpler solution.

I'm running SolydX 64-bit in a VM, if that makes a difference.

Many thanks for your help :)

User avatar
MAYBL8
Posts: 1487
Joined: 10 Mar 2013 18:41
Location: Maryland Heights, MO USA
Contact:

Re: Grub rescue

Postby MAYBL8 » 16 Apr 2014 10:41

Here is another tool for repairing grub issues and boot up issues. I use it all the time.
http://sourceforge.net/p/boot-repair-cd/home/Home/


User avatar
drc
Posts: 137
Joined: 30 Apr 2013 22:47
Location: Nebraska USA

Re: Grub rescue

Postby drc » 16 Apr 2014 14:56

longtom wrote:It certainly was quite an improvement in my house on CP/M . Anybody remembers that?
Fondly, as in it's been long enough that one forgets all the bad things and only remembers the good times.

Zam
Posts: 24
Joined: 11 Apr 2014 02:42

Re: Grub rescue

Postby Zam » 16 Apr 2014 19:23

Great, thanks! That works perfectly.

User avatar
GNUday
Posts: 202
Joined: 03 Jan 2014 20:16
Location: Ontario, Canada

Re: Grub rescue

Postby GNUday » 19 Apr 2014 05:32

Schoelje wrote:

Code: Select all

error: file not found.
grub rescue>
Thank you! I printed out your post for future reference. :D

You have no idea how many times I stared at that screen after a kernel or grub upgrade, or something 'updates' grub without my permission, especially with my SATA Raid SSDs and one HDD storage drive setup, I started putting grub on the boot sector of the storage HDD on purpose just to keep things simple, grub has to 'point' to the hardware fake raid bios drive. This is just a guess, but I think my grub gets borked because the 'ramdisk' gets trashed, if I'm not mistaken, the grub ramdisk 'mounts' the hardware fake raid bios drive so it can read the boot directory/host of the kernel (that's when I see "dm-raid45 module not found in modules.dep", but it boots anyway). :?

Edit 2: Here is a fix in the Debian forum for the above dm-raid45 error.

Edit:
Schoelje wrote:my first PC was a 286, with a whopping 6MB RAM and a 20MB HD
Wow, back then you were the hardware king on your block, lol, and I don't doubt for a second it was really expensive! My builds usually cost me about $1,500 CAD, but that's a nice machine that lasts years (I hate budget junkers, lol), suffice to say, in these tough times, my builds are few and far between. :(
AMD FX-8350, Gigabyte GA-990FXA-UD3 (rev 4.0), 2 Intel 520 Series 120GB SSDs, 2 Seagate storage HDDs, 16GB Kingston HyperX Fury DDR3, Asus Radeon R7 250, Thermaltake V3 Black AMD Edition case, 750W Tt Toughpower Gold PSU...running no systemd PCLinuxOS

User avatar
Cory
Posts: 48
Joined: 22 Jan 2014 19:59
Location: NL mostly

Re: Grub rescue

Postby Cory » 21 Apr 2014 19:53

[subtitle : "dealings of a Linux-noob-forever, or another precious day lost to cursed computers"]

For quite a while already I need to make some technical drawings, and today I wanted to spend on installing DraftSight on my laptop running SolydX 64 and tick that off of my list. Download and install of DS worked out surprisingly well - that should have warned me... read on!

I noticed the UM called for UP 2014-04-15 - I hadn't used this laptop that much, you see. Seemed appropriate to install immediately, so I left it churning away for an hour or so. All seemed well, finished nicely. But then ...
Schoelje wrote:... this very disturbing message after reboot:

Code: Select all

error: file not found.
grub rescue>
"So...what now?" is indeed the question that came to mind, after a few bad words had first crossed that same mind (I'm a single-brained single-threaded 1 Hz human, mind you) :oops:

Quickly turning to this forum, I found this thread and checked ...

Code: Select all

ls
set
... to find this looked as it was supposed to.
(hd0,msdos3) is my boot partition, and /boot/grub was on there with files that -as far as my untrained eye could see- looked logical, such as grub.cfg.

Nevertheless, ...

Code: Select all

insmod normal
normal
... yielded ...

Code: Select all

error: file not found
Unknown command `normal'
So ... no go there.
More severe cases need more severe action, so onto System Rescue CD - of which I always keep a copy at hand, but as it turned out the CD-RW with 3.7.0 is not (anymore) readable. Download new version 4.2.0 for burning at my desktop machine (running Linux Mint DE Mate) , which should take only a matter of minutes. Should, for the download never finishes correctly. Mhhh, I've come across that a number of times recently... what's wrong there? FireFox or LMDE on my desktop machine somehow broken? Needs attention later, it is getting later and later...
Boot-Repair-disk-32bit is another option, download is fast and I do have an unused stick laying around ... USB image writer quickly does the job, but to no avail as the message ...

Code: Select all

no boot sector on USB device
... appears. Another bad word - sorry! :oops:

Kind of stuck there... I'll keep you posted, given that I hope not to break anything any further.
You feel the tension growing, don't you?
Are you Solyd-ified yet?


User avatar
Cory
Posts: 48
Joined: 22 Jan 2014 19:59
Location: NL mostly

Re: Grub rescue

Postby Cory » 23 Apr 2014 20:26

Got grub repaired and learned a thing or two along the way; thank you, Scott!

Unfortunately, the update did not much good to my system. DraftSight does not start anymore. Even from shell it remains silent, no feedback. Reinstall is fruitless (complains about oxygen-gtk library? installed that but to no avail), remove through Software Manager hangs at 99%...
Other side-effects I have come across: FireFox has no search engines anymore, and they cannot seem to be added.
Update Manager shows Update Pack 2014-04-15 is installed and up-to-date. Though.

Guess I'm off to SolydK, but am gonna test that in a vm (on a different machine) first.
Are you Solyd-ified yet?


User avatar
zerozero
Posts: 5373
Joined: 10 Feb 2013 23:37
Location: West Midlands, England
Contact:

Re: Grub rescue

Postby zerozero » 23 Apr 2014 23:09

for the FF issue try this

Code: Select all

sudo apt-get install --reinstall firefox-solydxk-adjustments firefox
bliss of ignorance

User avatar
Cory
Posts: 48
Joined: 22 Jan 2014 19:59
Location: NL mostly

Re: Grub rescue

Postby Cory » 24 Apr 2014 10:00

zerozero wrote:for the FF issue try this

Code: Select all

sudo apt-get install --reinstall firefox-solydxk-adjustments firefox
Thank you from the dark depths of the pit I'm in atm...
:oops: Why can't I come up with this myself? Way past, somebody already told me to "investigate, combine, reduce and deduce¨ - I seem to fail at the very first step when it comes to Linux :(
Are you Solyd-ified yet?



Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 4 guests