Grub 2.04 Out of memory error, No server error

Bug #1851311 reported by oldfred on 2019-11-05
64
This bug affects 13 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

Trying to loop mount ISO.

Installed grub 2.04 to flash drive in UEFI mode from 19.10
Flash drive does not boot and gives Out of memory error & no server error. Must load kernel first.

Re-installed grub from 18.04 to same flash drive using same boot stanza.
Booted without issue.

From 18.04
fred@Bionic-Z170N:~$ grub-install -V
grub-install (GRUB) 2.02-2ubuntu8.13

from 19.10
fred@fred-Z170N-eoan:~$ grub-install -V
grub-install (GRUB) 2.04-1ubuntu12

Boot stanza that works in 2.02 but not in 2.04

menuentry "Focal Live ISO" {
set isofile="/ISO/focal-desktop-amd64.iso"
loopback loop (hd0,1)$isofile
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile toram noeject
    initrd (loop)/casper/initrd
}

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
PJSingh5000 (pjsingh5000) wrote :

During bootup, I enter the grub2 command-line by pressing c on the Grub menu.

When I type the following command...

loopback loop (hd0,gpt2)/ubuntu-19.10-desktop-amd64.iso

...grub hangs, there is no more output or activity on the terminal, and eventually the laptop fans spin up because the laptop gets hot.

The path (hd0,gpt2)/ubuntu-19.10-desktop-amd64.iso is valid on my system.

I am experiencing this in Ubuntu 19.10 and did not have this issue in prior Ubuntu releases.

The version of grub2 and grub2-common I have is 2.04-1ubuntu12.

C.S.Cameron (cscameron) wrote :

I have not had problem Booting ISO files in BIOS mode in 19.10.

When booting my grub menu shows grub 2.02 at the top.

When I tried upgrading grub it tells me grub 2.04 is already installed.

PJSingh5000 (pjsingh5000) wrote :

I can confirm that Booting ISO files from BIOS in Ubuntu 19.10 works fine.
UEFI seems to have the issue.

C.S.Cameron (cscameron) wrote :

One reason I did not have problems booting a 19.10 ISO was because I used mkusb installed in 18.04 to create the foundation for the boot disk. This used grub 2.02 to boot 19.10.

Sundar (sundar-ima) wrote :

I can also confirm this bug. I have an UEFI system and latest Ubuntu 19.10 installed with updated packages. Grub2 shows these errors when trying to list an ISO with ls command from Command line in the grub2 environment. It doesn't show any error if I list a pdf it any other files. Problem seems to be in the iso9660 module.

Sundar (sundar-ima) wrote :

I am trying to boot ISO directly from my system rather than from an USB. Just for an info.

PJSingh5000 (pjsingh5000) wrote :

Does anyone know which package contains the iso9660 module for grub?

Would it be possible to copy the iso9660 module from the the 19.04 or 18.04 Ubuntu releases (e.g. grub 2.02), and explicitly load it before executing the loopback command?

Ximin Luo (infinity0) wrote :

I tried iso9660.mod from grub-efi-amd64-bin 2.00 from snapshot.debian.org and that hung as well.

I also tried installing grub-efi-ia32 instead of grub-efi-amd64 but that also hung.

PJSingh5000 (pjsingh5000) wrote :

Coming,

This is good research.
Thanks for testing.
Perhaps the cause is a secondary library or dependency that iso9660.mod is using?

PJSingh5000 (pjsingh5000) wrote :

* Ximin, apologies for the misspelling of your name; the spellcheck override what I had typed.

C.S.Cameron (cscameron) wrote :

Workaround
I used mkusb installed in 18.04, (grub 2.02), to make the foundation of an ISO booter.
ISO's in an ISO folder on usbdata partition, with casper-rw partition for persistence, (one distro only).
Usbboot partition has loop mounting grub.cfg.
Boots 18.04 and 19.10, both UEFI and BIOS, (I got a new power brick for my UEFI computer).

