LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 08-27-2007, 02:09 PM   #1
Fezar
LQ Newbie
 
Registered: Nov 2005
Distribution: OpenSuSE 10.2
Posts: 28

Rep: Reputation: Disabled
Booting grub from secondary hard disk ?


Hi all, just bought a new PC with two HDD, one SATA, the other ATA. The ATA drive is the slave and has OpenSUSE 10.3 (Beta) installed, GRUB is also installed here. The master (SATA) has windwos XP installed nothing else.

What I wanted to do was when the family want to use the computer, they would just need to turn it on and windows would boot, no GRUB or any other kind of bootloader, and if I wanted to load linux I would select the boot menu and choose to boot from the disk with linux and grub installed. So after the install I deleted grub and applied fixmbr to the windows MBR to get it back to a "silent" boot, and installed grub on the secondary linux HDD. But when I tell the bios to boot from the secondary drive, nothing happens like it can't find a MBR and then boots windows on my first disk, with no error messages, like its doing what I told it to.

Just realised:The primary master is the DVD drive, and the slave is the ATA HDD. The SATA HDD is listed separately in the BIOS (obviously! The IDE connector would have to be share between the DVD and secondary HDD, cos there is only one IDE connector on this mobo, the SATA drive would be elsewhere, I guess this confuses things?)

So I make a linux bootdisk and used a "configfile (hd1,0)" entry to boot to secondary HDD and it shows the grub boot menu, with options to boot OpenSUSE 10.3, so I know grub is installed on the MBR of the secondary disk. So why doesn't it boot when I ask it to?


Any ideas? I am absolutely clueless!

Thanks for your help and patience in advance

Tom

[EDIT]Just booted with UBCD "Boot second hard disk" and booted just FINE. For those of you that use this, the code it uses is this:
Quote:
#
# Boot from second hard disk
#
hddboot81:
if bootCheck[0x81]; then boot 0x81
clear
set textColor = color[brightred on black]
print "\n"
print "\acDrive is not bootable\n"
wait 0
Does that help?
[EDIT]

Last edited by Fezar; 08-27-2007 at 03:37 PM.
 
Old 08-27-2007, 07:56 PM   #2
FXEF
LQ Newbie
 
Registered: Jan 2004
Distribution: Ubuntu
Posts: 8

Rep: Reputation: 0
Smart Boot Manager

Quote:
Originally Posted by Fezar View Post
Hi all, just bought a new PC with two HDD, one SATA, the other ATA. The ATA drive is the slave and has OpenSUSE 10.3 (Beta) installed, GRUB is also installed here. The master (SATA) has windwos XP installed nothing else.
[EDIT]
Here is a fix if you have a floppy drive.

Install Smart Boot Manager to a floppy and boot the Linux drive from the floppy. One other note this does not replace Grub. Grub or some bootloader must be installed on the Linux drive.

Go here for the download and directions to install to a floppy.
http://linux.simple.be/tools/sbm

With this method Windows will boot normal and the user will never see the Linux drive.

FXEF
 
Old 08-27-2007, 08:43 PM   #3
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
Quote:
So I make a linux bootdisk and used a "configfile (hd1,0)" entry to boot to secondary HDD and it shows the grub boot menu, with options to boot OpenSUSE 10.3, so I know grub is installed on the MBR of the secondary disk. So why doesn't it boot when I ask it to?
From the time I spent with Grub, I found that he views hd0 as the device
that it was booted from, if that makes sense. So you need to reference
"configfile (hd0,0)" I think?

You might want to go into 'Command mode" of Grub and test this?

You may find this helpful:

http://Mt-Umunhum-Wireless.net/USB_Boot_using_GRUB.html

If you wanted to, your could setup your PC to boot Linux from your second HDD when you have a USB stick installed. You could use the 'Configfile' parm to redirect Grub to somewhere else, another HDD. I can help you with that if you want?
 
