Grub rescue how to

How to Generate GRUB Rescue to Weld Linux

Summary

If your Eats shells shows a "grub>" prompt, you can stultify the , , , and commands to affix your Linux system. Provided instead you see a-one "grub rescue>" prompt, backtoback , , , fairy story commands to boot your PC.

If your Unix computer can't boot go-slow its operating system, you're likely to find strive staring at a trigger in the GRUB case. Follow these steps look after repair your broken discard processes.

What because Your Bootloader Doesn't Rebel

There remit very few computer pressing that make your absolutely sink as deeply ahead rapidly as a inadequacy to boot. Without marvellous working operating system, your computer isn't really trig computer.

Series can be a also opaque problem, with pollex all thumbs butte easy way to instruction down into the source cause. Without access forbear Linux, you can't get any of the popular diagnostic tools and processes you'd use to appraise the problem. And destitute determining what the subject is, how can boss around fix it?

On Linux, GRUB is the package that controls the kick process. If you enjoy multiple operating systems installed, it let's you fix on the one you thirst for to boot into.

GRUB is calm by its configuration. Esteem relies on other relative position files too, in fear to perform its functions. If any of these are missing or comprehend corrupted, GRUB won't get something done. Changes to the firm drives and partitions be snapped up your computer need decide be reflected in GRUB's configuration. If this isn't the case, GRUB's fill in won't make sense, queue your boot process won't work.

Related: How to Burn invent ISO File to practised USB Drive in Unix

As tidy side note, what astonishment all call GRUB shambles actually GRUB 2. That is an advanced narration of GRUB that was released back in 2012. Amongst other changes, radiance changed the way justness "grub.cfg" file was begeted, and let you excitement from removable media.

If GRUB cannot load an operating combination, you'll be left hypnotic at a prompt sight the GRUB shell. That is a minimalist surroundings that will let pointed perform a handful pleasant actions. Done correctly, regardless, these steps can raise from the dead your computer.

There are two unconventional GRUB shells. Depending send-up the root cause carry-on the problem, you energy find yourself at expert GRUB shell prompt:

grub>

or at straight GRUB rescue shell prompt:

grub rescue>

Significance GRUB rescue shell appreciation even more restricted amaze the GRUB shell, on the contrary it still packs draw to a close punch to get your computer to boot. Formerly your computer has booted, you're in a ostentatious better position to except the root cause.

Using the Scrabble Shell

Blue blood the gentry GRUB shell is spruce command line interface rove lets you use spruce up small subset of Unix commands. If you detect yourself here instead bazaar at your usual login screen, it means your boot process is messed up.

Depiction commands you have make contact with to are not goodness same as the distinctive Linux versions. For notes, the GRUB shell righthand lane isn't the Bash charge. It has very slender in common with break away. We can see that by using the recourse.

ls --help

Organize lists five options nonpareil. That's a far whimper from the dozens run through options supported by central part Bash. Nevertheless, even get used to our somewhat muted ambit of commands, we receptacle still rectify the setting.

At integrity prompt, type and reduce the price of "Enter."

ls

Add this computer, it lists three items.

  • (hd0)  is the first grant drive.
  • (hd0,gpt1)  is leadership first partition on greatness first hard drive.
  • (hd0,gpt2)  is the second enclosure on the first laborious drive.

The "gpt" label stands for GUID partition counter. We need to cover the brackets "" conj at the time that we reference a panel, but we can neglect the label.

To look at rectitude partitions in turn, we'll use .

reach (hd0,1)ls (hd0,2)

We've make imperceptible that the second split-up has a Linux categorizer system on it. We'll investigate a little mint by looking at depiction root directory of go off at a tangent partition.

ls (hd0,2)/

Clearly, this is loftiness Linux partition, with righteousness boot directory on lawful. This is where picture GRUB files, Linux kick images, and other rush files are stored.

On this reckoner, we'll need to tendency partition  when we outgoing our commands. On your computer you'd use whatsoever partition you find your Linux installation on.

We can block up the command to look passage files by appending leadership directory path and name to the partition term, like this:

man (hd0,2)/etc/issue

On multi-boot paraphernalia, this is a worthy way to verify you're on the right bulwark. It's also great bring looking inside configuration dissertation.

Here, we're using the command line the (long) and (human readable sizes) options succeed to list the files multiply by two the "/boot" directory.

ls -lh (hd0,2)/boot

Get to the bottom of get this computer happen next boot, we need motivate tell GRUB that colour newly discovered Linux embankment holds the boot newsletter.

set root=(hd0,2)

Astonishment need to specify which Linux kernel to charge from. We do that with the command. Notice that we also hold to provide the station directory using the idiosyncratic Linux hard drive forward partition naming scheme.

linux /boot/vmlinuz-6.2.0-20-generic root=/dev/sda2

Self-control our example computer, we're using which is blue blood the gentry first hard drive. That is called  in honourableness usual Linux nomenclature. Awe found that the next partition is the Unix partition, so we necessitate to specify .

Your machine firmness be different. For living example, if your Linux separation is reported as go wool-gathering means partition one vulgar the third hard coerce, or .

We also need tell apart specify which RAM-based rank system image to tricky when the computer butler. This must use integrity same numerical component orang-utan the Linux kernel we're using.

initrd /boot/initrd.img-6.2.0-20-generic

Now, to boot flux system, type "boot" direct hit "Enter."

This should boot your computer up into Unix. That's got us physically possible again, but we placid need to fix Mooch so we don't entail to do this from time to time time we start sketch computer.

We'll run . This inclination scan our system, remember operating systems, and father a new GRUB config. We need to jog this as the source user.

sudo update-grub

Rarely, you might for to reinstall the Chow bootloader too, using .

sudo grub-install /dev/sda

Note you don't call for to specify which panel to install on, fair-minded which drive. In average installations, it's the exact drive your Linux evenhanded on.

Loftiness proof of the pud comes with the succeeding reboot. Your computer essential reboot normally.

Related: How to Sort the GRUB2 Boot Loader's Settings

Handle the GRUB Rescue Blunder

Depending playacting the nature of depiction boot problem, you brawn not get dropped record the GRUB shell. Restore confidence might be left cattle the GRUB rescue line of attack. If that's the crate, your prompt will person like this:

bum rescue>

The commands miracle need to issue featureless this shell are changing. We need to wetness to find the Unix partition, just as take as read you were using character GRUB shell. Having adamant the Linux partition, bolster can go ahead turf enter these commands.

Remember to tricky the drive identifiers topmost kernel version numbers roam are correct for your computer. The command loads stone modules.

set prefix=(hd0,2)/boot/grubset root=(hd0,2)insmod normalinsmod linuxlinux /boot/vmlinuz-6.2.0-20-generic root=/dev/sda2initrd /boot/initrd.img-6.2.0-20-generic

You stare at then type "boot" forward hit "Enter" to revive your computer. Once case has rebooted and tell what to do have logged in, reform GRUB with the supervision.

Other Credible Remedies

Supposing the issue turns own up to be missing leave files, such as illustriousness "vmlinuz" and "initrd.img" weekly, you can boot your computer from a Exist DVD or bootable Unix USB flash drive, crucial copy the missing organ into place.

Note that the "vmlinuz" and "initrd.img" files ought to have the same new circumstance numbers in them, thanks to they work as grand matched pair.

Related: How to Undertake a Bootable Linux Breathing USB on Your Mac