SOLVED: GRUB loading error 22

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
lanrun
Level 3
Level 3
Posts: 158
Joined: Tue Oct 23, 2007 7:31 am
Location: Lillehammer - Norway

SOLVED: GRUB loading error 22

Post by lanrun »

Hi

I have Mint Elyssa R1 main installed on my home PC, and everything have been working all fine for a couple of months.
Yesterday I tried to make a bootable USB memory stick for PUPPY Linux. I then tried to install a GRUB menu to the USB stick.
Then I shut down the PC.

Today the PC won't boot from my internal harddrive. During the boot process it stops with this:

GRUB loading, please wait...
Error 22

I must have messed up the GRUB during the process with PUPPY Linux....

Now I can boot from the USB stick with PUPPY Linux or from Live CD with Linux Mint. But how can I repair the GRUB?
Can anyone help?

Regards
Rune
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
cliff76

Re: GRUB loading error 22

Post by cliff76 »

I think you just need to reinstall GRUB. I haven't done this in a while so I'm a little rusty. From my Mepis days you could do this from the live disk and all would be well. I'm not sure if Mint has this option. The alternatives would be to use synaptic or apt-get from the cmd line. But then that assumes you are able to log into your Mint install... chicken and egg thing. The trick is to boot either USB puppy or Live disk Mint and use the chroot cmd to log into your Mint install. (Another hack would involve editing the /boot/grub/menu.list on the USB stick and add an entry that points to your Mint install. You might be able to pull this entry from the /boot/grub/menu.lst on your harddrive but I'm not going to go off on a tangent.) From the USB or Live disk mount the partition that holds your Mint install then:
chroot /path/to/mounted/drive
from there you should be able to run
apt-get install grub


Like I said, I haven't done this in a while so you might hit a snag or two. Instead I'll explain the nature of your problem. When you made the puppy USB stick you must have inadvertently installed the puppy boot loader (Grub) to your hard drive instead of/along with the USB stick. The boot loader points to your kernel and in your case its probably trying to point to the kernel installed on your USB. Anytime you install boot loaders for USB drives and the like its a good idea to backup your /boot/grub/menu.lst in case things go wrong. This is the file that tells GRUB where to find the kernel for any/each operating system installed. You can probably modify this file from a live disk assuming GRUB itself isn't messed up. Just open it as root and fix/restore the entries for your Mint install. You'll need to understand a bit about how your drive is partitioned to fix it up. generally you'll see entries like mine:
title Linux Mint 5 KDE CE, kernel 2.6.24.3-custom
root (hd0,4)
kernel /boot/vmlinuz-2.6.24.3-custom root=/dev/sda5 ro quiet splash
initrd /boot/initrd.img-2.6.24.3-custom

The title can be whatever you like indentifying an installed operating system. The root, (hd0,4) points to the zeroth (first) hard drive on my system and, I believe, the 5th (zero based) partition on this drive. The kernel points to the actual kernel and includes a root attribute that points to the physical device, /dev/sda5, using a different syntax. Here sda5 is the 5th partition on my first physical hard drive- sda. (If I had two hard drives I could specify a path off of sdb.) There's a cmd that'll spit out the locations of your partitions but I can't remember what it is. Once again I'm very rusty and I hope I'm not confusing more than helping.
Guest

Re: GRUB loading error 22

Post by Guest »

Just boot to your mint live CD and follow this course of action:-

Boot into the Mint live CD
open a terminal and run :

Code: Select all

sudo grub
This gets you to a simple grub command line.
Then:

Code: Select all

find /boot/grub/stage1
This will tell you where your /boot/grub/stage1 is which is needed to boot Mint. Replace the question marks in the following command with the output of the this last command :

Code: Select all

root (hd?,?)
[like : root (hdo,1) ,probably]
then:

Code: Select all

setup (hd0)
This is where your windows partition and MBR normally is, but if you want grub on another disk, use hd1, etc as appropriate. It's much easier to use the windows MBR and then just change the default boot system later if others in the family demand windows boots by default.
Then:

Code: Select all

quit
Finally reboot, and hopefully you will now have a working grub bootloader.

I hope this works for you as well as it has for me several times.
ajgreeny
Level 7
Level 7
Posts: 1657
Joined: Mon Nov 19, 2007 3:27 pm

Re: GRUB loading error 22

Post by ajgreeny »

For some reason my browser didn't log me in to the forum automatically, so this last post came up as a guest.
I hope it was of use to you and works properly. It is dead easy and has never let me down. Good luck!
ajgreeny
lanrun
Level 3
Level 3
Posts: 158
Joined: Tue Oct 23, 2007 7:31 am
Location: Lillehammer - Norway

Re: GRUB loading error 22

Post by lanrun »

Thanks to cliff76 and ajgreeny.

While you were writing answers to my post, I was searching the Internet and found this site:

http://microdotsagamedev.wordpress.com/ ... ub-loader/

I followed the instructions there, and it worked.

It is similar to what ajgreeny wrote. :D
Locked

Return to “Installation & Boot”