LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-05-2012, 09:19 PM   #1
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Rep: Reputation: Disabled
GRUB loader not choosing default OS


Hello. First of all, please let me explain my situation. I installed Ubuntu on my HP laptop and it works fine. I want to keep it on my laptop, but I also installed it on my main computer and I would perfer to keep it strictly a windows machine and removing Linux while keeping it on my laptop or other computer I choose.
I like Ubuntu, I installed the Gnome desktop though, but I don't want it taking up a patition on my drive. I don't have a Windows 7 install disk either being that I bought the computer with it all ready installed. I know there's no real good answer and I do work hard at studying for the answers to questions before bugging people. This is the site I've been studying from, I pretty much have the answer, but don't want to do anything to make the computer into a big heavy paper weight. Thanks.
 
Old 03-05-2012, 09:57 PM   #2
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,390
Blog Entries: 7

Rep: Reputation: 164Reputation: 164
OK here's what YOU need to do. Once typing a post, read through it again, and edit out all the unrelated crap. I'm not having a go at you, just giving you advice. I had to read your post twice and still am not clear. Are you having issues with grub? or do you want to remove your ubuntu partition off your desktop computer?
 
Old 03-05-2012, 10:15 PM   #3
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
All right then,

Quote:
Originally Posted by Knightron View Post
OK here's what YOU need to do. Once typing a post, read through it again, and edit out all the unrelated crap. I'm not having a go at you, just giving you advice. I had to read your post twice and still am not clear. Are you having issues with grub? or do you want to remove your ubuntu partition off your desktop computer?
Sorry for the confusion, I was just trying to add some detail to the problem at hand. Anyhow, ultimatly I would like to completely remove Ubuntu from my desktop or at least set it up so Win 7 in the default OS and loads automatically.
 
Old 03-05-2012, 11:18 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,869

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
To set windows as the default, you need to take a look at the grub.cfg file in the /boot/grub directory. Find your windows entry. Count the menuentry lines to your windows entry to determine which one it is.

Open the file /etc/default/grub with a text editor. Change this line in the file to use the windows menuentry: GRUB_DEFAULT=0

Grub counts here from zero so if your windows entry is the third entry in grub.cfg, put a 2 there.

If you are using the Ubuntu Grub to boot both Ubuntu and windows and delete your Ubuntu partition, you will be unable to boot anything as most of the Grub files are on the Ubuntu partition. You would then need to reinstall the windows bootloader into the master boot record and you will need a windows installation CD. Another option is to just shrink the Ubuntu partition if you don't plan to use it on that machine, depends on the size of your hard drive, how much space you have available.
 
Old 03-05-2012, 11:32 PM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
If you only have two distros installed and you want windows to load by default.

From ubuntu terminal
Code:
sudo nano /etc/default/grub

then look for "GRUB_DEFAULT=0"

then change the "0" to a "1"
Now hit Ctrl and o then enter.

Make sure the 'Save As" name reads "/etc/default/grub" then hit enter again.

Now hit Ctrl and x.

Now issue command
Code:
sudo update-grub
enter
then type "exit"
enter

Last edited by Larry Webb; 03-05-2012 at 11:35 PM.
 
Old 03-06-2012, 08:09 AM   #6
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you so much for the reply! I am making great strides in learning the CLI and the command structure so all this doesn't make my eye glaze over I understand what y'all mean. I do only have two distros Ubuntu and Win 7 but there's memtest and a couple other options in the boot list as well, and I'm assuming that I would have to count those when entering in the right boot count in grub.cfg. Like I mention in my other posts, I'm really getting the hang of how Linux works, it seemed daunting at first but then ,y brain started making all the connections to similar DOS commands and concepts. Thanks again for the reply.


Quote:
Originally Posted by Larry Webb View Post
If you only have two distros installed and you want windows to load by default.

From ubuntu terminal
Code:
sudo nano /etc/default/grub

then look for "GRUB_DEFAULT=0"

then change the "0" to a "1"
Now hit Ctrl and o then enter.

Make sure the 'Save As" name reads "/etc/default/grub" then hit enter again.

