LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Lenny Dual Boot w/ Win7 - GRUB problems! (https://www.linuxquestions.org/questions/debian-26/lenny-dual-boot-w-win7-grub-problems-707562/)

Leon W. Malinofsky 02-25-2009 07:31 PM

Lenny Dual Boot w/ Win7 - GRUB problems!
 
I have a system with two identical IDE drives, one with Windows 7, installed first on hda1, and one with Debian Lenny (installed second on hdb1 but failing to boot). It seems to me you used to be able to put the (boot record / loader?) on the drive you wanted to run Linux and just boot to it from the BIOS—that’s what I like to do. Now, I’m not sure whether the installers are dumbed down, or whether I have, but it seems if you have another OS like Win7 on the first hard drive and tell the installer to put Lenny on the second hard drive, it still regards the Win7 partition as the one to boot from (the one whose boot loader should be used). Therefore if you try to use the BIOS to boot to hdb1, say, it finds the GRUB record but is unable to boot the disk, probably because it misinterprets the instruction to boot to (hd1,0) and somehow references the “real” boot drive, hd0. Am I right? If this is the case I need to know what to put in GRUB (in menu.lst, I suppose) to REALLY boot hd1,0 when hdb is selected in the BIOS boot menu.

This is what my menu.lst says (this fails to work):

title Debian
root (hd1,0)
kernel /boot/vmlinuz-2.6-26-1-686 root= /dev/hdb1 ro quiet
initrd /boot/initrdimg-2.6.21-1-686


title Windows Vista (loader)
root (hd0,0)
savedefault
chainloader +1




(The above was typed not cut-and-pasted so a typo may exist.)

What can I do that *will* work? Any suggestions much appreciated…

Regards

Leon Malinofsky

PS I should point out that the system also contains a third, SCSI, drive, sda1.

syg00 02-25-2009 07:44 PM

If you want to do things like this, it is best to change the BIOS boot order prior to installing Linux. This ensures hd0 really is hd0 - all the time. If you don't, hd0 is the Windoze drive (in your case) during the (linux) install, but when you later change the BIOS boot order, and reboot, the Linux disk is now hd0.
Note this is not a grub problem - it's doing what you tell (or told) it.

Easiest might be to change the BIOS and reinstall - that way you'll get a clean MBR boot record, menu.lst and fstab. Else you'll have to adjust each of those.

Leon W. Malinofsky 02-25-2009 07:55 PM

Thanks sincerely for insight. Will try. Regards.

PTrenholme 02-25-2009 09:35 PM

You might also want to look at the GRUB map command for switching the logical order of (hd0) and (hd1) before booting.

Also, check your BIOS specifications: It may automatically set the boot drive (whichever one you select to boot from) to be (hd0) and the other to be (hd1).

If you can get GRUB to show you a boot menu, push <escape> and then an "e" to get to a command prompt and use the editor and tab-completion to verify which drives are (hd0) and (hd1). (I usually just open a blank line, type (hd0,<tab> which produces a list of the partitions on (hd0). Knowing the partitions is, for me, usually sufficient to identify which drive is which.)

You can also use the GRUB mini-editor to create stanzas that works to boot your two OS, but don't forget that changes made in the GRUB editor are only made to the in-memory copy of the GRUB configuration file, and they are not saved back to the file.


All times are GMT -5. The time now is 11:43 AM.