UEFI boot fails using mkusb installed in 19.10, (grub 2.04). whether 18.04 or 19.10.

I think the problem is grub 2.04 myself.

sudodus (nio-wiklund) wrote :

mkusb can boot from grub 2.04 when pointing to a partition, into which you have cloned from the iso file (so with an iso 9660 file system). The problem is specifically that it does not work in UEFI mode, when grub points to an iso file.

C.S.Cameron (cscameron) wrote :

But only when mkusb is installed in Ubuntu 19.10 or later, ie grub 2.04 the ISOs don't boot.
When mkusb is installed in 18.04, grub 2.02, the ISOs on the USBs it makes boot fine.

sudodus (nio-wiklund) wrote :

You are right (and you were right also in comment #12). I only wanted to make it clear for the developers what works and what does not work.

C.S.Cameron (cscameron) wrote :

To clarify, if I install mkusb in 18.04 the USBs it makes boot with grub 2.02.
If I install mkusb in 19.10 the USBs it makes boot with grub 2.04.
Grub 2.02 boots ISOs, grub 2.04 does not boot ISOs.

C.S.Cameron (cscameron) wrote :

Oops, After a little more experimenting, it appears that it is the version of Ubuntu that mkusb uses to create the persistent drive that determines the version of grub, not the version of Ubuntu mkusb is installed in. I guess that this should have been obvious.
I created an ISO booter foundation using mkusb installed in 18.04 using a 19.10 ISO. I added both 18.04 and 19.10 ISOs to the ISO folder on the usbdata NTFS partition. Both had problems booting in UEFI as mentioned above, they uses grub 2.04
I then created another ISO booter foundation using mkusb installed in 19.10 using a 18.04 ISO. I added both 18.04 and 19.10 ISOs to the ISO folder. Both booted fine in UEFI mode, they used grub 2.02.
I will try duplicate my findings tomorrow.

sudodus (nio-wiklund) wrote :

@ C.S.Cameron,

While you are testing, please try with usb-pack-efi too. I think it should make things work, where there are problems now.

(It is still important to squash this bug, but usb-pack-efi might be a workaround for people using mkusb as a foundation for iso booting.)

C.S.Cameron (cscameron) wrote :

@sudodus, I tried a fresh install or two yesterday, I ran sudo apt-get install usb-pack-efi (# for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files). when installing.
Is that enough?

Will try again today.

sudodus (nio-wiklund) wrote :

@ C.S.Cameron,

Yes, I think it is enough with a single test. Please tell us the result of your test when usb-pack-efi is selected in the settings menu of mkusb. Will it make a difference in order to make it possible to boot into an iso file?

@sudodus:

Made a persistent 4GB flash drive using mkusb menu item usb-pack-efi with
19.10.
Used this drive to make a second 4GB flash drive using mkusb menu item
usb-pack-efi with 19.10.
(Just to make sure grub 2.02 had no way to sneak in).
Deleted ISO9660 partiton #4, stretched Casper-rw partition #5 into place
and expanded usbdata NTFS partition #1.
Dropped 19.10 ISO into iso folder on NTFS partition.
Updated grub.cfg on usbboot partition #2 to loopmount the 19.10 ISO.
Booted in BIOS using grub 2.04
Booted in UEFI using grub 2.02~Beta2

This solution works for me. I am impressed.

Is there way to retro fit this to a working system so sundar-ima can use it
to boot ISOs from his internal dive? I wonder how Qemu is doing with this
bug?
Mkusb would work fine for setting up a small SSD, as either Full or
Persistent install for booting ISOs, but my SSD booting option seems to be
missing?

On Sun, Nov 17, 2019 at 11:30 PM sudodus <email address hidden> wrote:

> @ C.S.Cameron,
>
> Yes, I think it is enough with a single test. Please tell us the result
> of your test when usb-pack-efi is selected in the settings menu of
> mkusb. Will it make a difference in order to make it possible to boot
> into an iso file?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1851311
>
> Title:
> Grub 2.04 Out of memory error, No server error
>
> Status in grub2 package in Ubuntu:
> Confirmed
>
> Bug description:
> Trying to loop mount ISO.
>
> Installed grub 2.04 to flash drive in UEFI mode from 19.10
> Flash drive does not boot and gives Out of memory error & no server
> error. Must load kernel first.
>
> Re-installed grub from 18.04 to same flash drive using same boot stanza.
> Booted without issue.
>
> From 18.04
> fred@Bionic-Z170N:~$ grub-install -V
> grub-install (GRUB) 2.02-2ubuntu8.13
>
> from 19.10
> fred@fred-Z170N-eoan:~$ grub-install -V
> grub-install (GRUB) 2.04-1ubuntu12
>
> Boot stanza that works in 2.02 but not in 2.04
>
> menuentry "Focal Live ISO" {
> set isofile="/ISO/focal-desktop-amd64.iso"
> loopback loop (hd0,1)$isofile
> linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile
> toram noeject
> initrd (loop)/casper/initrd
> }
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1851311/+subscriptions
>

sudodus (nio-wiklund) wrote :

This is actually going back to my original usage of usb-pack-efi, that is described in post #6 and the following posts of this thread at the Ubuntu Forums,

https://ubuntuforums.org/showthread.php?t=2259682&p=13300523#post13300523

This grub system works in UEFI and BIOS mode. It is developed from a multiboot system for UEFI by Andre Rodovalho.

I will think about including such an option in mkusb. Please consider that you and Sundar are welcome to use this piece of FOSS software in tools that you create and maintain :-)

tsger (tsgermany) wrote :

I rely on being able to boot iso files directly from an internal drive (not using an external usb pen drive). As others have mentioned, if I generate the grub menu from within 19.10, (i.e. using grub 2.04), then mounting iso files fails, and system hangs. Currently I am using Arch as my main system, and it uses grub 2.04, and it is able to boot from iso files of various distros with no problem.

My conclusion would be that it is not a problem of the grub version, but somehow a problem with this particular iteration of ubuntu (i.e. 19.10)

C.S.Cameron (cscameron) wrote :

@tsger:
You did not mention if you are booting in BIOS or UEFI mode.
I have only had problem when using both UEFI and Grub 2.04.

tsger (tsgermany) wrote :

@cscameron:

I am booting in UEFI mode.

Starbeamrainbowlabs (sbrl) wrote :

Also ran into this bug. Only happens when UEFI booting - it works fine when booting via BIOS.

I've got a flash drive I've configured to boot via both BIOS and UEFI mode for booting multiple Linux isos.

pino (pi.no) wrote :

Same issue is blocking my work since some weeks now...

pino (pi.no) wrote :

Isn't there at least some workaround, e.g. downgrading grub? I urgently need to work around it somehow. If it isn't at least possible to get such things fixed early, Ubuntu is maybe the wrong distribution for real usage...

What additional information do you need? I can even reproduce it easily in my VMs...

C.S.Cameron (cscameron) wrote :

@Pino:
Sudodus fix worked for me.
See posts 17 to 21 for workaround.
If you want instructions turning mkusb into an ISO booter let me know.

On Thu, Dec 26, 2019 at 3:00 PM pino <email address hidden> wrote:

> Isn't there at least some workaround, e.g. downgrading grub? I urgently
> need to work around it somehow. If it isn't at least possible to get
> such things fixed early, Ubuntu is maybe the wrong distribution for real
> usage...
>
> What additional information do you need? I can even reproduce it easily
> in my VMs...
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1851311
>
> Title:
> Grub 2.04 Out of memory error, No server error
>
> Status in grub2 package in Ubuntu:
> Confirmed
>
> Bug description:
> Trying to loop mount ISO.
>
> Installed grub 2.04 to flash drive in UEFI mode from 19.10
> Flash drive does not boot and gives Out of memory error & no server
> error. Must load kernel first.
>
> Re-installed grub from 18.04 to same flash drive using same boot stanza.
> Booted without issue.
>
> From 18.04
> fred@Bionic-Z170N:~$ grub-install -V
> grub-install (GRUB) 2.02-2ubuntu8.13
>
> from 19.10
> fred@fred-Z170N-eoan:~$ grub-install -V
> grub-install (GRUB) 2.04-1ubuntu12
>
> Boot stanza that works in 2.02 but not in 2.04
>
> menuentry "Focal Live ISO" {
> set isofile="/ISO/focal-desktop-amd64.iso"
> loopback loop (hd0,1)$isofile
> linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile
> toram noeject
> initrd (loop)/casper/initrd
> }
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1851311/+subscriptions
>

tsger (tsgermany) wrote :

@cscameron:
Yes, I would love to have the instructions for turning mkusb into an ISO booter. I tried to follow your post #21 above, but it wasn't clear. Thank you!

C.S.Cameron (cscameron) wrote :

Simple ISO Booter using mkusb.

https://askubuntu.com/questions/1075755/create-bootable-ubuntu-usb-on-a-partition-instead-of-overwriting-the-entire-usb/1080749#1080749

When setting up mkusb select "usb-pack-efi" per post #18 above. It should insure the use of grub 2.02.

More Complex ISO Booter using mkusb

If you wish to add up to 8GB of persistence to each ISO using casper-rw and home-rw files with persistent-path see:

https://askubuntu.com/questions/1183191/handmade-live-usb-multisystem/1184111

Benoit THIBAUD (frombenny) wrote :

https://savannah.gnu.org/bugs/?57322 is the bug on the development team site..

This menu works for me
menuentry "... Gparted live" {
 set isofile="/isos/gparted-live-0.33.0-1-amd64.iso"
 search --set=root --file $isofile
 loopback loop $isofile
 linux (loop)/live/vmlinuz boot='live' union='overlay' username='user' config locales='fr_FR.UTF-8' keyboard-layouts='fr' components noswap noeject toram='filesystem.squashfs' ip='' findiso="${isofile}"
 initrd (loop)/live/initrd.img
}

but the xubuntu's ones don't..

C.S.Cameron (cscameron) wrote :

Have a look in casper on the xubuntu ISO.
Confirm your menuentry uses the same as ISO:
vmlinuz or vmlinuz.efi
initrd or initrd.lz

Benoit THIBAUD (frombenny) wrote :

The problem doesn't come from the casper package. The problem is in the grub-efi-amd64-bin package (latest version tested:2.04-1ubuntu16). Actually, it's the file grubx64.efi inside this package (/usr/lib/grub/x86_64-efi/monolithic/grubx64.efi).

menuentry ".. Xubuntu .... test daily" {
 set isofile="/isos/focal-desktop-amd64.iso"
 search --set=root --file $isofile
 loopback loop $isofile
 linux (loop)/casper/vmlinuz iso-scan/filename=$isofile boot=casper noprompt quiet splash --
 initrd (loop)/casper/initrd
}

menuentry ".. Xubuntu Default cd Menu" {
 iso_path="/isos/focal-desktop-amd64.iso"
 export iso_path
 search --set=root --file $iso_path
 loopback loop $iso_path
 root=(loop)
 configfile /boot/grub/loopback.cfg
 loopback --delete loop
}

It doesn't work in 2.04 grub version. So I experienced something.

1- I downloaded the 2.02 grub-efi-amd64-bin package from here:
 https://packages.ubuntu.com/disco-updates/amd64/grub-efi-amd64-bin/download

2- I opened the deb package with my archive manager

3- I extracted the file: grubx64.efi
 (from /usr/lib/grub/x86_64-efi/monolithic/)

4- I launched efibootmgr in a terminal to be sure where to copy it

5- I copied it in the right folder in /boot/efi
 sudo cp grubx64.efi /boot/efi/EFI/xubuntu/.

After that, both menus worked fine (in a 2.02 grub)!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.