Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 got a cool sound from linux defender or knoppix (or something else, I dont remember which one) that says "initiating start up sequence" And I want to use it as early as I can in the boot process. Having it say that when I login wouldnt make much sense, so having it play when GRUB starts would be best. Can it be done?

share|improve this question
It was knoppix. :) I only remember because it was my first Linux distro. – Azendale Nov 7 '11 at 4:00

According to the GRUB manual, the first note is a 'tempo', and each following pair of numbers are duration and pitch.

The pitch is in Hz, so in order to play nice-sounding notes (which are in tune), you'll need the frequencies of notes in the western equal temperament scale:

Incidentally, here's what I came up with after writing and using the Java code I pasted:

GRUB_INIT_TUNE="480 220 1 277 1 330 1 440 1 185 1 220 1 277 1 370 1 294 1 370 1 440 1 587 1 330 1 415 1 494 1 659 1"

This plays an 4-note arpeggio of A, F#m, D, E.

share|improve this answer
Works great! +1 – Wilf Jun 5 '14 at 17:52
The tempo is the number of beats per minute, so 60 means 1 beat every second, 120 means 2 beats every second, etc. And, the duration is measured in beats, so with a tempo of 60 and a duration of 2, the sound should last 2 seconds. – jpaugh Jul 15 at 0:02
That exactly matches what you'd expect, and I've verified it experimentally, as well as from the manual. – jpaugh Jul 15 at 0:06
  1. Edit file /etc/default/grub to include following line (Here is my init tune):

    GRUB_INIT_TUNE="2000 400 4 0 1 500 4 0 1 600 4 0 1 800 6"

  2. Run sudo update-grub2 to apply the change.

share|improve this answer

You ask, Can it be done? The simple answer? Yes, apparently. How can it be done? You need to put more money in the slot for that answer. Just my little joke. The best that I can do is this:

The GRUB manual

Go to section 5.1 Simple Configuration Handling and look for the line, GRUB_INIT_TUNE. You will need to follow the links to Play and File name syntax. You will have manually edit a Grub file.

share|improve this answer
Thanks for the link! (But, why not link directly to chapter 5? – jpaugh Jul 14 at 23:58

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.