Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Grub And 2 Drives - Need Help Asap...!, GRUB spoiled my boot from my Win98 drive
Yakoob
post Nov 25 2003, 07:51 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 25-November 03
Member No.: 1,868



I've got 2 drives:
80mb, devided into 2 partitions, Window98SE
40MB, Linux (redhat 7); removable drive (pocket)

So I installed the linux using the Anaconda installer and I was to select boot loader - I chose GRUB. I also specified that I don't want install linux on my Windows drive.
I found out that the GRUB MBR was installed in BOTH drives BUT the essential files for GRUB only on my linux drive! So if I remove my Linux HDD, GRUB will throw disk errors at me and not boot windows (kinda defeats the purpose of having a removable drive).

Other thing I don't understand:
When I boot my PC from the windows drive I get the nice GRUB splash screen and can choose linux or windows
When I boot my PC from the linux drive, I get the GRUB shell
Why is that?

Also, what can I do to "fix" my problem? There are two things I'd like to do:
1. Bring back the OLD configuration: Windows drive doesn't have GRUB just the default loader; Linux has GRUB;
-When I boot my PC w/o linux drive, windows loads instantly
-When I boot my PC w/ linux drive, GRUB loads and lets me choose linux/windows
2. Install full GRUB on both drives;
-When I boot my PC w/o linux drive, GRUB launches and lets me boot (only?) windows
-When I boot my pc w/ linux drive, GRUB launches and lets me boot linux or windows

How can I achieve one of the two? For the first option, I've heard I should use fdisk /mbr but I've also heard it's quite dangerous and might make my drive unbootable. About the latter option, I thought I could just invote GRUB shell and use the "setup" command to install GRUB on my windows drive... should it look like this:
setup hd(0,0)
???
And why when I boot from my linux drive I don't get the splash screen but the shell?

Help greaitly appriciated!
Go to the top of the page
 
+Quote Post
michaelk
post Nov 25 2003, 11:03 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



First of all need help ASAP, urgent for a subject etc is considered rude.

grub is a multi stage boot loader so its not completely contained in the MBR. When it can not find its config file grub.conf (or sometimes menu.lst) you get the shell prompt. In addition the menu contains a hard reference to the root partition located in the MBR. Moving drives around changes this reference so it will screw up the boot process. In addition there is the /etc/fstab which Redhat usually uses lables but there is some hard partition IDs used for swap. By booting different drives will change the partition ID and so linux will have difficulties booting.

fdisk /mbr will not damage the disk/

To bring back the MBR for just booting windows use fdisk /mbr


-When I boot my PC w/o linux drive, windows loads instantly
-When I boot my PC w/ linux drive, GRUB loads and lets me choose linux/windows

I don't know of anyway to implement your ideas with existing bootloaders.

If your computer's BIOS has the capability to select which hard drive to boot from you could install grub to the linux drive. Select this drive to boot 1st, the windows drive 2nd. This will give you the option to boot windows or linux when the linux drive is installed. When the linux drive is removed the BIOS will automatically boot the windows with no bootloader.

I don't know if not having the linux drive as the primary master what grub will determine as hd(0,0). You might have to add some statements in the grub.conf to map the drives. Also running linux without the windows drive will possibly screw up the /etc/fstab file when running with the windows drive.
Go to the top of the page
 
+Quote Post
Yakoob
post Nov 26 2003, 01:15 AM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 25-November 03
Member No.: 1,868



Sorry I didn't mean to sound rude sad.gif

thanks for the help and the answer you provided is exactly what I was talking about in option 1 (the one you quoted).

I've done it earlier because I always turned off my windows HDD before installing linux JUST IN CASE, this one time I didn't do that and GRUB "attacks" it aswell...

Btw, My windows drive is not removable and is Primary Slave while Linux is Secondary Master (so I guess windows is first here) and I have 2 partitions on my windows disk: c: and d:, windows is on d: in a windows.000 folder (not windows !)... is fdisk /mbr safe ? and should I remove my linux disk before doing it?

You mentioned that you get the shell if there is no config/list file, but I get shell when I but my pc from the linux drive and there is a /boot/grub folder (I have even modified the file a bit and it did work so I know it's the correct one) ..???
Also if you don't mind, how do I install grub on linux itself? do I have to d/l grub and install it in linux or can I use the existing grub to modify it?
just to let you know:
Windows drive: c -> /dev/hdb1 -------- hd(0,0) in grub
windows dirve : d -> /dev/hdb5
Linux drive: /dev/hdc1 --------- hd(1,0) in grub
Go to the top of the page
 
+Quote Post
michaelk
post Nov 26 2003, 12:53 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



fdisk /mbr is safe. No need to remove the linux drive. It will rewrite the first MBR it finds i.e. in your case hdb.

I don't know how grub works exactly but if you boot from the linux drive it recognizes the drive as hd(1,0) not hd(0,0) like it was first installed. You can reinstall grub using grub-install /dev/hdx. Check out the grub website for complete documentation.
Go to the top of the page
 
+Quote Post
cagey cretin
post Nov 26 2003, 01:52 PM
Post #5


./configure
***

Group: Members
Posts: 96
Joined: 9-September 03
Member No.: 1,413



I just used fdisk /mbr the other day for another reason, and returned the windows boot record nice and neatly. smile.gif
Go to the top of the page
 
+Quote Post
Yakoob
post Nov 26 2003, 02:34 PM
Post #6


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 25-November 03
Member No.: 1,868



Ok, thank all, I'll try that then...
and if it does make my disk unbootable.. you shalt pay !!!!!!!!!! wink.gif tongue.gif
Go to the top of the page
 
+Quote Post
hughesjr
post Nov 26 2003, 03:11 PM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Doing fdisk /mbr will fix your windows drive ... but then you won't be able to boot to linux unless you use a boot disk or can change the BIOS to boot to secondary master.

Now there is a really cool program on the Debian install CD called sbm.bin (it's called Smart Boot Manager). You can write it to floppy disk pick what Drive you want to boot from....I highly recommend it. I think you can also get it here:

http://btmgr.webframe.org/


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Yakoob
post Nov 27 2003, 03:02 AM
Post #8


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 25-November 03
Member No.: 1,868



Thanks!
Yeah I can change the boot sequence in my BIOS and I was thinking about exactly what you mentioned (sorry for not making it clear enough):
First it boots linux, then windows, so if linux is in, linux will boot and if it is not, windows will...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th October 2017 - 10:17 PM