Tuesday, November 12, 2013

How to make Windows OS (or any OS) as default OS in GRUB 2 ?

After a long pause, I am back with a useful post for you. If you like to use any Linux distribution which installs Grub 2 in your system and you want to make Windows or any other OS as default in Grub so that if you don't press any key in Grub your PC will get selected OS loaded than you are in right blog. Not only Linux distribution installs Grub; you can manually install grub in your system.

Use this scenario according to your need:

I have pre-installed Windows OS in my laptop ( laptop version is not important). Now, I installed Ubuntu also side by side(creating new partitions). But, I rarely use Ubuntu and the problem is when I start laptop my system asks me to select OS to boot and if don't respond it automatically boots Ubuntu which is in the top of my menu. I want to Windows OS to be loaded instead of Ubuntu when I don't respond (select the OS) i.e. change my default OS to Windows OS from Ubuntu.
My GRUB Menu; windows OS is in 5th position here

Solution:

(Before starting the solution please note: How many option are provided in the Grub menu (OS selection menu) when you are booting? The number of line in which your desired OS lies.)
  1. Boot your PC/Laptop/Desktop/Computer and load Ubuntu (or any Linux distribution)
  2. Open Terminal (ctrl + alt + t  => in Ubuntu; if your system is shell or command prompt i.e. not a GUI than got to step 3)
  3. Type commands: sudo gedit /etc/default/grub/
  4. It may ask you to enter your password.
  5. Gedit, notepad like text editior, will open.
  6. Find the line with: GRUB_DEFAULT=0             (This line holds the information of which OS to be loaded as default)
  7. Now, change the number 0 to the number (in my case its 4 for my Windows OS) (get the line number of your desired OS and subtract 1 in it) : Suppose your OS list in Grub as a List and its initial value position will start from 0 i.e. the OS on the top of menu has position value 0 so it loads as default OS previously)
  8. Save it and close
  9. Again, type command: sudo update-grub
  10. Now, reboot your system, you get desired OS loaded as default.
Thank You! For reading this post.
If any doubts, you are free to ask in comments.

Like, Comment and Share:
Don't forget to View my facebook page: https://facebook.com/fookash



No comments:

Post a Comment