Remove lines from GRUB2 menu

Hello experts.

There are "windows" lines on multiboot menu. See attachment.
Some my users can accidentally click on "windows restore" options, and kill the system.
(Perhaps, I myself, did hard drive reformatting once by an accident...)

I cannot hide some menu lines from display.
I cannot find grub option or config file to do this task.
How to do this?

Thank you.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You should simply get rid of that option.

To do so, edit file




Whichever file you find.
Then you have to look for related paragraph, that begins with the keyword title.  Just comment out or delete till the next title

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Here is a sample grub file

itle linux
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda7 vga=791 resume=/dev/sda9
initrd /boot/initrd

title windows
rootnoverify (hd0,4)

Open in new window

Now suppose that you want to get rid of option 'windows'

All you need to do is to comment out or delete the following three lines

title windows
rootnoverify (hd0,4)
BitlabAuthor Commented:
Thank you experts.

Apparently your info is outdated.


naladchik@Acerfrog:~$ less /etc/grub.conf
/etc/grub.conf: No such file or directory

naladchik@Acerfrog:~$ less /boot/grub/grub.conf
/boot/grub/grub.conf: No such file or directory

#one must not edit this:
naladchik@Acerfrog:~$ less /boot/grub/grub.cfg

#one must edit this: /etc/default/grub
#but there are the entries to delete? ....

#apparently a right way is to edit this file
#but is is meant to add not to delete entries ...
#so ... still ... how to delete?:
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
/etc/grub.d/40_custom (END)

#the help is here:

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Well, it was a distro issue.  The latest CentOS still has the same old way.

Did you check 40_custom?
Here is important information from you guide
Configuration changes are normally made to /etc/default/grub and to the custom files located in /etc/grub.d. Any changes made directly to the /boot/grub/grub.cfg are overwritten whenever update-grub is executed either by the user or when called automatically by various system functions.

After editing /etc/default/grub or the scripts in the /etc/grub.d folder the user should run sudo update-grub to incorporate the changes into the GRUB 2 menu.

Also do

grep -R "title" /etc/grub.d
grep -R "title" /etc/default

This is a video guide
BitlabAuthor Commented:
Thank you farzanj.

This even not close. There is nothing about removing "menu".
The closest solution is here:
but is still risky.

If no one knows a solution: I have to admit that Unbuntu menu is not safe and revert to
manual editing of /boot/grub/grub.cfg
BitlabAuthor Commented:
Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.