Grub doesn't boot to Windows when CD-Drive attached
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Grub doesn't boot to Windows when CD-Drive attached
I have a question concerning GRUB.
First my hardware configuration
IDE1 master: 80 GB HD with FC3 installation
IDE1 slave: TEAC CD WRITER 52*
IDE2 master: LG CD WRITER 32*
IDE2 slave : TOSHIBA DVD-ROM
SATA1: 160 GB HD with WIN XP PROF installation
I configured my grub bootmanager to be able to start Win XP and Fedora Core 3.
When I unplug the TEAC CD-Writer from IDE1 everything works fine.
As soon as I plug it in and try to boot into Windows I get an error (Booting Linux still works fine).
To be honest I don't get the point. It seems like grub gets mixed up just because I attach a CDwriter as slave.
By now I tried various hardware configurations, swapping the TEAC with the LG and so on. But nothing worked.
It looks like your drive numbers change so the GRUB config for the SATA drive is no longer current.
GRUB uses hd0 hd1 hd2 etc to number drives... I'd guess hd0 will be the primary master, hd1 the primary slave (if it exists - otherwise the secondary master... you get it?) and so on. Perhaps your SATA drive is hd1 unless the primary slave exists?
You may want to run the mount command or have a look at dmesg to see how the drive labels are assigned. hda = hd0, hdb=hd1 etc. GRUB is expecting SATA/WinXP to be hdb (then swaps the labels because windows wants to be first!) but if you have a primary slave, *that* is usually hdb, which will push all the other drives forward one notch.
Mmmm - something fishy here. grub only sees hard-disks (hd0, hd1, ...) and floppies (fd0, ...) as boot devices.
The CD and DVD drives should be immaterial.
When you get grub menu, hit "e" key before it times out.
Then type
root (hd {and hit the *tab* key}
Tab completion should show you the boot capable devices as grub sees them. Do this with the IDE1 slave plugged in.
Show be instructive.
Thanks for the answers so far. I will check your (syg00) idea as soon as I'm at home.
@ Simon Bridge: As syg00 explained, grub shouldn't identify a CD-drive as hd?. So IMHO it shouldn't change the numeration of the hd's. But obviously there's a point I'm missing so far....
I already looked up the drive labels assigned to my devices and tried several combinations using hd2, hd3 and so on with the map command. I got a different error message. Something like disk not found. When I use hd1 it says something like "invalid or unsupportet executable format" if I remember correctly.... So to me it seems like grub found the disk when using hd1, but couldn't boot from it....
I will post the results of my further tests, as soon as I get the chance to give them a try.
It tried what syg00 suggested and I get hd0 and hd1 as harddisk in grub when the CD-Writer is attached.
I played around with the Bios settings. My board is a MSI Neo2.
Within BIOS I can set "P-ATA first", that means that the IDE ports get number 1 and 2, SATA ports are 3 and 4 then.
When I set "S-ATA first", S-ATA ports get number 1 and 2, P-ATA get 3 and 4.
I can select native and legacy mode within the same menu, but I don't really understand the difference of the 2 modes.
When I set "S-ATA first" in legacy mode I can boot windows without any problems. When I try to boot Linux then I get some weird IRQ 185 error messages. It keeps on booting, but every boot step shown takes minutes. The error message is repeated several times after every step.
Then I tried the native mode, still with "S-ATA first". Linux bootet without any problems but windows didn't - error message 25 : Disc Read error.
Maybe someone has an idea how to interpret this strange behaviour....
When I set "P-ATA first" it doesn't work as well - That's how my configuration was in the past.
I'd be looking at a hardware problem - check the obvious;
- ensure the TEAC is jumpered for slave or cable-select
- swap out the IDE1 cable cable, and test again
- if still bad, swap the opticals and see if problems persists.
- if so, ditch the writer.
- put everything not broken back - so you can find your data
Sounds like you have SATA in the kernel rather than libata, so leave the BIOS as "native".
To use the grub.conf with the drive mapping, you'll need to have the IDE first (i.e. as hd0) - this allows the mapping to work. Be aware that if you put another IDE hard disk in it'll become hd1, and break your windows boot - till you remember, and fix it.
thanx for that - you're right of course, CD's shouldn't count for GRUB - of course, some distributions are CD bootable (DSLinux for eg) but still ...
I note that the TEAC seems to be the newer drive. A thing to try would be to remove the old 32* drive and plug the teac in it's place - does that work. (Especially re the comment about the master/slave jumpers) A problem I've had before, is the manufacturers label for the jumper config being wrong! It takes ages to figure out because you naturally trust the labels.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.