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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
01-28-2010, 09:46 AM
|
#1
|
LQ Newbie
Registered: Jan 2010
Posts: 14
Rep:
|
Manually installing Grub
I installed OpenSUSE to an external USB HDD but had severe problems with Grub failing to boot Windows 7, although it booted the Linux OK. In the end I had to replace the Grub mbr code in the Ext HDD with W7 mbr code. So I now have a system with functioning W7 on my internal drive and a working install of OpenSUSE 11.2 on my external USB HDD that I can't currently boot.
Will it be possible to manually install Grub using grub-install to boot both the Windows and Linux distro?
My configuration is:
sda Internal 160 GB HDD all NTFS
sda1 Hidden OS reinstall 10GB
sda2 Windows 7 70GB (Active Partition, Bootable)
sda3 Data 70GB
sda4 Hidden Utils 5GB
sdb is a 64 GB USB Stick
sdc External USB HDD 500 GB
sdc1 /Root Ext4 12 GB
sdc2 /Home Ext4 10 GB
sdc3 NTFS 460 GB
sdc4 swap 5GB
I'd appreciate any help on how to write a suitable version of grub-install to place Grub in sda2 and call W7 from there and OpenSUSE from sdc1.
|
|
|
01-28-2010, 09:49 AM
|
#2
|
Member
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154
Rep:
|
yes there is issues with dual boot but solution is also possible.
Boot into the live linux cd.
When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)
Code:
sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands
Code:
find /boot/grub/stage1
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)
Code:
root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)
Next enter the command to install grub to the mbr
Code:
setup (hd0)
Finally exit the grub shell
Code:
quit
|
|
|
01-28-2010, 10:34 AM
|
#3
|
LQ Newbie
Registered: Jan 2010
Posts: 14
Original Poster
Rep:
|
Quote:
Originally Posted by sohail0399
yes there is issues with dual boot but solution is also possible.
Boot into the live linux cd.
When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)
Code:
sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands
Code:
find /boot/grub/stage1
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)
Code:
root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)
Next enter the command to install grub to the mbr
Code:
setup (hd0)
Finally exit the grub shell
Code:
quit
|
I followed that exactly.
The find /boot.grub/stage1 command returned
hd2,0
I used that to go
root (hd2,0)
and then
setup (hd0).
On rebooting I was presented with all the correct choices by a Grub screen and Windows 7 boots correctly when selected. However when I select OpenSUSE I simply get the message:
Error 15 File not found.
What do I do to make OpenSUSE boot correctly?
|
|
|
01-28-2010, 10:56 AM
|
#4
|
Member
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154
Rep:
|
why did not you try for hd2?
in command "setup (hd0)".
but i dont know the response for hd2, so if you can try?
|
|
|
01-28-2010, 11:04 AM
|
#5
|
LQ Newbie
Registered: Jan 2010
Posts: 14
Original Poster
Rep:
|
I'll try setup (hd2) if it will allow me to change from hd0! I checked the kernel in /boot and that was the same as used by Grub so that doesn't appear to be the problem. I will post in a few minutes.
|
|
|
01-28-2010, 11:29 AM
|
#6
|
LQ Newbie
Registered: Jan 2010
Posts: 14
Original Poster
Rep:
|
I've tried setup (hd2) in the above procedure and I still get the same error 15 file not found.
However I also noted that before the Grub menu appears I get another error saying hd1,0 /boot message missing.
W7 still boots OK.
|
|
|
01-28-2010, 11:45 AM
|
#7
|
Member
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154
Rep:
|
this is good that you give feedback
ok! do for hd0 and try this at prompt
grub>
If you installed a /boot partition, do
Code:
find /grub/stage1
If you did not do a /boot partition [most likely choice] do
Code:
find /boot/grub/stage1
One of these commands will give you an answer like
Code:
root (hd0.0)
Now press Esc.
Select the first boot option and press "e"
Press "e" again on the root option
Change the hd(X,X) to whatever you got above. for me it was hd (0,0).
Press Enter.
Now press "b"
linux should load up.
Now that you are in, you need to change this for good.
Open a terminal and enter
Code:
sudo gedit /boot/grub/menu.lst
or, depending on your setup
Code:
sudo gedit /grub/menu.lst
Scroll down towards the bottom of the file, and you will find the same "root (hdX,X)" change it appropriately, and you can save!
|
|
|
01-28-2010, 12:23 PM
|
#8
|
LQ Newbie
Registered: Jan 2010
Posts: 14
Original Poster
Rep:
|
Fine, I have changed the boot to hd2,0 in the Grub menu and then booted OpenSUSE. That worked. I would now like to amend menu.lst but gedit isn't available in my KDE version of OpenSUSE and when I download as zypper gedit the resulting gedit won't open menu.lst even though I try from a sudo su console in Terminal. It reports Gtk Warning cannot display. Can I use another in place of gedit?
|
|
|
01-28-2010, 12:48 PM
|
#9
|
LQ Newbie
Registered: Jan 2010
Posts: 14
Original Poster
Rep:
|
I used VIM to edit menu.lst. Not the easiest to understand but it worked. I now have OpenSUSE booting correctly.
Many thanks for your help.
|
|
|
All times are GMT -5. The time now is 07:09 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|