LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-26-2012, 11:12 AM   #1
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Rep: Reputation: Disabled
Change default GRUB


I installed OpenSUSE 12.2. Then I installed Ubuntu 12.04.1.

Now my computer boots from GRUB installed in the root filesystem of Ubuntu. But I want the GRUB installed in the root file system of Suse to work as the default bootloader. How can I do that?

Thanx for any help...
 
Old 10-26-2012, 11:29 AM   #2
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,071

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
Before you get specific instructions, we would need to know which drive/partition the Opensuse boot files are on. If you can boot Opensuse from Ubuntu, do that. If your Opensuse boot files are on partition sda1, the following would work from Opensuse. If the boot files are on a different partition, you will need to make the appropriate change. Open a terminal in Opensuse, as root user in Opensuse enter: grub. This should give you a grub prompt (grub>). Here you would enter: root (hd0,0) and hit the Enter key. Then type: setup (hd0) and hit the Enter key. Then type: quit and again hit the Enter key. You would need to create an entry for Ubuntu in the Opensuse menu.lst file. The following example should boot Ubuntu on sda5:

Quote:
title Ubuntu-11.04
root (hd0,4)
kernel /boot/grub/core.img
#savedefault
##boot
If you are not comfortable with this, log in as root in either Opensuse or Ubuntu and post the output of the command run as root: fdisk -l
Lower case Letter L in the command) or go to the site below and read the instructions for the bootinfoscript, download and run it and view the output. If you don't understand the output, post the results.txt file here.

http://sourceforge.net/projects/bootinfoscript/
 
Old 10-26-2012, 11:35 AM   #3
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Before you get specific instructions, we would need to know which drive/partition the Opensuse boot files are on. If you can boot Opensuse from Ubuntu, do that. If your Opensuse boot files are on partition sda1, the following would work from Opensuse. If the boot files are on a different partition, you will need to make the appropriate change. Open a terminal in Opensuse, as root user in Opensuse enter: grub. This should give you a grub prompt (grub>). Here you would enter: root (hd0,0) and hit the Enter key. Then type: setup (hd0) and hit the Enter key. Then type: quit and again hit the Enter key. You would need to create an entry for Ubuntu in the Opensuse menu.lst file. The following example should boot Ubuntu on sda5:



If you are not comfortable with this, log in as root in either Opensuse or Ubuntu and post the output of the command run as root: fdisk -l
Lower case Letter L in the command) or go to the site below and read the instructions for the bootinfoscript, download and run it and view the output. If you don't understand the output, post the results.txt file here.

http://sourceforge.net/projects/bootinfoscript/
I ran fdisk -l and got the following output:

Code:
 su
fdisk -l 

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6e21e828

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4208639     2103296   82  Linux swap
/dev/sda2   *     4208640    35663871    15727616   83  Linux
/dev/sda3        46153728    62926847     8386560   83  Linux
/dev/sda4        62928894   312580095   124825601    5  Extended
/dev/sda5        62928896   104874609    20972857   83  Linux
I have got OpenSUSE and Ubuntu installed in separate partitions. Should I do the following?:

Quote:
Originally Posted by yancek View Post
Open a terminal in Opensuse, as root user in Opensuse enter: grub. This should give you a grub prompt (grub>). Here you would enter: root (hd0,0) and hit the Enter key. Then type: setup (hd0) and hit the Enter key. Then type: quit and again hit the Enter key. You would need to create an entry for Ubuntu in the Opensuse menu.lst file.
Thanx a lot!!!
 
Old 10-26-2012, 04:01 PM   #4
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,071

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
You need to determine which partition Opensuse is on. Have you used only one partition for the filesystem? Did you create a separate boot partition for it or Ubuntu? Open a terminal from within Opensuse and run the command: df -H. You should get output similar to below:

Quote:
df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda8 42G 34G 6.5G 84% /
The example above shows the operating system root (/) filesystem on sda8. Determine which your Opensuse is on before running the commands above.
 
Old 10-28-2012, 01:54 AM   #5
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Sorry for my late reply. Here's the output of the command df -H:

Code:
Filesystem      Size  Used Avail Use% Mounted on
rootfs           16G  6.1G  9.1G  41% /
devtmpfs        513M   37k  513M   1% /dev
tmpfs           522M   91k  522M   1% /dev/shm
tmpfs           522M  738k  521M   1% /run
/dev/sda2        16G  6.1G  9.1G  41% /
tmpfs           522M     0  522M   0% /sys/fs/cgroup
tmpfs           522M  738k  521M   1% /var/lock
tmpfs           522M  738k  521M   1% /var/run
tmpfs           522M     0  522M   0% /media
/dev/sda3       8.5G  4.8G  3.7G  57% /home
So I think my Suse root is in /dev/sda2, and I am sure about it since GParted tells me the same.

So, what command should I use now???

Thanx again!!!

Last edited by americast; 10-28-2012 at 01:55 AM.
 
Old 10-30-2012, 07:22 PM   #6
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,071

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
If you ran the df -H command from Opensuse then sda2 should be the root partition. You did run this from Opensuse, correct? The entry below should work if you change the root line to below to point to sda2 which would be (hd0,1) in Grub:

