8 Ekim 2012 Pazartesi

How to Boot Last Used Boot Entry in Ubuntu & Windows Dual-boot?

Every time I installed Linux in my machine, I want to set Windows as default boot entry in the GRUB. So, I have not to wait GRUB screen to boot Windows and I have to wait only when I want to boot Ubuntu.

While searching how to do it, yesterday I came up to an askubuntu.com answer explaining a very useful tip about the subject. Do you want to boot Ubuntu as default at every boot time until selecting Windows manually; and then boot Windows as default until selecting Ubuntu deliberately?

Manual Way

This tip explains very simple steps to make GRUB boot last saved (last used) boot entry:

1. Open /etc/default/grub file to modify:
sudo vi /etc/default/grub

2. Change GRUB_DEFAULT value to 'saved'
GRUB_DEFAULT=saved

3. Add a new variable GRUB_SAVEDEFAULT:
GRUB_SAVEDEFAULT=true

4. Update GRUB configuration to reflect these changes:
sudo update-grub

Now, GRUB loader will boot last used entry as default until you select another entry.

Automatic Way


Here is a simple script to do this for you in one-click (gist here):

filename=/etc/default/grub

# Replace GRUB_DEFAULT value to 'saved'
echo :: Setting GRUB_DEFAULT=saved
sudo sed -i 's/GRUB_DEFAULT=.*/GRUB_DEFAULT=saved/g' $filename

# Append GRUB_SAVEDEFAULT=true after deleting old GRUB_SAVEDEFAULT's
echo :: Setting GRUB_SAVEDEFAULT=true
sudo sed -i '/GRUB_SAVEDEFAULT=.*/d' $filename
sudo sed -i '$aGRUB_SAVEDEFAULT=true' $filename

# Update config
echo :: Calling update-grub
sudo update-grub

Hiç yorum yok:

WSO2 ESB + ClientAccesPolicy.xml + CrossDomain.xml

ClientAccesPolicy.xml and CrossDomain.xml files have to be found at root of your services Silverlight and Flex clients to be able to acce...