On Thu 21 Apr 2022 at 05:30:31 (-0500), Richard Owlett wrote:
> On 04/20/2022 05:44 PM, David Wright wrote:
> > On Wed 20 Apr 2022 at 20:09:54 (+0000), Andrew M.A. Cater wrote:
> > > On Wed, Apr 20, 2022 at 02:31:30PM -0500, Richard Owlett wrote:
> > > > I have a machine set aside to test several configurations of Debian 11.
> > > > 
> > > > Is there away to have the Grub Menu _automatically_ display the assigned
> > > > partition name rather than than /dev/sdaN ?
> > > 
> > > I wonder whether this changes if you use labels as references?
> > 
> > I'm not sure quite what you mean by "as references".
> > 
> > > To be honest, I never notice - it's a menu which says Debian and a couple
> > > of other options and I jut hit [Enter] almost automatically :)
> > 
> > If by "assigned partition name" the OP means either of LABEL or
> > PARTLABEL, then I think the answer is no.
> 
> When creating a partition with Gparted the is a box titled "Label:".
> I was referring to the content placed there.

There are lots of partitioners, but only one set of useful names,
those matched by * in /dev/disk/by-*. I let the Grub scripts play
with the UUIDs, and switch over to LABELs when it's done.

> > Grub itself, of course,
> > supports their use, but not the scripts that generate grub.cfg.
> 
> IIRC several years ago I was told I could manually edit to display as
> desired. It would be overwritten the next time update-grub was run.

That's right. So you can change what Grub eventually does when booting
at several levels:

. Press E at the blue screen, and do what you like as it only lasts
  one boot. But remember what it was you did, in case it works.

. Edit grub.cfg, and take some care, but if you screw up, you can
  boot from another entry, and grub-mkconfig will generate a fresh
  copy.

. Edit /etc/default/grub, and take more care as screw-ups are
  more persistent.

. Roll your own.

(I think all that was more for the benefit of mick crane, BTW.)

For using LABELs, the second approach is easiest, as long as you
script it. Kernel and Grub upgrades will create a fresh grub.cfg
which will require rerunning your script.

> > If you allow grub-mkconfig to use UUIDs (the default), then
> > it's relatively straightforward to script their conversion
> > to LABELS, using the information in /run/udev/data/b* to
> > build a conversion table. Just remember that you have to
> > pair each change with the option names, --fs-uuid → --label.
> > 
> > That probably falls outside the OP's definition of _automatically_
> > displaying them.
> 
> It's outside of my ideal dream. My desired result should be achievable
> with a batch file calling update-grub and then using a routine to do
> the process in the paragraph above. 'Bout time I brushed up on batch
> file prep ;}

That's right. My script copies grub.cfg → grub.cfg-uuids and
grub.cfg-edited → grub.cfg-old, then processes grub.cfg →
grub.cfg-edited as described, and copies that back to grub.cfg.

> Recommended reading that I wouldn't immediately find with DuckDuckGo?

That depends on the language you choose for your script. I used shell,
so Greg's pages are invaluable for, eg, bash arrays. You used to
express a preference for TCL at one time.

Cheers,
David.

Reply via email to