updating grub can end up with loopback devices in grub.cfg

Bug #1788775 reported by Michael Hudson-Doyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Opinion
Medium
Unassigned

Bug Description

I had (I think, I can't quite remember) the filesystem.squashfs from a live server ISO mounted when the kernel was updated. A menu entry for this OS-resembling device is now in my grub.cfg:

menuentry 'Ubuntu 18.04.1 LTS (18.04) (on /dev/loop35p1)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-cf05f674-791e-48eb-9b42-1bb903f4d024' {
        insmod part_msdos
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root cf05f674-791e-48eb-9b42-1bb903f4d024
        else
          search --no-floppy --fs-uuid --set=root cf05f674-791e-48eb-9b42-1bb903f4d024
        fi
        linux /boot/vmlinuz-4.15.0-29-generic root=UUID=cf05f674-791e-48eb-9b42-1bb903f4d024 ro
        initrd /boot/initrd.img-4.15.0-29-generic
}

I didn't select it :)

Something in this setup should be skipping loopback devices, surely?

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Well, we do use loop devices and do expect them to be listed for building the images. I'm not sure if there'll be a way to differentiate between the image build case and normal case to be able to pass some parameter (--skip-loopback, whatever) as appropriate. Let's look into that.

Changed in grub2 (Ubuntu):
status: New → Triaged
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hmm that's a fair point.

Changed in grub2 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Phillip Susi (psusi) wrote :

How is this something relied on for building images? As it stands, such a boot entry is non functional since it doesn't tell grub to set up a loop mapping to the underlying file so the "disk" won't be found. If you are building an image and later transferring that image to bare metal, then it would work ( who does this? ), but does that use case only need to get the running system set up, or does it also need to be able to have os-prober add entries for other installations too?

Revision history for this message
Mate Kukri (mkukri) wrote :

"If you are building an image and later transferring that image to bare metal"

this is exactly how pre-generated configs are created during ubuntu image builds, I believe.

I suppose an explicit flag could be introduced to allow loopback entry generation for use during image builds, but I don't think it is worth the trouble.

Changed in grub2 (Ubuntu):
status: Triaged → Opinion
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.