Following on the ["maintenance free" question here](https://ubuntuforums.org/archive/index.php/t-2076205-p-3.html) , 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](https://unix.stackexchange.com/questions/93767/) (and [failed here](https://ubuntuforums.org/showthread.php?t=1373394) 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?
1. 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](https://serverfault.com/questions/713698/) : _"I'm unable to mount the device using PARTLABEL"_.
But, it should be promising, as I can [see](https://unix.stackexchange.com/a/93777/374303)
> Since 4.20, there's also support for PARTLABEL , which I think is really convenient. Perhaps update the answer. –
equaeghe Jan 20
2. Second best would be **PARTUUID
**. However, there are some confusing/conflicting answers floating on the Internet.
* [Here](https://unix.stackexchange.com/a/151483/374303) it says the format is PARTUUID=SSSSSSSS-PP
, but it doesn't give an example what exactly it looks like,
* the [next answer](https://unix.stackexchange.com/a/93777/374303) gives an example but it says the format is root=PARTUUID=666c2eee-193d-42db-a490-4c444342bd4e
So, would using PARTLABEL
or PARTUUID
possible with the latest grub2?
Asked by xpt
(1858 rep)
Oct 17, 2021, 04:34 PM
Last activity: Oct 18, 2021, 02:39 AM
Last activity: Oct 18, 2021, 02:39 AM