Now hit Ctrl and x.

Now issue command
Code:
sudo update-grub
enter
then type "exit"
enter
 
Old 03-06-2012, 08:14 AM   #7
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you! I submitted a reply mentioning how there's a few different items in the boot list such as memtest, etc. I'm going to go ahead and try to count down to #6 which I believe is the right entry and see what happens. I used the SUDO command yesterday to install the gnome desktop and although I'm not an expert, I feel comfortable knowing the general concept of what it does. Thanks again for help.



Quote:
Originally Posted by yancek View Post
To set windows as the default, you need to take a look at the grub.cfg file in the /boot/grub directory. Find your windows entry. Count the menuentry lines to your windows entry to determine which one it is.

Open the file /etc/default/grub with a text editor. Change this line in the file to use the windows menuentry: GRUB_DEFAULT=0

Grub counts here from zero so if your windows entry is the third entry in grub.cfg, put a 2 there.

If you are using the Ubuntu Grub to boot both Ubuntu and windows and delete your Ubuntu partition, you will be unable to boot anything as most of the Grub files are on the Ubuntu partition. You would then need to reinstall the windows bootloader into the master boot record and you will need a windows installation CD. Another option is to just shrink the Ubuntu partition if you don't plan to use it on that machine, depends on the size of your hard drive, how much space you have available.
 
Old 03-06-2012, 08:23 AM   #8
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
One more thing. I know this going off into another subject, but real quick, if I shrink the partition which sounds good, I'll have to re-size the master partition that windows is on? Or do I have to manual expand it by entering how large I want it. I try my best to study up on things like this but I've always been a little shaky on partition theory and have been too intimidated to mess around with them. Thanks



Quote:
Originally Posted by yancek View Post
Another option is to just shrink the Ubuntu partition if you don't plan to use it on that machine, depends on the size of your hard drive, how much space you have available.
 
Old 03-06-2012, 10:07 AM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,869

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Shrinking the Ubuntu partition may not be necessary. If you have a large drive (250GB or larger) and Ubuntu is on a 20GB partition, I wouldn't worry about it. If you have a small drive and feel you need the space, you would need to use the Ubuntu Live CD to shrink the partition. Are you planning to still use the Ubuntu Grub bootloader to boot both systems? If you are, you need to leave Ubuntu on because most of the Grub files needed are on the partition. You should be able to tell how much space is being used for Ubuntu in GParted so you don't shrink it too much. You should then be able to resize the windows partition with GParted or you should have some software in windows to do it.

With regard to setting windows as default, if it is the 6th menuentry item, you would put a 5 in the /etc/default/grub file on the line indicated in previous posts as Grub counts from ZERO.
 
Old 03-06-2012, 12:02 PM   #10
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Here is a great tutorial that I refer to that may help

grub2
 
Old 03-06-2012, 09:09 PM   #11
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks! That was the same page I started reading before posting. It seems pretty straight foward but I don't have a system image and if I did, I don't want to be over confident and make my machine unbootable, so I really do appreciate all the help you and the others members have given me. I have a real interest in learning Linux and this excerise was a good example of that.




Quote:
Originally Posted by Larry Webb View Post
Here is a great tutorial that I refer to that may help

grub2
 
Old 03-06-2012, 09:14 PM   #12
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
I have a 1.5T drive and Ubuntu is taking up 589G of it. I still have enough room in my windows partition at the moment so it's not real important to get this issue resolved. I was messing around with Linux on my laptop today and I went to install Kbuntu and what I thought was the Linux partition but it was the W7 evidently because when I choose W7 from GRUB it gave me some error and booted into the recovery module, then said it couldn't recover. I really didn't care, there really wasn't anything important on it anyhow, so now I'm trying to go in and just format the whole hard drive and all the partitions and try and install XP and leave a partiton for whatever Linux distro's I want to install.



