Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I have 2 drives:
hda has FC -1,
hdd has XP.
GRUB is installed on the MBR.
Now when I boot I get the correct spash image having the boot option of linux as well xp. If I choose linux, it boots regularly. But when I choose xp, it does not boot.
I went through documentation, I found that is some problem and something may have to be done. For the present I have to go to boot-time-setup, and choose "boot from secondary-slave" to use my windows.
Earlier when my XP was on hda and FC1 was on hdd, there was no problem.
I have a feeling that if I install grub on hdd (XP drive), probabely it would sort out. But then I will have to something to make the mbr point to the hdd.
Any ideas how it could be sorted out. I would not want to change the hard disk data cables and re-install the FC1.
Thanks in advance.
Prabhat Soni
Last edited by prabhatsoni; 10-03-2005 at 12:41 AM.
The problem is that if you want to boot both it is best to place linux side by side with windows, on the same master drive!!!!
I have a master drive split 50/50 of Lin and Wind with the secondary master as free space to share between Lin and Wind.
no problems!
The boot sector of the hda is not responsible for the bootsector of hdb, hdc, hdd ....
If you can boot the second drive (first) with grub and get to both linux and windows, do that; also,
I assume since you don't wan't to reinstall linux, this also means you are unwilling to reinstall Windows on the same drive as linux.
Use the BIOS to get to each OS, otherwise you have just painted yourself into a corner.
(BACK UP ALL YOUR DATA THAT YOU WANT TO KEEP)
Paint Dries.
Last edited by Theta13579; 10-03-2005 at 01:09 PM.
I'm not so sure he is painted into a corner.. There was a similar thread in debian-user ml and one guy fixed the problem by doing something like disconnecting /dev/hda (his linux disk) and reinstalling his XP, then rebooting again with BOTH drives alive, did some other strange stuff and the final result was, Grub loaded his Debian from hda and XP from hdb... go figure...
I needed to do the same thing for a friend of mine who is in a wheelchair but damn... that was a lot of work ... I still look now and then for an easier solution, when I find it, I'm gona write a HOWTO so the rest of the world won't have to go through this..
Thanks Asuka,
The solution provided by you has worked.
But tell me if I shift my XP-drive to hda, and linux-drive to hdd, what will I have to do (other than changing the cables, that is):
1. Booting with a boot disk, I will have to give
grub>grub-install hda
2. Then I will have to accordingly modify the grub.conf. ?
Will it work ?
Then will I not have to change configuration files like /etc/fstab, becasue it contains entries pointing to hda !
Prabhat Soni
Last edited by prabhatsoni; 10-04-2005 at 02:11 AM.
it depends on bios boot order pretending you keep it booting to hda then its hda that needs the bootloader.
print out your existing /boot/grub/menu.lst as a guide for the changes to come
then install xp to hda and let xp bootloader go into mbr for hda
then install linux to hdd and let grub overwrite the mbr for hda.....yep hda
modern linux distros have no problem with booting xp or linux from diff drives but if you need help read my signature and the final outcome should be this
grub in mbr for first drive
menu.lst
title ms
root (hd0,0)
makeactive
chainloader +1
title linux
root (hd1,X) depends where you put
kernel etc
initrd etc
If you propose to change the installation of your hard drives (moving hdb to hda, and moving hda to hdb), do it the easy way.
First, edit grub.conf (or menu.lst if you use that) to change the grub configuration BEFORE you change the physical location of the drives.
Especially, since xp will be on hda after the hard drive switch, edit the grub.conf to remove the map (hd0) (hd1) etc. references and leave the chainloader line in place (after the drive switch, you won't need the map lines).
Second, edit /etc/fstab to change the locations of the partitions (from /dev/hda to /dev/hdb and vice versa).
Third, run the grub-install utility (or the older manual way of installing grub) to install it to the mbr of hdb BEFORE the drives are swithed. That way, grub will be in the mbr of the disk when it becomes hda, and you won't need a boot disk to boot into Linux to try to fix it (it's fixed before you start swapping disks).
Fourth, power down, disconnect the box, open it and switch the drives. Put it all back together, power up, and grub should still work IF the changes to grub.conf and /etc/fstab and grub was installed to the mbr of the disk which will be hda after the switch, were done before the drive switch.
That's the technique I used a few weeks ago to move my primary drive to slave and add a new (larger) primary. I had no problems booting back into SuSE.
I have a sata drive that has FC4:
/dev/sda1 = /boot
/dev/sda2 = /
/dev/sda3 = swap
Then I have a ide drive that has WindowsXP NTFS, only one partition
In BIOS, my first boot is my sata drive. This is how grub looks. Note: WinXP is default for my girl friend.
Code:
[root@localhost Richard]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda2
# initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=3
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.11-1.1369_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.11-1.1369_FC4.img
title WindowsXP
map (hd1) (hd0)
chainloader (hd1)+1
Last edited by TexasDevilDog; 10-10-2005 at 08:11 PM.
I am not sure if that boots but if it does not, and grub is in mbr for sata then try changing your ms menu to swap (map) with the extra line
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
there is no need for the boot command that is for command mode use if you are stuck at a grub prompt with no menu
Originally posted by aus9 I am not sure if that boots but if it does not, and grub is in mbr for sata then try changing your ms menu to swap (map) with the extra line
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
there is no need for the boot command that is for command mode use if you are stuck at a grub prompt with no menu
Yeah, it works fine. I have been using it for a while. I guess it just never gets to the boot command. Silly me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.