|
From: | Nicholas Vinson |
Subject: | Re: [PATCH] Add support for specifying the boot device by label |
Date: | Tue, 12 Sep 2023 08:10:44 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 |
On 9/11/23 07:15, darkpenguin wrote:
You can write an entry into /etc/fstab that identifies the the rootfs by label, uuid, or something else that's supported by `mount`, the init system will correctly remount the rootfs using that entry, but if you told the kernel to do it, it'd panic with an error (most likely "unknown block-device") because the kernel is limited to supporting a very small subset of methods.The same argument hold with initramfs images too; however, the de-facto standard is that initramfs images support root=UUID=... where the UUID is the fs UUID. Therefore, it's assumed that with an initramfs, you can mount with device name, partition uuid, or fs-uuid. Without an initramfs, booting can only be done using device name and partition uuid.Hmmm, this is actually a good idea. Grub does determine the boot device by analyzing fstab, doesn't it? Why does it then use either UUIDs or device paths, based on a configuration in a separate file, instead of simply reusing exactly what it has found specified in fstab? That would have been understandable in the past, when maybe Grub did not support UUIDs or labels, so the algorithm would have been "find the specified device, then find its path and use that". But now we can simply reuse exactly what's specified in fstab, can't we? (Though I'm afraid figuring out that process is beyond my skill or capacity at the moment.)
Put simply, the rootfs entry in /etc/fstab (assuming it has one) cannot be used to determine how to mount the device at boot time because the entry might use a method that neither the kernel nor the initramfs supports.
On 11/09/23 14:44, Olaf Hering wrote:Sun, 10 Sep 2023 09:30:24 +0000 darkpenguin <darkpenguin@posteo.de>:Specifying the boot device by its label rather than its UUID can be pretty useful in various situations (e.g. multiple test VMs).Yes, this is very true. It is up to the local admin to decide how the various block devices are supposed to be mounted. The details how it must be done is configured by the local admin via the well establish file /etc/fstab, and of course other block device related configuration files. As you have noted, any such decision is outright ignored by grub2. So instead of adding more to the existing arrogance, please remove the offending code and implement something that respects the local configuration files. Thank you. Olaf _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
[Prev in Thread] | Current Thread | [Next in Thread] |