The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

Views: 1,557β€…    Votes:  2β€…    βœ… Solution
Tag : grub2  
Link: πŸ” See Original Answer on Ask Ubuntu πŸ”—

URL: https://askubuntu.com/q/1054958
Title: how to tell GRUB to show the user preferred names of OS'es. Ubuntu 18.04
ID: /2018/07/14/how-to-tell-GRUB-to-show-the-user-preferred-names-of-OS_es.-Ubuntu-18.04
Created: July 14, 2018    Edited:  June 12, 2020
Upload: November 24, 2022    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


I hate to break a taboo but the easiest way is modifying grub.cfg.

Create the script my-update-grub containing:

#!/bin/bash

# NAME: my-update-grub
# PATH: /mnt/e/bin
# DESC: Run update-grub and then rename menu entries
# DATE: July 13, 2018. (yah it's a Friday)

# Must not prefix with sudo when calling script
if [[ $(id -u) != 0 ]]; then
    zenity --error --text "You must call this script using sudo. Aborting."
    exit 99
fi

#sudo update-grub # Optional remove # in column 1

sed -i "s|Windows Boot Manager (on /dev/nvme0n1p2)|Windows 10|g" /boot/grub/grub.cfg
sed -i "s|Windows Boot Manager (on /dev/sda1)|Windows 10 original|g" /boot/grub/grub.cfg
sed -i "s|Ubuntu 18.04 LTS (18.04) (on /dev/nvme0n1p6)|Ubuntu 18.04|g" /boot/grub/grub.cfg

exit 0

I tested this on my system first but, if in doubt, backup first using:

sudo cp /boot/grub/grub.cfg /boot/grub/grub.sav

Before and After

The images are a little skewed because I’m limited to capturing them at distorted 1600x1200 in Virtualbox in Ubuntu 16.04:

Before

Before

After

ResizedGrub2.png

⇧ USB ports not working after resume from sleep on Ubuntu 18.04 What is the point of the bash Null-operator ":", colon?  β‡©