grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add support for specifying the boot device by label


From: darkpenguin
Subject: Re: [PATCH] Add support for specifying the boot device by label
Date: Tue, 12 Sep 2023 14:17:27 +0000

On 12/09/23 16:10, Nicholas Vinson wrote:
> On 9/11/23 07:15, darkpenguin wrote:
>> 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.)
>>
> 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.
> 
> 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.

So then... Get whatever is specified in fstab, then try to use that
as-is, or fall back to either UUID of device name as per
GRUB_ENABLE_LINUX_UUID ?

There are now labels, which seem to be supported by any of those (or
not?); what else could there be in fstab that's not supported by
grub/kernel?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]