Old 08-28-2007, 12:14 AM   #4
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
If during the initial SUSE installation, you installed grub to the first boot-able drive the bios looks at, I'm assuming it would be the SATA with Windows. As you mentioned you later replaced grub in the MBR of the SATA drive with the Windows boot loader, all the while, the bios is set to boot the SATA drive. Next you would need to install Grub to the MBR of the PATA drive. This would be done from a live CD or similar where you would get to a root terminal and issue the 4 commands below when the bios is set to boot the SATA drive:
Code:
grub
root (hd1,0)
setup (hd1)
quit
If the bios is set to boot the PATA drive when doing this, you would use the four commands below:
Code:
grub
root (hd0,0)
setup (hd0)
quit
If you do not have the option to set the bios to boot the second drive (Slave) on the IDE channel, switch it with the optical drive so the hard drive is Master on the end connector of the ATA cable, and the DVD is connected to the middle connector and jumpers set accordingly. You can set both drive's jumpers to CS (cable select) on more modern equipment.
If the computer came new with the second drive on the IDE channel, it should have an 80 wire cable. If it did not originally come with that drive, chances are the cable only has 40 wires, a 40 wire cable will have crosstalk causing errors, an 80 wire cable has 40 more wires shielding the 40 being used. Optical drives do not need the 80 wire, most computer manufacturers will only put a 40 wire on the IDE channel if it only has optical drives.
 
Old 08-28-2007, 04:30 AM   #5
rakeshj
Member
 
Registered: Jun 2007
Posts: 44

Rep: Reputation: 15
Dear MrUmunHum,

I wanted to look the document mentioned by you on URL:

http://Mt-Umunhum-Wireless.net/USB_Boot_using_GRUB.html

But got the following message:

Bad link
Error 404
Page Not Found
Tue Aug 28 2007 2:24:23 am PDT
139.141.187.143 tried to load mt-umunhum-wireless.net/USB_Boot_using_GRUB.html
User Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Yes you have been bagged and tagged
for a making an illegal move

http://www.linuxquestions.org/questi...d.php?t=580222


Kindly suggest. Sorry for this post. Best regards, RAKESH
 
Old 08-28-2007, 06:18 AM   #6
Trickie
Member
 
Registered: Sep 2004
Posts: 38

Rep: Reputation: 23
Hi

In my opinion you'd save yourself a lot of time and trouble if you ditched the Windows NT loader and just used grub to boot both Windows and Linux. If you make Windows the default then the PC will automatically boot into Windows without any user input. Linux will only be accessible by selection using the up/down arrows on the keyboard from the grub menu at boot time.

Trickie
 
Old 08-28-2007, 08:15 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Actually the OP is best served by putting Grub into a floppy.

If the floppy is inserted Opensuse boots.

No floppy then Windoze boots.

To put Grub into a floppy just issue this command in Opensuse root terminal
Code:
grub-install /dev/fd0
If there is no floppy drive then Grub can be burn into a bootable CD. Details as per Chapter 3.4 of the Grub Manual.

Grub can be put into a pen drive too.

Last edited by saikee; 08-28-2007 at 08:17 AM.
 
Old 08-28-2007, 09:44 AM   #8
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 302

Rep: Reputation: 89
Dear Fezar,

Did your Windows/Linux configuration ever work before you applied fixmbr and deleted grub, ie were you initially able to boot Linux?

If it did, then your issue with two separate physical volumes was configured during the openSuse installation.

Although you said you want to boot XP without being prompted by grub, this really isn't possible since the MS prompt can't be used for linux effectively. However what you can do is to set Windows to be the default entry and limit the time that grub is displayed on the screen (like, say, 1 or 2 seconds).

First, check to see if you still have your menu.lst file. This should be located in /boot/grub. But obviously to do this you need access to your linux drive. You can make a "system rescue cd"--see http://www.sysresccd.org/Main_Page for more on that. Afterwards, boot from this CD, find out what your openSuse partition is, like /dev/(something), and then mount it and you should be able to see your files.

While you are there, find out what the exact name of your kernel and initrd files are, if you don't have menu.lst. These are in /boot --note you need your linux partition mounted first, and then find the /boot directory under your mounted partition. Otherwise cd'ing to /boot will give you the kernel information for the (linux) system rescue cd. The former might be named something like vmlinuz-[the number of your kernel] and the latter is named like initrd-[the number of your kernel]. Then, if you can get grub installed by cd or usb drive, and if you can get to the grub prompt, you can type this in. You will need to know what your root partition is called first. This is something like (hd0,1) but this would likely be different for you. Then you can type

kernel (your root, partition)/boot/vmlinuz-[some numbers] [a bunch of configuration options--type those if you still have menu.lst]

initrd (your root, partition)/boot/initrd[some numbers].img

