LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   grub, onboard ide and ide add-in cards (http://www.linuxquestions.org/questions/linux-general-1/grub-onboard-ide-and-ide-add-in-cards-112676/)

sambartle 11-05-2003 10:42 AM

grub, onboard ide and ide add-in cards
 
I have a problem using grub (or lilo) to boot -any- distribution. I know why the problem happens but need help to solve it.

My system is set up as follows:

I have my Standard Onboard (via vt8235) onboard ide controller:
PM: 120GB HDD
PS:
SM: Pioneer DVD-R
SS: LiteOn 24x CDRW

Silicon Image CMD649(number1) add-in card (pci)
PM:
PS:
SM: Zip 100
SS:

Silicon Image CMD649(number2) add-in card (pci)
PM: LiteOn 52x CDRW
PS:
SM: 80GB HDD
SS:

the 120GB HDD
partition 1: ntfs

the 80GB HDD:
partition 1: linux /boot
partition 2: linux swap
partition 4: linux ReiserFS /
partition 5: fat32
partition 6: fat32

Linux is installed and configured on the 80GB HDD.

My 120GB is ntfs (win2k) and boots as default. I use Smart Boot Manager on a floppy to start linux.

The problem is this: my bios detects the onboard ide devices first, and the CMD cards afterwards. Linux detects the CMD cards first and the onboard afterwards.

When i install GRUB to the MBR of the 80GB (in linux) my root is hd0,0 and kernel is on (hd0,x)/kernelxx

(if i reboot with the floppy disk in: the kernel becomes (hd1,x)/kernelxxx and this is how i figured out the problem to begin with the allocations were different)

However when i reboot and use Smart Boot Manager (or any thing else (like the GRUB boot disk)) to boot i get kernel panic as the hard drives are in the wrong place because of the BIOS

I'm not explaining this well... i think my question is therefore: how do i force linux to detect the onboard ide devices first and how can i make sure the two pci cards are detected in the same order as the BIOD to ensure that the drives that SBM (or GRUB) sees at startup are the same once the kernel begins to boot and can therefore find the root drive.

Any suggestions are welcome as im not too bothered about ruining the linux system to get this working, theres nothing of use on there yet anyway as i cant boot to it to install things.

Thanks i advance.

If more info is needed i will try to provide it in a more clear manner

jailbait 11-05-2003 01:39 PM

If you are compiling your own kernels there is a kernel option for the kernel to reverse the order of the IDE cards that it finds. You might take a look at that option and see if it is of any use in solving your problem.


------------------
Steve Stites

sambartle 11-05-2003 02:11 PM

i will try that now.

will this mean i need to reinstall everything if it works (all partition's will be different to where it was /dev/hdc instead of /dev/hdg for example) or ewill linux notice the changes and just work?

Thanks for the suggestion

jailbait 11-05-2003 02:42 PM

"will this mean i need to reinstall everything if it works (all partition's will be different to where it was /dev/hdc instead of /dev/hdg for example) or ewill linux notice the changes and just work?"

You will have to change your bootloader and /etc/fstab every time that you rearrange your IDE controllers.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

sambartle 11-05-2003 03:18 PM

Ok tried that option in kernel config... the problem is that it enables the behaviour i am already seeing.

The offboard chipset IS already booting first even with the option not set in kernel config (the CMD controllers are on PCI cards and in linux take hda through hdh and the onboard via gets hdi through hdl)

The kernel option "Boot Offboard Chipsets First" doesnt change this behaviour as this is already what happens.


I think this is because the CMD cards somehow pretend to be part of my BIOS (they come up just after my bios screen - and the final part of mny BIOS happens AFTER the initialisation of the CMD cards) and can somehow make the hard drive appear as if it was onboard when its not.

I actually think it may be impossible to get linux to work on this system with windows 2000 as well. (my system is totally standard apart from the ide cards though so i think there must be a way)


Are there any ways to swap /dev/hdg for another id very very very early in the linux boot process?

jailbait 11-05-2003 03:52 PM

"I think this is because the CMD cards somehow pretend to be part of my BIOS (they come up just after my bios screen - and the final part of mny BIOS happens AFTER the initialisation of the CMD cards) and can somehow make the hard drive appear as if it was onboard when its not."

I have a motherboard IDE controller and a PCI card IDE controller. In my BIOS I can set the address order for these two controllers to either one being first. Your BIOS may or may not have such a feature.

"The kernel option "Boot Offboard Chipsets First" doesnt change this behaviour as this is already what happens."

I looked at this option when I set up my PCI IDE controller. I decided not to use it because Linux does what I want anyway. As I remember the option it switches the order that Linux configures the controllers. So if Linux naturally sees the controllers backward then the "Boot Offboard Chipsets First" option should switch Linux to using the correct order. That is how I remember the description but since I never actually tried it things may work differently in practice than I think they do.

"Are there any ways to swap /dev/hdg for another id very very very early in the linux boot process?"

If you cannot get Linux to order the IDE controllers the way that you want then you could try configuring /etc/fstab and grub to the configuration that Linux insists on using.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

sambartle 11-05-2003 04:28 PM

[QUOTE]Originally posted by jailbait
"I have a motherboard IDE controller and a PCI card IDE controller. In my BIOS I can set the address order for these two controllers to either one being first. Your BIOS may or may not have such a feature."

I will have a look but i dont think my BIOS has this option.

" That is how I remember the description but since I never actually tried it things may work differently in practice than I think they do."

I did try changing the option anyway to see what happens and for future reference i dont think it is a swap i think it only sets offboard to be first, and so as they are swapped by default it will not correct the problem.

"If you cannot get Linux to order the IDE controllers the way that you want then you could try configuring /etc/fstab and grub to the configuration that Linux insists on using."

Would attempting this step without changing fstab cause the kernel to panic... this is almost exactly what i think i have done wrong... i have attempted to force grub to use the settings i think are correct but didnt change fstab..

Ill have a look at this now, you might well just have solved this for me.

Thank You

jailbait 11-05-2003 07:15 PM

"Would attempting this step without changing fstab cause the kernel to panic.."

Yes.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

whansard 11-05-2003 07:26 PM

i'm saying this because sambartle is a newbie, and a lot of times things
get assumed, but the newbie doesn't know. so please don't take insult.
you did recompile and install the kernel after changing the config, right?
the config just changes how the kernel gets compiled.

also, there are bootloader remap options to change the drive order

"One more important command is the "map" command, which you can use when you have two hard disks and an operating system such as Windows which doesn't like to be booted from the second hard disk. For example, you can map hd0 as hd1 and hd1 as hd0. In other words, you can virtually swap the two hard disks and load the desired operating system. The commands are as follows:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)"


that was from here:
http://gazette.euskal-linux.org/issue64/kohli.html

jailbait 11-05-2003 07:35 PM

"i'm saying this because sambartle is a newbie, and a lot of times things
get assumed, but the newbie doesn't know. so please don't take insult."

I know that some people are thin skinned about being corrected on the forum but I am not. No insult taken.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

sambartle 11-06-2003 10:07 AM

Quote:

Originally posted by whansard
[B]"i'm saying this because sambartle is a newbie, and a lot of times things
get assumed, but the newbie doesn't know. so please don't take insult.
you did recompile and install the kernel after changing the config, right?
the config just changes how the kernel gets compiled."

Yep recomiled and reinstalled but still no change. I'm certain that, that option really has no effect in this case as the drives all appear to be onboard for some strange reason.


"grub> map (hd0) (hd1)
grub> map (hd1) (hd0)"

This looks promising as this is the problem i need to fix, the drives being inverted by linux compared to my BIOS i think. But then again linux will boot fine from any HDD right?

I tried playing with fstab, but i found a few problems, firstly i think its correct, second: is fstab actually accessible before the partition containing it is mounted? As my root partition is not mounted id guess that fstab has little to no effect on the problem.
Because the kernel panic's trying to mount the root file system after getting through the initrd stuff i guess it wont.

sambartle 11-06-2003 10:10 AM

Thanks to whansard and jailbait, i can now boot from the hdd properly, but the Kernel still gets into a panic trying to access /dev/hdg

I get VFS: Kernel Panic.. Please specify a correct root="" option

I can see above this that the HDFD is detected as /dev/hdg and i know the correct partition is /dev/hdg4, so root=/dev/hdg4 in grub should be correct from what i understand?

Hiowever this still doesnt work, my ReiserFS is compiled into the kernel so it should be able to mount the filesystem ok.

Thanks for your help guys, i will continue trying.

jailbait 11-06-2003 12:45 PM

"As my root partition is not mounted id guess that fstab has little to no effect on the problem."

If /etc/fstab is incorrect you will not be able to boot.

----------------------
Steve Stites

sambartle 11-06-2003 06:04 PM

Quote:

Originally posted by jailbait
"As my root partition is not mounted id guess that fstab has little to no effect on the problem."

If /etc/fstab is incorrect you will not be able to boot.


Sorry i may not have been clear there: i meant since /etc/fstab is on the partition it fails to mount, then it wont be a part of the problem as surely it cannot be read until after the partition containing it is mounted.

The problem i have now is that it looks very like the ReiserFS support for / partition isnt in my kernel, but it definitly is as i have checked twice.

whansard 11-06-2003 08:25 PM

grub or lilo points to the kernel's address on the hard drive, and the
kernel takes the option for root, which is the partition the kernel will
load as read-only to look for the stuff it needs. grub or lilo is what passes
the root option to the kernel. the kernel will try to load the partition it is
told is root, read-only, then look at fstab, and mount what it is told there.
if fstab is incorrect, it will die there.


All times are GMT -5. The time now is 06:33 AM.