Following on the "maintenance free" question here, I know there are ways to automatically generate grub2 menu entries, but I need to manually edit/add them from time to time, like
- to a live-Linux system, or
- when adding a new ISO boot entry (that exists on another disk).
Almost all grub2 intro docs use the form of
set root=(hd2,gpt7)
which I know will fail in my case, as I need to shuffle my HDs around between my machines from time to time, and the above format will surely break when that happens.
Despite the likelihood that I can't specify my root fs with a UUID (and failed here too), I don't want to use UUID either, because when I format a partition (when installing a new OS), that partition's UUID will change.
So what are the better options?
- Foremost, the GPT partition label is the best candidates, as I can make sure they are unique throughout all my machines, even when I shuffle my HDs around. However, there seems to be problem doing that: "I'm unable to mount the device using PARTLABEL".
But, it should be promising, as I can see
Since 4.20, there's also support for PARTLABEL <github.com/torvalds/linux/blob/v4.20/init/do_mounts.c>, which I think is really convenient. Perhaps update the answer. – equaeghe Jan 20
- Second best would be
PARTUUID
. However, there are some confusing/conflicting answers floating on the Internet.- Here it says the format is
PARTUUID=SSSSSSSS-PP
, but it doesn't give an example what exactly it looks like, - the next answer gives an example but it says the format is
root=PARTUUID=666c2eee-193d-42db-a490-4c444342bd4e
- Here it says the format is
So, would using PARTLABEL
or PARTUUID
possible with the latest grub2?