You may then be able to boot the kernel, but if you don't know the configuration options from menu.lst, then some things like suspend/resume won't work. If it boots, then inspect or re-create menu.lst.

default=1 // make Windows the default (0 would be openSuse)
timeout=2 //display grub for 2 seconds

title openSuse
root (your root, partition)
kernel (see above) [then a bunch of configuration stuff]
initrd (...)

title Windows XP Professional
rootnoverify(the root partition, of XP)
chainloader +1

But, depending on how experienced with openSuse you are, you may decide to reinstall it if you can't find the configuration options for your kernel. Reinstalling would automatically generate this and you could set up logical volume management for your hard drives. You could then append menu.lst and add a section for XP, set it as the default, and adjust the display time...
 
Old 08-28-2007, 04:43 PM   #9
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
A couple of points:

1. You concluded that GRUB must be installed on the second drive because booting with the floppy got the GRUB menu:
GRUB has 2 parts: one on the MBR and the rest in /boot/grub/ The menu is in /boot/grub and you will see that whenever you boot to that partition from anywhere.

2. This link is a really good GRUB reference. Take note too, of the part about "Having Grub Do Your Research For You" including filename completion.

3. I agree with Trickie. Or you can move your XP drive to the second (hd1) and use GRUB on the first (hd0) to chainload XP using "map (hd0) (hd1)" and "map (hd1) (hd0)" commands in the GRUB script to boot XP.
 
Old 08-29-2007, 07:23 AM   #10
Trickie
Member
 
Registered: Sep 2004
Posts: 38

Rep: Reputation: 23
It really doesn't matter which operating system is where just as long as they are listed accurately in the grub menu.lst, and, as drakebasher says, Windows is chainloaded. In addition, grub must be installed to the MBR. The grub directory itself, including the stage 1, stage 1.5, and stage 2 files can also be anywhere you like.

I do wish that people would forget about floppy disks. I'd like to collect the world's supply and burn them. They never were reliable, and now there are far better alternatives.

Trickie
 
Old 08-29-2007, 08:49 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Quote:
I do wish that people would forget about floppy disks. I'd like to collect the world's supply and burn them. They never were reliable, and now there are far better alternatives.
I disagree.

I have never found a floppy unreliable in Linux. Neither have I found any Dos, Windows, Linux, BSD or Solaris that cannot be booted by a humble Grub floppy made in Linux or Solaris.

It gives a kick to fire up a Vista with it. So burn what you can as there is no way I would give it up mine. Compare with other bootable media a floppy is the most stable because in Linux it is also device "fd0".

For booting from a hard disk the 2.6.20 and newer kernel can name it any names from sda, sdb, sdc...... It all depends on how the hard disk is connected and how the booting queue is arranged in the Bios. The partition can be identified by Linux convention, by label (used by Red hat), by UUID (used by Ubuntu), by device model names etc.

For CD or DVD there are only two boot loaders in Linux; isolinux and Grub.

A USB device boots only if the Bios supports it.

Floppy enjoys the possibility of Grub, Lilo, Loadin and syslinux even we omit the third party stuff.

I think a brand new floppy disk drive can be picked up for as little of GBP 3 or US$ 6. It doesn't complete space with hard disk, requires next to nothing on electrical power and is still a great device in its own right.

Whenever I have a booting problem with booting from a hard disk it can always be resolved by a Grub prompt obtainable by inserting a Grub floppy.
 
Old 08-29-2007, 11:39 AM   #12
Fezar
LQ Newbie
 
Registered: Nov 2005
Distribution: OpenSuSE 10.2
Posts: 28

Original Poster
Rep: Reputation: Disabled
Wink SOLVED: Much appreciated

Thanks for you help everyone, did some reading up on your replies and solved it! I can now turn pc on and it will boot windows with no windows or linux bootloader so prying hands can't mess up my linux distro, and to boot linux with a full colour GRUB bootloader all I need to do is hit F10 to choose boot menu at start and choose my other HD, no time plugging in USB floppy drives and using 10 year old rubbish floppies to boot my system.

It seemed to me that I could only solve this problem by actually checking what was on the MBR of the PATA (sda) so I found a thread that told me to:

