LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-28-2010, 09:46 AM   #1
dunraven23
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Rep: Reputation: 0
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.
 
Old 01-28-2010, 09:49 AM   #2
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
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
 
Old 01-28-2010, 10:34 AM   #3
dunraven23
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sohail0399 View Post
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?
 
Old 01-28-2010, 10:56 AM   #4
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
why did not you try for hd2?

in command "setup (hd0)".

but i dont know the response for hd2, so if you can try?
 
Old 01-28-2010, 11:04 AM   #5
dunraven23
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 01-28-2010, 11:29 AM   #6
dunraven23
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 01-28-2010, 11:45 AM   #7
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
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!
 
Old 01-28-2010, 12:23 PM   #8
dunraven23
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Original Poster
Rep: Reputation: 0
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?
 
Old 01-28-2010, 12:48 PM   #9
dunraven23
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
  


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
How to install grub manually ? tilman1 Linux - Software 4 03-20-2007 03:55 AM
Manually Installing Grub jan1024188 Fedora 3 08-16-2006 04:44 PM
Installing GRUB manually, is this going to be a challenge? rollo Linux - Newbie 3 03-01-2006 05:29 PM
installing grub manually abhinav_raj Linux - Software 3 03-22-2005 10:39 AM
install grub manually GoK Linux - Newbie 3 08-13-2003 08:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:09 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
Open Source Consulting | Domain Registration