Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

to speed up my boot time, I would like to get rid of the grub timing, but I would like to still be able to choose between different OS. Is there a way to do so? I was thinking to tweak something so the power button boot in one OS, the reset button boot in the other OS (and I do not have any reset button anymore)

Anybody see a possibility to do that?


share|improve this question
For the tweak what you could do is install Grub on two USB keys, one that boot by default on one OS, the other key boot by default on the other OS. And whenether you want to load into one OS you plug the right USB key. I don't know if that would work but it could be a way to do what you want. – Nyamiou The Galeanthrope Oct 17 '11 at 3:01
the USB stick solution is just less practical than the boot with a grub menu, and not faster, that is not a solution. – Memes Dec 29 '14 at 8:27

4 Answers 4

up vote 13 down vote accepted

Yes you can. the timing and other attributes can be edited in the file /etc/default/grub.

Just do the following:

  1. sudo nano /etc/default/grub

  2. Change GRUB_TIMEOUT=10 to GRUB_TIMEOUT=0 for fastest loading without waiting for the Grub menu to appear. Now the thing is, if you want to see the menu again, when the pc is starting press ESC like crazy until the Menu appears. The Grub menu will always appear when you press ESC, does not matter if the time is at 0.

  3. After changing the timeout, save it with the command Ctrl+O and you'll be asked for the file name to be saved. Just hit enter which will replace the grub. You can exit the editor by pressing Ctrl+X

  4. Update grub by running (you guessed it): sudo update-grub so the changes can be active after the next boot up.

For the customized power and reset buttons for what I know is not possible "yet" to assign it to the Grub Menu.

share|improve this answer
ages after, I mark your answer as accepted, that is the closest it can get. – Memes Dec 29 '14 at 8:26
@Memes haha. I needed a good laugh today. Thanks friend. – Luis Alvarado Dec 29 '14 at 22:58
shouldn't you use a timeout of 1 second instead of 0? otherwise, the menu would be gone completely woudn't it? – rubo77 Jan 19 at 14:05
@rubo77 You can still access the menu by leaving SHIFT pressed or ESC (Don't remember which right now). Or tapping at one of those. – Luis Alvarado Jan 19 at 23:00
One more comment here, now, my boot time is not an issue anymore (boot with newer hardware and SSD), I then came back to a timing of 5 seconds and install Burg to get a clean neat OS selection screen. – Memes Aug 5 at 7:00

and edit /etc/grub.d/40_custom/, append

if keystatus -s ; then


 config grub-mkconfig -o /boot/grub/grub.cfg
share|improve this answer
if keystatus -s ; then timeout=10 else boot

Note: Make sure to put that fi, on its own line(like above), under the rest; before issuing the commands below:

sudo config grub-mkconfig -o /boot/grub/grub.cfg

and sudo update-grub (...can't hurt)

Make sure you get no errors.

It works; when I hold down Left, or Right shift; before leaving my computers (an HP desktop) BIOS post screen. So, is the first thing GRUB2 "sees".

There are still reports of some computers not working. I'd try this. Best wishes.

FYI: I'm on Debian 7 (Wheezy, and with my added Mate, only.) I have LightDM installed, and text configured to autologin. After post, and before this GRUB2 start, I'm 33 seconds to my Mate desktop; without further optimizing.

Thank you.

share|improve this answer
although the solution seems elegant, the explanation is not complete (where do I write the if statement?) – Memes Dec 29 '14 at 8:28

If you want to script this, you can use this to edit the file /etc/default/grub from the script:

# Speed-up Grub boot, but always show the boot menu.
sudo sed -i 's/GRUB_TIMEOUT=[[:digit:]]\+/GRUB_TIMEOUT=1/g' /etc/default/grub
sudo sed -i 's/GRUB_HIDDEN_TIMEOUT/#GRUB_HIDDEN_TIMEOUT/g' /etc/default/grub
sudo update-grub

This will set the grub menu countdown to 1 second

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.