Can't create a bootable disk by doing image creation on a loop device

Bug #1824245 reported by Neal Gompa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Triaged
Medium
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

I'm trying to create a bootable disk image using an image file mounted as a loop device with partx.

While the grub-install succeeds, when I attempt to boot in KVM or VMware, it fails with the following error:

""""
error: no such device: 92136917-76ff-4115-9eed-9caa20529682.
Entering rescue mode...
grub rescue> _
""""

The grub boot configuration entry my process creates is pretty simple:
"""
menuentry 'Ubuntu LTS (v16.04)' {
  search --set=root --no-floppy --fs-uuid 92136917-76ff-4115-9eed-9caa20529682
  loopback loop /images/16.04.img
  linux (loop)/vmlinuz root=UUID=92136917-76ff-4115-9eed-9caa20529682 rootdelay=120 rw quiet panic=5 vga=791 consoleblank=0 max_loop=256 splash loop=/images/16.04.img net.ifnames=0 nomdmonisw nomdmonddf bootdegraded=true audit=1
  initrd (loop)/initrd.img
}

"""

I think it's because this commit is missing from Ubuntu 16.04's grub2 package: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=35f2d96c0d68772c831952b2ee4eba6519d6ea1b

Could this get fixed in some way?

I'm using Ubuntu 16.04.6. The current grub2 package version is "2.02~beta2-36ubuntu3.21".

Revision history for this message
Neal Gompa (ngompa13) wrote :

I'll also note that it sometimes works with UEFI, but I've never gotten it to work with BIOS...

Revision history for this message
Neal Gompa (ngompa13) wrote :

I'll note that this configuration is loop images on a disk that was created as a disk image file mounted as a loop.

Revision history for this message
Neal Gompa (ngompa13) wrote :

I've verified locally that this does fix my issue when I patch grub myself.

Changed in grub2 (Ubuntu Bionic):
status: New → Fix Released
Changed in grub2 (Ubuntu):
status: New → Fix Released
Changed in grub2 (Ubuntu Xenial):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Neal Gompa (ngompa13) wrote :

Bump? What about Ubuntu 16.04?

Revision history for this message
Neal Gompa (ngompa13) wrote :

cyphermox, could you please backport the fix for Ubuntu 16.04?

Revision history for this message
Neal Gompa (ngompa13) wrote :

cyphermox, if this helps, I've created a patch that directly applies on top of the existing grub2 sources reconstructed with `dpkg-source -x` that I've tested locally to work.

Revision history for this message
Colin Watson (cjwatson) wrote :

The /sbin change there is wrong; please cherry-pick https://salsa.debian.org/grub-team/grub/commit/128487746598d3fac60569b11de12ffef58cd8f7 instead.

Revision history for this message
Neal Gompa (ngompa13) wrote :

cjwatson, I've updated the patch accordingly...

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

The bug description should follow the SRU style:
https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Revision history for this message
Robie Basak (racb) wrote : Proposed package upload rejected

An upload of grub2 to xenial-proposed has been rejected from the upload queue for the following reason: "SRU information not provided.".

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

Other bug subscribers

Remote bug watches

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