delete Grub title

General support questions
Post Reply
hachouri
Posts: 3
Joined: 2020/12/31 04:38:23

delete Grub title

Post by hachouri » 2020/12/31 04:45:05

Hello,
Is there a way using sed command to delete all menuentry title in grub.
the section should be
menuentry title OS version ...
{
kernel and initial ramdisk parameter line1
kernel and initial ramdisk parameter line2
...
}

I want to delete the line menuentry and what is after between the brackets

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: delete Grub title

Post by TrevorH » 2020/12/31 14:12:47

This sounds like an XY question. What do you really want to do and why?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hachouri
Posts: 3
Joined: 2020/12/31 04:38:23

Re: delete Grub title

Post by hachouri » 2021/01/06 06:12:39

I want to delete all existing entries then use the command new-kernel-pkg to make custom titles with only the latest kernel. deleting manually the entries works but I want something to use in a scripts

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: delete Grub title

Post by jlehtone » 2021/01/06 09:51:16

Installation of a new kernel creates a menuentry for it.
Removal of (unused) kernel package removes its menuentry too.

It is usually safer to have at least two kernels installed, should one of them become unbootable.

hachouri
Posts: 3
Joined: 2020/12/31 04:38:23

Re: delete Grub title

Post by hachouri » 2021/01/06 10:15:05

I'll not remove the kernel I just want to remove the menuentry section in the grub and add custom section

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: delete Grub title

Post by TrevorH » 2021/01/06 10:43:48

What you're intending to do will probably break future kernel updates as it will attempt to modify the file to remove old kernels that are about to be removed (and won't exist in the file so at a minimum it's going to produce an error message which may be purely cosmetic or it may break). Any new kernels will be added with a similar title and will probably undo the things you just did.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply