AsahiLinux / asahi-installer

Asahi Linux installer
MIT License
782 stars 103 forks source link

Side by side minimal installs have identical UUIDs #265

Closed pat42smith closed 1 month ago

pat42smith commented 3 months ago

I tried to install two copies of Fedora Asahi 39 on a single M2 Mac Mini, both minimal installs. This led to various bad outcomes, such as booting in to one of them showing the other's root filesystem mounted at /. And the boot process not completing, but leaving me at a prompt "Enter root password for maintenance", and after rebooting, "Press enter for maintenance" (That's not the exact wording of the two messages, but captures the gist; I'm writing just from memory.)

On examination, I found the two installs were using the same set of 3 filesystem UUIDs for /, /boot, and /boot/efi. I am guessing that this is the cause of the above problems. Also, I would guess the UUIDs are hard coded in the filesystem images used by the installer, and that similar problems would occur whenever doing side by side installs of the same type.

On the other hand, I have tried doing a minimal install beside a KDE install. And on another occasion, a minimal install beside a server install. Both cases seemed to be fine. When I checked the UUIDs in the minimal+server case, they were all different. I imagine this would true with any pair of different type installs, but haven't tested any further.

How bad could the consequences of this be? I don't know, but I'd worry about the possibility that someone might have had an install for some time, then decide to install another copy beside it, using the same type, and wind up losing all their data from the original install.

What could be done about this? I suppose the ideal would be to randomize the UUIDs on each install. Failing that, perhaps the installer could display a warning?

marcan commented 1 month ago

This is a known regression for the Fedora images. On Arch we used to randomize the UUIDs on first boot, but that never got implemented for Fedora (maybe it was because it was hard to do online with btrfs?). It is not practical to randomize the UUIDs at installation time, since they need to be changed in bootloader scripts etc.

This is not an installer bug though, please file it here: https://pagure.io/fedora-asahi/remix-bugs/issues (cc @conan-kudo)

Also note that different versions/builds also have different UUIDs, so installing e.g. F40 and F39 side by side should work, as well as installing with enough time passing in between that we pushed new image builds. You can also grab nightly image builds from https://fedora-asahi-remix.org, each of which has a different UUID.

Conan-Kudo commented 1 month ago

It never got implemented because I don't think either @davide125 or I knew that was a thing we should do.

As far as I know, btrfstune -u <deviceid> can do it, but only for an offline btrfs filesystem. Maybe it's possible to change it so it's allowed for online filesystems?

pat42smith commented 1 month ago

This is not an installer bug though, please file it here: https://pagure.io/fedora-asahi/remix-bugs/issues (cc @Conan-Kudo)

Filed as https://pagure.io/fedora-asahi/remix-bugs/issue/9 . I will make some replies there.