LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-21-2009, 10:06 AM   #1
caosxxi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
Lightbulb Installing GRUB in another disk problem, GRUB Hangs in boot


The scenario is this:

I have two SATA disks, first disk (160GB) contains linux and windoze and second (250 GB) is empty.

Disk one is partitioned:
/dev/sda1 Windoze in NTFS
/dev/sda2 /root in ext3
/dev/sda5 /home in ext3
/dev/sda6 SWAP

Because i do install windoze after linux i lost my GRUB loader on MBR.
I tried to recover it using a Ubuntu Alternate CD, running the instaled system on sda2 and executing:

Code:
$grub-install /dev/sda1
it doesn't work and damaged my NTFS partition. I do recover it copying PBR of another disk into sda1, and works fine!

Because i have another Disk i tried to install GRUB in it and BOOT from there, using the same procedure described above.

Code:
$grub-install /dev/sdb1
I tried many times, changing the Filesystem of sdb1, setting the boot flag using FDISK and doesn't work.

At boot shows the word GRUB and hangs.

Thanks, Appreciate any help.
 
Old 08-21-2009, 12:14 PM   #2
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
Oh, yea...
Yes, sda1 partition is damaged by installing group there.
Install Windoze new and then install group allway in the boot block of a disc with
Code:
$grub-install /dev/sda
The BIOS don't know nothing about filesystems but only about how to access drives. So only the first bytes of a disk (track 0, bootblock) is accessible to the BIOS. That means that group has to install itself in the first bytes of the disk /dev/sda and not to the first bytes of a partition (/dev/sda1). A partition (sda1) can start everywhere on a disk the BIOS can't guess.
 
Old 08-22-2009, 11:38 AM   #3
caosxxi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bastl View Post
Oh, yea...

The BIOS don't know nothing about filesystems but only about how to access drives. So only the first bytes of a disk (track 0, bootblock) is accessible to the BIOS. That means that group has to install itself in the first bytes of the disk /dev/sda and not to the first bytes of a partition (/dev/sda1). A partition (sda1) can start everywhere on a disk the BIOS can't guess.
Of course i see what i doing wrong, thanks for advice.

I will try and post if works, thanks again.
 
Old 08-24-2009, 12:10 PM   #4
caosxxi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
It works.
But i did install GRUB in /dev/sdb and windoze not boot.
Actually in /dev/sdb i have one partition in NTFS without Operating System.
I do add this entry for menu.lst
Code:
title      Windoze
root      (hd0,0)
savedefault
makeactive
chainloader   +1
When i load windoze this message appears:
Code:
NTLDR missing - Press alt+ctrl+delete to restart.
It's strange because NTLDR exists in (hd0,0)

I suppose this problem is related to windoze, i'll do post in General Forum.

Seems windoze doesnt like to boot first in a disk without windoze OS files and redirecting to another disk in order to boot.
 
Old 08-25-2009, 11:38 AM   #5
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
Quote:
Originally Posted by caosxxi View Post
It works.
But i did install GRUB in /dev/sdb and windoze not boot.
Actually in /dev/sdb i have one partition in NTFS without Operating System.
I do add this entry for menu.lst
Code:
title      Windoze
root      (hd0,0)
savedefault
makeactive
chainloader   +1
That entry seams not to be correct but read http://en.wikipedia.org/wiki/NTLDR maybe it can help you.
Make sure you followed this steps.
1- install windoze on a drive
2- install other OPs
3- make sure you use grub-0.97
4- setup grubs menu file
5- grub install
6- make sure that the disk grub is installed on is the first boot device in the BIOS settings.
and all should work fine!
 
Old 08-26-2009, 09:17 AM   #6
caosxxi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bastl View Post
That entry seams not to be correct but read http://en.wikipedia.org/wiki/NTLDR maybe it can help you.
Make sure you followed this steps.
1- install windoze on a drive
2- install other OPs
3- make sure you use grub-0.97
4- setup grubs menu file
5- grub install
6- make sure that the disk grub is installed on is the first boot device in the BIOS settings.
and all should work fine!
The problem here is that i need to change in my BIOS settings the primary hard disk in order to boot a OS.

For example, to boot Windoze XP i need to set my first hard disk to first boot device and then boot and windoze works "fine" (boots indeed)

To boot linux i need to set my second hard disk to first boot device, at this stage GRUB menu runs ok, when i choose windows to boot doesn't works and says NTLDR missing, if i choose linux it boots fine.

I want to boot both OS's from GRUB installed in second hard disk without setting BIOS.

Excuse me, for me is hard to write in english (obviously not my primary language), Thanks!!!
 
Old 08-26-2009, 12:09 PM   #7
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
Quote:
Originally Posted by caosxxi View Post
I want to boot both OS's from GRUB installed in second hard disk without setting BIOS.
Yes, what you want to do should work.
the root device for windows should be (hd0) and the root device for linux - you know, I guess - should be then (hd0,1)
(hd0) for windows, because windows has a boot loader too, installed on sda (hd0) and not sda1 (hd0,0). sda1 is not directly bootable like I described it and grub dosn't know how to load windows but windows bootloader knows it, so you have to start, it. It's the same like with the BIOS and partitions.
If that is not the mistake, I would have to study the grub manual, too, at http://www.gnu.org/software/grub/manual/.
 
Old 08-26-2009, 01:55 PM   #8
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 windows is the first boot drive and linux on the second drive and both are in the first partition. Install grub

grub>
root (hd1,0)
setup (hd0)
exit

Add this to your linux menu.lst

menu.lst
title Windows
root (hd0,0)
chainloader +1
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
grub problem with 2 hard disk with boot loaders. (linux & windows 2000) vbsoftware General 3 01-04-2005 08:01 PM
Creating Boot loader disks rather then installing GRUB to hard disk?? barry237 Fedora 1 06-19-2004 10:52 AM
RedHat 9 Hangs during boot - Problem with Grub gavp1979 Linux - General 0 06-03-2004 03:35 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:42 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