Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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
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.
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.
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.
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.
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.
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????
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):
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.
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.