ideally should boot rootfs from a matching hard drive

Bug #1923464 reported by Dimitri John Ledkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
Invalid
Undecided
Unassigned
grub2 (Ubuntu)
Invalid
Undecided
Unassigned
Impish
Invalid
Undecided
Unassigned
initramfs-tools (Ubuntu)
New
Undecided
Unassigned
Impish
Invalid
Undecided
Unassigned
systemd (Ubuntu)
New
Undecided
Unassigned
Impish
Invalid
Undecided
Unassigned
u-boot (Ubuntu)
Invalid
Undecided
Unassigned
Impish
Invalid
Undecided
Unassigned
u-boot-menu (Ubuntu)
Invalid
Undecided
Unassigned
Impish
Invalid
Undecided
Unassigned

Bug Description

Ideally we should strive to boot rootfs from a matching hard drive.

I.e. if we are booting rootfs by UUID, we should try to find the one that came from the same drive as where ESP (UEFI) came from, or u-boot spl / u-boot got loaded from (loader1/loader2).

Such that for example, when booted from external usb stick, rootfs from there is mounted.

Or when booted from internal drive whilst a dd backup is attached over usb, rootfs is loaded from the internal drive not from the usb attached backup.

This would need:

* u-boot to export the drive it loaded extlinux.conf / bootscript from, and pass it on kernel command line

* grub to export the device UUID it got loaded from (from the BootServices EFI table) and pass it on the kernel command line or via runtime EFI variable

* sdboot already does that I believe, but not sure if initramfs-tools consumes the sdboot provided information

* initramfs-tools to consume above and sort the discovered devices based on that, when deciding what to mount as rootfs

Tags: fr-1344
description: updated
tags: added: rls-ii-incoming
Revision history for this message
Julian Andres Klode (juliank) wrote :

This proposal seems somewhat incompatible with our resilient boot specification.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

My understanding of resilient boot is that there are multiple ESPs trying to boot the same raid device.

If there is only one rootfs filesystem, boot that one. Which in case of raid, there will be only one.

I'm more concerned about the case of two ubuntu-server preinstalled images on two usb sticks not booting of the right place, when there are two different installations.

tags: added: fr-1344
Revision history for this message
Julian Andres Klode (juliank) wrote :

Just to not forget: This should work. We pass the ESP/boot partition to kernel, initramfs then looks at it, and if it finds UUID on same drive, it will take that one. If not it will take UUID from any drive, thus handling RAID or encryption automagically.

tags: removed: rls-ii-incoming
Revision history for this message
Dan Streetman (ddstreet) wrote :

does this need to target systemd? It doesn't sound like any change is needed to systemd for this right?

Revision history for this message
Julian Andres Klode (juliank) wrote :

that's for systemd-boot, but oh well, nothing uses that in Ubuntu

Revision history for this message
Dan Streetman (ddstreet) wrote :

unfortunately yeah, so...don't really need to target this to systemd then right

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Passing the ESP device
----------------------

All UEFI firmware already passes the device path of the loaded image in the EFI_LOADED_IMAGE_PROTOCOL installed on the handle passed to the loaded binary (shim, GRUB, Linux, ...). So your requirement is already fulfilled.

We just have to stop using legacy booting mechanisms.

UUIDs
-----

UUIDs are globally unique IDs. If two partitions with the same UUID exist in the system ,this is a grave user error. We should not try to fix it.

Which remaining gap do you see? Or can we close this bug report as invalid?

Best regards

Heinrich

Changed in cloud-images:
status: New → Invalid
Changed in grub2 (Ubuntu):
status: New → Invalid
Changed in grub2 (Ubuntu Impish):
status: New → Invalid
Changed in initramfs-tools (Ubuntu):
status: New → Invalid
Changed in initramfs-tools (Ubuntu Impish):
status: New → Invalid
Changed in systemd (Ubuntu):
status: New → Invalid
Changed in systemd (Ubuntu Impish):
status: New → Invalid
Changed in u-boot (Ubuntu):
status: New → Invalid
Changed in u-boot (Ubuntu Impish):
status: New → Invalid
Changed in u-boot-menu (Ubuntu):
status: New → Invalid
Changed in u-boot-menu (Ubuntu Impish):
status: New → Invalid
Revision history for this message
Julian Andres Klode (juliank) wrote :

My understanding is that this has not been addressed yet. We need to actually make use of that data even if UEFI gives us that.

Changed in initramfs-tools (Ubuntu):
status: Invalid → New
Changed in systemd (Ubuntu):
status: Invalid → New
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.