Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up my system. The features of it are:

  • GPT partition table (not sure how important this is)
  • Triple boot - Gentoo, Debian and Mint.
  • Custom kernel (kernel git repo) shared amounst distros.

Now I am wanting to write my own lines for grub and not have the distros place their own lines in grub. I also don't really want one distro to have the role of creating the grub.conf file.

As everybody is advocating the scripts, there is no one mentioning about hand crafting one. I am fairly sure editing it by hand is safe, so long as I make sure no script touches it.

Another solution that I might be forced into is to configure every distro the same way (no kernels in menu, keep the custom config synced between distros), or just use one distro to manage the boot.

How should I implement this?

share|improve this question
up vote 2 down vote accepted

If you install it on your own (see here and, for example, here), no distribution's scripts will mess with it.

On the other hand, I found it convenient to let Debian manage my grub.cfg and add other OSes (if they're not found by os-prober) to /etc/grub.d/'s custom file.

share|improve this answer
Thanks, really helpful. I guess I needed to RTF[ine]M. My answer comes in "...those who feel that it would be easier to write grub.cfg directly are encouraged to do so, and to disable any system provided by their distribution to automatically run grub-mkconfig." – Portablejim Nov 18 '11 at 9:03

I use Arch linux and I chose to have one small hand-written /boot/grub/grub.cfg , removing executable bits on grub2 auxiliary scripts just in case.

But AFAIK other distros such as Ubuntu run grub2 config generation scripts automatically e.g. after kernel updates. So if you want to install grub2 using one of the distros' package manager, maybe you should read Gentoo and Debian documentation and see if they support manual config.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.