Quote:
Originally Posted by yancek View Post
Shrinking the Ubuntu partition may not be necessary. If you have a large drive (250GB or larger) and Ubuntu is on a 20GB partition, I wouldn't worry about it. If you have a small drive and feel you need the space, you would need to use the Ubuntu Live CD to shrink the partition. Are you planning to still use the Ubuntu Grub bootloader to boot both systems? If you are, you need to leave Ubuntu on because most of the Grub files needed are on the partition. You should be able to tell how much space is being used for Ubuntu in GParted so you don't shrink it too much. You should then be able to resize the windows partition with GParted or you should have some software in windows to do it.

With regard to setting windows as default, if it is the 6th menuentry item, you would put a 5 in the /etc/default/grub file on the line indicated in previous posts as Grub counts from ZERO.
 
Old 03-08-2012, 03:45 PM   #13
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,390
Blog Entries: 7

Rep: Reputation: 164Reputation: 164
Formatting the whole hard drive will delete everything, including the the partitions still bootable. I recommend Gpart live cd for this. It'll be just a matter of booting it up, deleting eveything (formatting everything to what ever,(I always use fat32 as each install will format again to ext4 or what ever you deem appropriate), creating the partitions (empty) the sizes you want to dedicate to each individual partition. In your case Xp = x amount of space, Linux swap = Double your ram quantity, Linux = Remaining space. if you plan on having anything else on your huge hard drive, then you'll want to make other partitions prepared for them too.
Good luck
 
Old 03-08-2012, 04:03 PM   #14
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 369

Rep: Reputation: 18
Quote:
I want to keep it on my laptop, but I also installed it on my main computer and I would perfer to keep it strictly a windows machine and removing Linux while keeping it on my laptop or other computer I choose.
If you want to completely remove Linux, you can first use Windows' own partitition resizing tool. This is the safest option as it is native to the operating system. Then, you can install recovery console, I don't remember the exact name (bootrec /fixboot), and run bootrec that will restore the primary bootloader to do away with grub and anything that is Linux related.

The following link is about restoring Windows primary bootloader. Hopefully, that helps:
http://www.howtogeek.com/howto/32523...ader-problems/


Tip: I think, you should be able to back up your entire Windows installation as there are specific tools for this task. Even if you have no installation disk, you should be able to back up your entire Windows installation.

Last edited by edbarx; 03-08-2012 at 04:06 PM.
 
Old 03-08-2012, 05:27 PM   #15
Gomek
LQ Newbie
 
Registered: Mar 2012
Location: Florida
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hello. I want to thank everyone who's shared their mad knowledge with me. I'm not a novice but even the "advanced users" need a little help now and then. I ended accidently deleteing the Windows 7 partition from my laptop but I wasn't using windows on it much so no big lose. I installed open Suse which I really like. I am scared of partitions, I know man up, but there's so much that can go wrong, and I am actively studying up on the subject along with Linux in general and I feel more at home at the CLI. I can't really afford to play fast and loose on this machine like I did my laptop. I will work on this and keep y'all's advice in mind when I go about making the changes I need. Thank you again!



Quote:
Originally Posted by edbarx View Post
If you want to completely remove Linux, you can first use Windows' own partitition resizing tool. This is the safest option as it is native to the operating system. Then, you can install recovery console, I don't remember the exact name (bootrec /fixboot), and run bootrec that will restore the primary bootloader to do away with grub and anything that is Linux related.

The following link is about restoring Windows primary bootloader. Hopefully, that helps:
http://www.howtogeek.com/howto/32523...ader-problems/


Tip: I think, you should be able to back up your entire Windows installation as there are specific tools for this task. Even if you have no installation disk, you should be able to back up your entire Windows installation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing GRUB Loader to Have WINXP As Default OS firekid1239 Linux - Newbie 3 09-18-2008 11:00 AM
How to change my Grub Loader to Lilo loader in REDHAT LINUX 9.0 skumar.v Linux - Newbie 3 04-04-2008 11:38 AM
choosing default application painless Linux - Newbie 3 10-02-2006 11:07 AM
Grub Loader Default Kernel dr_who Linux - General 1 09-01-2003 09:51 PM
Making GRUB default loader again TheOneAndOnlySM Linux - Newbie 3 07-19-2003 12:47 AM


All times are GMT -5. The time now is 12:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration