3

This question was already asked once but it hasn't helped me in my trouble.

I have Ubuntu and Windows 7 on my laptop. Usually I use Windows 7 but GRUB always boots Ubuntu by default. My /ect/default/grub contains the following lines:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

I did run sudo update-grub after I changed the values for these variables. Also I made sure that my grubenv file existed and had right permissions (with save_env GRUB command).

And still... it doesn't work! GRUB alwas intends to load Ubuntu despite I choosed Windows last time.

What else do I lose sight of?

BTW, I don't have neither RAID nor LVM volumes (at least I don't have LVM manager installed).

  • It's not a duplicate. I gave the link to the question you have mentioned. And the answer doesn't solve my case. So it's rather an extension of the quetion. – krokoziabla Dec 22 '12 at 08:21

3 Answers3

2

My situation was similar. I had a custom grub entry (using a 40_custom file in /etc/grub.d) for a Chromium OS install. I had set GRUB_DEFAULT=saved and GRUB_SETDEFAULT=true, but it never saved the entry. Turned out that I needed to manually put a "savedefault" line into the 40_custom file in order for that entry to save the default. Works like a champ now.

Edit: If you put GRUB_SAVEDEFAULT=true, the savedefault line will be added automatically when you run update-grub

todpike
  • 21
1

You can use Grub Customizer for the work it's very simple, just check the box to remember last choice, install it with the commands:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
1

Press Alt+F2 type gksudo gedit /etc/default/grub press Enter and enter your password.

you will see this line GRUB_DEFAULT=0

You can change the default from 0 to any number, corresponding to the entry in the Grub bootup menu (first entry is 0, second is 1, etc.) so if windows 7 is the 4th entry enter the value to 4

Make your changes, press Ctrl-S to save and Ctrl-Q to exit.

Important: Open a terminal with Ctrl-Alt-T and type sudo update-grub to apply the changes you just made.

Mukund
  • 2,102
  • But I don't need Windows 7 always to boot. And I will not see GRUB_DEFAULT=0. As I have said, in my /etc/default/grub GRUB_DEFAULT=saved. – krokoziabla Dec 22 '12 at 08:18
  • Thank you for the link. Unfortunately it describes the steps I have performed already. Only one thing was new to me - GRUB_SETDEFAULT=true didn't work for LVM and RAID /boot partition. I checked whether lvm manager was installed on my Ubuntu - it wasn't. And also I don't have any RAID volumes on my laptop. – krokoziabla Dec 22 '12 at 13:22
  • It is important having /boot lvm based. check out this "[link][^2]".[^2]: http://askubuntu.com/questions/76095/what-is-the-use-of-boot-lvm-based-in-partitioning – Mukund Dec 24 '12 at 09:19