I have a grub error and can't find how to repair it?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
Thunderbird
Level 1
Level 1
Posts: 5
Joined: Sat Mar 21, 2020 10:49 pm

I have a grub error and can't find how to repair it?

Post by Thunderbird »

I tried to reinstall Mint from a bootable USB with an active internet connection. It seemed to be going fine. Then there was a message that the installer had crashed.

When I power my laptop, I now get the following message:
GNU GRUB version 2.02
Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.
grub>

So from grub I typed:
ls (hd0,1)/

All the online fixes (maybe for other systems) I found said things like "you should see a file named vmlinuz or linux, and initrd.img". It didn't give any such output, though. It just gave me a new grub> prompt on the line below, as though I'd simply hit Enter.

I tried both
linux (hd0,1)/vmlinuz root=/dev/sda1
and
linux (hd0,1)/linux root=/dev/sda1.

It returned:
error:file '/vmlinuz' not found.

Holding down the power key to shut down and then pressing F2 or F10 isn't causing it to boot from the bootable USB. It always restarts to the GNU GRUB version 2.02 page.

How can I get it to boot from the bootable USB drive again or repair the kernel?
pbear
Level 15
Level 15
Posts: 5656
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: I have a grub error and can't find how to repair it?

Post by pbear »

Howdy and welcome to the Forums.

Nothing happening on the hard drive will impair boot of the USB drive. If it's first in the BIOS/UEFI, it boots before the hard drive has a chance to do (or fail to do) anything. So, my guess would be that there's a problem with the USB drive. Do you have the ability to redo it? Even better would be to try another flash drive, if you happen to have one handy.

As for the hard drive, it's not likely you have a bootable system if the installer crashed. Rather than bargain with the boot images, maybe try a file system check. At the grub prompt, type exit, then fsck -fy /dev/sda1. FYI, that command generally requires sudo, but not when run in this particular situation.
Thunderbird
Level 1
Level 1
Posts: 5
Joined: Sat Mar 21, 2020 10:49 pm

Re: I have a grub error and can't find how to repair it?

Post by Thunderbird »

I did actually try a different bootable USB. I tried installing Xubuntu, though I prefer Mint. It was fine but for some reason there was no wifi, it wasn't detecting the internal modem, and a number of help requests on the same topic didn't seem to have an easy fix.

Pretty consistently in attempting to install Mint, it said there was a problem because there was a legacy system that was BIOS based and I was trying to use a UEFI. The system didn't present an alternative suggestion, and because I'd already repeatedly wiped the HD with my installation attempts, I have no idea what this legacy system can be.

I eventually deleted all disk partitions, reasoning that because it's a SSHD (32 GB) it doesn't particularly need partitions anyway. Not my best move - now even the grub prompts aren't coming up. I am clear that it was a problem with the partitions, but I have no idea how to fix it.

I'm trying to follow these instructions: https://askubuntu.com/questions/789998/ ... ion-target

But when I give the command "p" after the prompt (parted), it says:
Warning: the driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. Ignore/ Cancel?

So, I really have no idea how to the partition the disc such that Mint will write the boot commands to it.

And I have no idea how to make Xubuntu recognize that there is indeed a wifi modem in there because it was manufactured after 2005.
pbear
Level 15
Level 15
Posts: 5656
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: I have a grub error and can't find how to repair it?

Post by pbear »

Thunderbird wrote:
Mon Mar 23, 2020 2:12 am
... it said there was a problem because there was a legacy system that was BIOS based and I was trying to use a UEFI.
Well, there's your problem. Most of it, anyway. This implies you have a UEFI computer which also can boot in BIOS mode, aka legacy or CSM. Importantly, all this happens before you get to the bootloader. To move forward, you're going to have to figure out how to access the firmware settings.
Thunderbird
Level 1
Level 1
Posts: 5
Joined: Sat Mar 21, 2020 10:49 pm

Re: I have a grub error and can't find how to repair it?

Post by Thunderbird »

To address the "physical block size is 2048 bytes but Linux says it is 512 bytes" issue, I opened a terminal and ran the following command, found on https://askubuntu.com/questions/914983/ ... -512-bytes: "Indeed. The issue is because you somehow got an iso9660 ( cdrom ) filesystem on the drive and that filesystem claims the disk uses 2k sectors ( because cdroms do ), but this is a hard disk so it uses 512 byte sectors. This will wipe out the iso9660 signature, returning the drive to an effective blank state. It is important to note that this will wipe out any data you had on the drive! "

$ sudo dd if=/dev/zero of=/dev/sdc bs=2048 count=32 && sync

output was like this:
32+0 records in
32+0 records out
65536 bytes (66 kB, 64 KiB) copied, 0.0298155 s, 2.2 MB/s


Upon reboot, the laptop still wouldn't install Mint from the Mint bootable disk. So I installed Xubuntu, using "Erase disk and install Xubuntu", hoping that it would automatically set up appropriate partitions for the HD during that process. It didn't, and still couldn't access wifi during installation. (So I didn't have gparted, and couldn't install it.)

I then re-installed Xubuntu, chosing the "something else" option, and that let me manually adjust the partitions. I found a tutorial on what settings to use for the partitions here. https://askubuntu.com/questions/343268/ ... stallation

It had automatically created a swap partition, and a partition of the right size (about 512 MB) for the efi. There was no mount point set for any of them. I set mount points and created a root file system and a section for the home folder as seemed appropriate, though the tutorial was hazy on the subject of primary vs logical partition types.

This allowed it to recognize the Mint bootable USB. It was able to install Mint and connect to wifi.
Thunderbird
Level 1
Level 1
Posts: 5
Joined: Sat Mar 21, 2020 10:49 pm

Re: I have a grub error and can't find how to repair it?

Post by Thunderbird »

It's resolved - I can't tell how to mark it as resolved, though.
pbear
Level 15
Level 15
Posts: 5656
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: I have a grub error and can't find how to repair it?

Post by pbear »

Glad it worked out, though you did it the hard way. Really, all you needed to do was figure out how to boot the Mint live session in UEFI mode.

For future reference, start with the Mint Installation Guide, then research. Also, not a good idea to use dd for this sort of thing. At best a waste of time (a lot of it) and has the potential to wreck your system. Zeroing out a drive has it's place, e.g., making it safe to discard, but not needed for installation. Speaking of installation, you don't need WiFi to get GParted. It's included on the ISO of every distro I've seen, certainly all Ubuntu and Ubuntu-derived ones. And there are no logical partitions in GPT, the UEFI partition table. You get up to 128 primary partitions. Spend them wisely. 8)

How to label a topic as [Solved].
Post Reply

Return to “Installation & Boot”