14

I've got an mkusb live USB (Ubuntu 18.04 with persistence) that boots fine on some of my computers. On one laptop I get the following error:

error: disk `hd0,4' not found.
error: you need to load the kernel first.

What do I need to do to, "load the kernel first"?


EDIT: An SD card occupying an SD slot was causing this issue. Removing the SD card allows mkusb to boot properly, and eliminates the error. Once booted I reinsert the SD card into the SD slot if I need to use it.

Display name
  • 2,121
  • 5
  • 22
  • 33
  • 1
    1. In what computer are there problems? Please specify brand name and model; 2. Please tell me which settings you used, when you created the persistent live drive. If you cannot remember, and have another USB pendrive or a memory card (and a USB card adapter), please create a new persistent live drive and use the default settings (when asked by mkusb); 3. Please check in the grub menu environment, as suggested in the answer by @Jos, `grub> ls` ... and report the result by editing your original question. – sudodus Feb 11 '19 at 17:17
  • 1
    4. In what operating system (distro and version, for example Ubuntu 18.04.1 LTS) are you running mkusb? I'm asking because I need these data in order to find the cause of this problem (if possible reproduce the problem); 5. If you have a USB pendrive or memory card with at least 16 GB, you can try a [new compressed image file](https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator/1116801#1116801). Use mkusb to *clone* from that file into a pendrive or card, and check if that system works in the computer with problems. – sudodus Feb 11 '19 at 17:33
  • 1
    6. Are there more than one USB pendrives with persistent live systems connected to the computer, when you boot? In that case, there may be confusion with the drives and partitions. – sudodus Feb 11 '19 at 17:38
  • 1
    @sudodus updated my post to answer those questions. This is the only live USB drive attached to the system. Although there are other SD cards attached to the system I haven't tried removing. I'll try that! And report back tomorrow. – Display name Feb 11 '19 at 17:52
  • 1
    Thanks for the details about tasks/questions **#1,2,4** :-) It *should* work in that computer. For example I have tested in a NUC computer with an M2 drive. I use mkusb a lot in 18.04.1 LTS. -- What about the other tasks/questions (**#3,5,6**)? **7.** And a new task about the file **`mountpoint/boot/grub/grub.cfg`** in partition #3 of the persistent live drive: Please mount the partition and copy/paste that `grub.cfg`file to your original question and indent each line 4 spaces to render it as 'code'. – sudodus Feb 11 '19 at 19:53
  • 1
    @sudodus there was another SD card in the system but it was not a live USB. I removed this SD card and everything works as expected. I'm not sure why mkusb or grub got confused and tried to boot off of the SD card. My BIOS and normal 18.04 install doesn't attempt to boot off of the SD card when the mkusb is not in the other USB slot. Problem only happens when I boot with mkusb usb. Simple solution remove SD card when booting off mkusb usb stick. – Display name Feb 12 '19 at 02:27
  • This is a reason why I am asking you to show the content of `mountpoint/boot/grub/grub.cfg` in partition #3 of the persistent live drive. Depending on the conditions in the computer, where you create the persistent live drive, it can be different, in some cases not defining the target drive as exclusively as in other cases. – sudodus Feb 12 '19 at 05:49
  • @sudodus I don't really understand how to do what you're looking for. If you could point me to a guide I can perform those actions. I tried searching online and just got more confused. – Display name Feb 13 '19 at 13:51
  • 3. Please check in the grub menu environment, as suggested in the answer by @Jos, `grub> ls` ... and report the result by editing your original question. **Press 'c' in the grub menu to get to the grub prompt, where you run `ls`** 'ell ess' – sudodus Feb 13 '19 at 14:40
  • 5. If you have a USB pendrive or memory card with at least 16 GB, you can try a [new compressed image file](https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator/1116801#1116801). Use mkusb to clone from that file into a pendrive or card, and check if that system works in the computer with problems. **See [this link](https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator/1116801#1116801) and links from it.** – sudodus Feb 13 '19 at 14:44
  • 6. Are there more than one USB pendrives with persistent live systems connected to the computer, when you boot? In that case, there may be confusion with the drives and partitions: **You can try with and without an extra USB pendrive and 6.1 check in the grub menu environment according to #3, what difference you see, and 6.2 report the difference, when you continue and try to boot (into the persistent live drive).** – sudodus Feb 13 '19 at 14:48
  • 7. And a new task about the file `mountpoint/boot/grub/grub.cfg` in partition #3 of the persistent live drive: **`sudo mount /dev/sdx3 /mnt`** where **x** is the drive letter of the persistent live drive (maybe **b** or **c**). Run **`gedit /mnt/boot/grub/grub.cfg`** and **copy/paste from gedit to the edit window of your original question** (here at AskUbuntu). – sudodus Feb 13 '19 at 14:53
  • I don't have time to try the other image at this point and mess around with that. `/media/jhunter/casper-rw/upper/boot/grub/` directory only has two files `grubenv` and `unicode.pf2`. No `grub.cfg` file. I think I'm happy just to remove the SD card and use _mkusb_ as-is. The SD card is not a live system at all (just storage) and I'm not utlizing any other live USBs. Thank you for your help and persistence @sudodus. – Display name Feb 16 '19 at 04:02
  • 1
    Did anyone get to the bottom of why this happens? I've been running Linux for years and I just started seeing this on the back of a board replacement. I can't install any Linux in UEFI mode at all at present. – IamSierraCharlie Oct 28 '19 at 22:51

5 Answers5

16

If you get to a grub prompt, it means that grub can't find the boot files that it expects. The sequence of commands to load the files and boot when grub doesn't do that for you goes something like this. First, find all partitions that grub sees:

grub> ls
(hd0) (hd0,msdos2) (hd0,msdos1)

This lists disks and partitions on the disks. One of these partitions holds your Linux system. Say it is (hd0,1). Then do:

grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-4.15.0-45-generic root=/dev/sda1

Replace (hd0,1), the version number and the partition (/dev/sda1) by what is valid for your system. In the case of vmlinuz you can just type vmlinuz- and press Tab.

grub> initrd /boot/initrd.img-3.13.0-29-generic

The version string should be identical to the one for vmlinuz.

grub> boot

should now boot up your system.

Jos
  • 28,156
  • 8
  • 82
  • 88
  • _"One of these partitions holds your Linux system."_ How do I determine which one? Thanks – Display name Feb 16 '19 at 03:58
  • 3
    You can do `ls (hd0,1)` to list its contents. If you see the familiar folders and `vmlinuz`, that"s a Linux system. – Jos Feb 16 '19 at 07:32
  • 1
    This worked for me, but I had to use `linux /boot/vmlinuz-4.15.0-45-generic root=/dev/sda1 nomodeset` because my Spectre x360 (2019) laptop has a NVidia GeForce GTX graphics card and Ubuntu would freeze after logging in. PS also, when I looked at `/dev/` folder I could not see any of my partitions to use in `root=...` ! So instead I had to write down the correct partition name from the LiveUSB install partition editor, which incidentally, I could not even run until I `e` edited the grub command from the install menu by removing `quiet splash` and adding `acpi=off` to the end of that line. –  Jul 10 '19 at 11:05
  • 1
    Omgg, you saved my life!!! I tried everything the whole day. Just lowkey put every piece of code accordingly and the final enter was a blast. boom it just initialized my previous OS. IM SO HAPPY – testing_22 Oct 23 '21 at 03:37
  • 1
    Note that on my system, I had to do `ls (hd0,1)/` to actually see directory contents. Without the `/` the output would only be a lot of information about the partition, such as filesystem type, which was also useful but not helpful in determining contents. – Caleb Jay Mar 21 '22 at 03:21
  • This works brilliantly for me but it seems this isn't a permanent solution. Every time I boot, I have to do the same thing again and again. I also noticed that I can bypass this through Advanced options in the grub menu by choosing one of the available kernels. Is there anyway to make the newly installed kernels default to load? – 83ingD33p Mar 31 '22 at 12:39
8

When that happened to me I just had to disable secure boot and it worked.

Anthony
  • 81
  • 1
  • 1
4

What do I need to do to, "load the kernel first"?

Using "Startup Disk Creator" to create thumb drive, I was unable to boot using the thumb drive, with the same recommendation.

I have a slightly different answer.


On my 14 year old Dell desktop running Lubuntu 19.10 I used "Startup Disk Creator" to load "ubuntu-19.10-desktop-amd64.iso" to a thumb drive.

The first experiment on my new (delivered last month) Dell laptop gave a similar error, with the identical offering ... "load the kernel first".

Reading the comments above, I reviewed my usb ports and found my Logitech mouse appeared to be the only usb connection.

Disconnecting the usb mouse eliminated the error.

No grub commands needed.

2785528
  • 151
  • 3
0

To solve the problem in my case I've changed the BIOS the Boot mode from UEFI to Legacy

0

Another thing that might work is simpy turning secure boot off. This is suggested here and worked for me.