Quote:
title Opensuse
root (hd0,1)
kernel /boot/grub/core.img
#savedefault
##boot
The bottom two lines in the entry have hash marks in front of them which means they will not be read. On some systems I have used, the hash marks (#) need to be removed and on others it doesn't matter.
 
Old 10-31-2012, 08:42 AM   #7
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
If you ran the df -H command from Opensuse then sda2 should be the root partition. You did run this from Opensuse, correct? The entry below should work if you change the root line to below to point to sda2 which would be (hd0,1) in Grub:



The bottom two lines in the entry have hash marks in front of them which means they will not be read. On some systems I have used, the hash marks (#) need to be removed and on others it doesn't matter.
So, should I run the commands you gave in Suse?

Thanx...
 
Old 10-31-2012, 10:33 AM   #8
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,071

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
Quote:
So, should I run the commands you gave in Suse?
Actually, I am not sure if the most recent version of Opensuse still uses Grub Legacy by default. If it does then these commands will work. You can determine if Grub Legacy is being used by going to the /boot/grub directory in Opensuse and looking to see if you have a menu.lst file. If so, you have Grub Legacy and can use these commands. You would first need to open a terminal as root user type grub to get the grub prompt and run these consecutively:

root (hd0,1)
setup (hd0)
quit

Hit the enter key after each line. Also, ignore the entry in my last post. After you get the Opensuse Grub booting, you will need an entry in the Opensuse menu.lst similar to below for Ubuntu. I don't know which partition Ubuntu is on. If you don't, you can boot Ubuntu and run the df -H command from Ubuntu to find out. Then put an entry such as the one below in the Opensuse /boot/grub/menu.lst file.

Quote:
title Ubuntu 12.4
root (hd0,4)
kernel /boot/grub/core.img
#savedefault
##boot
In the above entry, it points to sda5 (hd0,4) and you will need to change that to the Ubuntu partition number, whatever that is.

Last edited by yancek; 10-31-2012 at 10:59 AM.
 
Old 11-01-2012, 08:19 AM   #9
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Actually, I am not sure if the most recent version of Opensuse still uses Grub Legacy by default. If it does then these commands will work. You can determine if Grub Legacy is being used by going to the /boot/grub directory in Opensuse and looking to see if you have a menu.lst file. If so, you have Grub Legacy and can use these commands. You would first need to open a terminal as root user type grub to get the grub prompt and run these consecutively:

root (hd0,1)
setup (hd0)
quit

Hit the enter key after each line. Also, ignore the entry in my last post. After you get the Opensuse Grub booting, you will need an entry in the Opensuse menu.lst similar to below for Ubuntu. I don't know which partition Ubuntu is on. If you don't, you can boot Ubuntu and run the df -H command from Ubuntu to find out. Then put an entry such as the one below in the Opensuse /boot/grub/menu.lst file.



In the above entry, it points to sda5 (hd0,4) and you will need to change that to the Ubuntu partition number, whatever that is.
No, I don't have menu.lst in in /boot/grub ! WHat to do now????

Thanx for going on helping me...
 
Old 11-01-2012, 08:50 AM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,619
Blog Entries: 2

Rep: Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076Reputation: 4076
This is most likely Grub2, not Grub legacy, so there is no menu.lst and the advices given to you by yancek will not work.
Actually it is as easy as this:
1. Start your openSuse system.
2. Open a terminal and launch these commands as root (I don't know if Suse uses sudo or su):
Code:
grub-install /dev/sda
update-grub
Now Suse's Grub should be in control again.
 
Old 11-03-2012, 12:40 AM   #11
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
This is most likely Grub2, not Grub legacy, so there is no menu.lst and the advices given to you by yancek will not work.
Actually it is as easy as this:
1. Start your openSuse system.
2. Open a terminal and launch these commands as root (I don't know if Suse uses sudo or su):
Code:
grub-install /dev/sda
update-grub
Now Suse's Grub should be in control again.
I am getting this error:
Code:
su - 
grub-install /dev/sda

WARNING! You are trying to invoke the unsupported grub-install script
with a parameter. To really do this, call grub-install.unsupported.
You should rather call "yast2 bootloader" or create configuration files
appropriate for the intended target.
 
Old 11-03-2012, 06:16 PM   #12
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,071

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
Apparently, the best way to do this with Opensuse is to use YaST. Take a look at the Opensuse site at the link below and scroll down to Section 10.3 which has details and you can select which Grub as well as the location. Select boot from Master boot record. You might also just check the Boot Loader Options tab to see what is there:

http://doc.opensuse.org/documentatio...nce/grub2.html

You should be able to access YaST from the Menu tab in the lower left of the Desktop, or by entering it in a terminal as root user.

Last edited by yancek; 11-03-2012 at 06:17 PM.
 
Old 11-04-2012, 03:38 AM   #13
americast
Member
 
Registered: May 2012
Location: Kolkata, India
Distribution: Ubuntu, OpenSUSE
Posts: 76
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Nope. Didnt help... I checked Master Boot Record but still, the Ubuntu grub appears at start-up...

Anyway, thanx!!!
 
  


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
change grub boot order, all instructions say change default, but I don't see default mhg Linux - Newbie 5 11-09-2008 11:01 AM
grub not seeing grub-set-default change bic Linux - Software 4 02-15-2008 02:44 PM
How can I change default OS on grub system? Sifonelle Linux - Newbie 15 01-19-2008 12:54 PM
Change Default Boot from GRUB lel800 Red Hat 14 08-25-2004 02:32 AM
how to change default os in Grub eye Linux - Software 3 05-16-2003 09:10 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration