LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Installing GRUB in another disk problem, GRUB Hangs in boot (https://www.linuxquestions.org/questions/linux-general-1/installing-grub-in-another-disk-problem-grub-hangs-in-boot-749312/)

caosxxi 08-21-2009 10:06 AM

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.

bastl 08-21-2009 12:14 PM

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.

caosxxi 08-22-2009 11:38 AM

Quote:

Originally Posted by bastl (Post 3652641)
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.

caosxxi 08-24-2009 12:10 PM

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.

bastl 08-25-2009 11:38 AM

Quote:

Originally Posted by caosxxi (Post 3655722)
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!

caosxxi 08-26-2009 09:17 AM

Quote:

Originally Posted by bastl (Post 3656990)
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!!!

bastl 08-26-2009 12:09 PM

Quote:

Originally Posted by caosxxi (Post 3658295)
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/.

Larry Webb 08-26-2009 01:55 PM

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


All times are GMT -5. The time now is 09:53 PM.