Code:
sudo dd if=/dev/sda count=1 | hexdump -C
1+0 records in
1+0 records out
512 bytes (512 B) copied, 2.6034e-05 s, 19.7 MB/s
00000000  eb 48 90 d0 bc 00 7c fb  50 07 50 1f fc be 1b 7c  |.H....|.P.P....||
00000010  bf 1b 06 50 57 b9 e5 01  f3 a4 cb bd be 07 b1 04  |...PW...........|
00000020  38 6e 00 7c 09 75 13 83  c5 10 e2 f4 cd 18 8b f5  |8n.|.u..........|
00000030  83 c6 10 49 74 19 38 2c  74 f6 a0 b5 07 b4 03 02  |...It.8,t.......|
00000040  ff 00 00 20 01 00 00 00  00 02 fa 90 90 f6 c2 80  |... ............|
00000050  75 02 b2 80 ea 59 7c 00  00 31 c0 8e d8 8e d0 bc  |u....Y|..1......|
00000060  00 20 fb a0 40 7c 3c ff  74 02 88 c2 52 be 81 7d  |. ..@|<.t...R..}|
00000070  e8 36 01 f6 c2 80 74 56  b4 41 bb aa 55 cd 13 5a  |.6....tV.A..U..Z|
00000080  52 72 4b 81 fb 55 aa 75  45 a0 41 7c 84 c0 78 3e  |RrK..U.uE.A|..x>|
00000090  75 05 83 e1 01 74 37 66  8b 4c 10 be 05 7c c6 44  |u....t7f.L...|.D|
000000a0  ff 01 66 8b 1e 44 7c c7  04 10 00 c7 44 02 01 00  |..f..D|.....D...|
000000b0  66 89 5c 08 c7 44 06 00  70 66 31 c0 89 44 04 66  |f.\..D..pf1..D.f|
000000c0  89 44 0c b4 42 cd 13 72  05 bb 00 70 eb 7d b4 08  |.D..B..r...p.}..|
000000d0  cd 13 73 0a f6 c2 80 0f  84 e8 00 e9 8d 00 be 05  |..s.............|
000000e0  7c c6 44 ff 00 66 31 c0  88 f0 40 66 89 44 04 31  ||.D..f1...@f.D.1|
000000f0  d2 88 ca c1 e2 02 88 e8  88 f4 40 89 44 08 31 c0  |..........@.D.1.|
00000100  88 d0 c0 e8 02 66 89 04  66 a1 44 7c 66 31 d2 66  |.....f..f.D|f1.f|
00000110  f7 34 88 54 0a 66 31 d2  66 f7 74 04 88 54 0b 89  |.4.T.f1.f.t..T..|
00000120  44 0c 3b 44 08 7d 3c 8a  54 0d c0 e2 06 8a 4c 0a  |D.;D.}<.T.....L.|
00000130  fe c1 08 d1 8a 6c 0c 5a  8a 74 0b bb 00 70 8e c3  |.....l.Z.t...p..|
00000140  31 db b8 01 02 cd 13 72  2a 8c c3 8e 06 48 7c 60  |1......r*....H|`|
00000150  1e b9 00 01 8e db 31 f6  31 ff fc f3 a5 1f 61 ff  |......1.1.....a.|
00000160  26 42 7c be 87 7d e8 40  00 eb 0e be 8c 7d e8 38  |&B|..}.@.....}.8|
00000170  00 eb 06 be 96 7d e8 30  00 be 9b 7d e8 2a 00 eb  |.....}.0...}.*..|
00000180  fe 47 52 55 42 20 00 47  65 6f 6d 00 48 61 72 64  |.GRUB .Geom.Hard|
00000190  20 44 69 73 6b 00 52 65  61 64 00 20 45 72 72 6f  | Disk.Read. Erro|
000001a0  72 00 bb 01 00 b4 0e cd  10 ac 3c 00 75 f4 c3 00  |r.........<.u...|
000001b0  00 00 00 00 00 00 00 00  08 ef 41 23 00 00 80 01  |..........A#....|
000001c0  01 00 83 fe ff ff 3f 00  00 00 1c 63 40 01 00 00  |......?....c@...|
000001d0  c1 ff 83 fe ff ff 5b 63  40 01 e7 36 e0 01 00 00  |......[c@..6....|
000001e0  c1 ff 0f fe ff ff 42 9a  20 03 7f 4a 30 06 00 00  |......B. ..J0...|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200
The fact that it says "GRUB hard disk read error" in part of the code shows it has this message stored in the code to it must be a GRUB bootloader. So why couldn't I access it? Must be a boot flag issue, so reapply flag by the following:
Code:
sudo fdisk /dev/hda
a
1
w
q
And it boots fine. Just needed to change my menu.lst bits that point to root(hd1,0) to be (hd0,0) as mentioned and its fine!

Fortunately it is a fairly recent HD and has an 80 pin cable so the hardware set up appears fine, even as a slave to the ODD.

What I don't understand is that when I booted from the linux boot floppy (which I add I REALLY needed when I found I had the wrong HD info in the menu.lst file) it could access the menu.lst file because it could find it on my PATA disk, but how did it boot it? At the time I made my disk my menu.lst file was pointing to hd1,0, but grub needs the hd it boots from to be called hd0,0 --so how did it boot up? Something to do with the floppy being used in place of the HD? The only reason I could explain it is that to GRUB when I boot off a floppy, my PATA disk would be hd1,0 because the floppy is hd0,0 but wouldn't that be fd0? Glad to solve it but would really like to know how the floppy disk boots with the old menu file?

Thanks everyone, your help has been greatly appreciated!
 
Old 08-29-2007, 12:45 PM   #13
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
The GRUB MBR points to the location of the boot files, including the menu.lst. If your boot floppy was setup with root (GRUB's root, not your OS root) on (hd1), then you would see the menu.lst from (hd1). Where the GRUB MBR points is determined when GRUB is installed, either to a floppy or to a hard drive partition.

The designation of (hd1) vs. (hd0) is determined by which drive GRUB "sees" first. If you had GRUB installed on two identical drives, whichever one you boot to (through the BIOS settings) would be (hd0) and the other would be (hd1). That has nothing to do with which is /dev/hda or /dev/hdb: that is determined by physical wiring.
 
Old 08-29-2007, 01:08 PM   #14
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
Quote:
Originally Posted by rakeshj View Post
Dear MrUmunHum,

I wanted to look the document mentioned by you on URL:

http://Mt-Umunhum-Wireless.net/USB_Boot_using_GRUB.html

But got the following message:

Bad link
Error 404
Page Not Found
Tue Aug 28 2007 2:24:23 am PDT
139.141.187.143 tried to load mt-umunhum-wireless.net/USB_Boot_using_GRUB.html
User Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Yes you have been bagged and tagged
for a making an illegal move

http://www.linuxquestions.org/questi...d.php?t=580222


Kindly suggest. Sorry for this post. Best regards, RAKESH
Oops, my mistake, try:
http://www.mt-umunhum-wireless.net/h...sing_GRUB.html
 
Old 08-29-2007, 06:22 PM   #15
akkalyankar
LQ Newbie
 
Registered: Jul 2007
Posts: 5

Rep: Reputation: 0
I too have same setup. One SATA hardisk (sda) and one PATA harddisk (hdb). I too had the same problem. After lot of researching/efforts I found that BIOS is required to inform which harddisk to boot from. My BIOS has that option. If one wants to boot from SATA, make it first boot drive and if from PATA, make it first boot drive. That way I solved my problem.

Alternatively same GRUB can be installed on both the drives. In that case GRUB menu.lst file on each drive has to be edited.

If you want to boot GRUB from SATA drive, all partitions on SATA drive will be referred as (hd0,x) where x is the number of partition on PATA. Similarly all references to PATA will have to be edited as (hd1,x) as it becomes second drive.

If you want to boot GRUB from PATA drive, all partitions on PATA drive will be referred as (hd0,x) where x is the number of partition on SATA. Similarly all references to SATA will have to be edited as (hd1,x) as it becomes second drive.

While editing the menu.lst file default operating system to be booted can be changed on each drive.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need access to secondary hard disk: EYEdROP Linux - Software 4 04-01-2007 01:00 AM
NTFS Secondary Hard disk Rayning Slackware 13 11-08-2006 10:24 AM
upgrading or booting from secondary hard disk trysten_x Linux - General 3 08-29-2005 10:12 PM
My secondary slaved hard disk crashed. How do I get Fedora Core 1 back. Bjorkli Linux - Hardware 4 08-09-2004 11:04 AM
linux can't see my hard disk on secondary master csvke Linux - Hardware 6 03-19-2004 06:29 PM

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

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