See also Linux gazette article on GRUB
GRUB home page
Obviously there are no guarantees that this will all work with your
configuration (or even that I've remembered it all properly for mine),
but hopefully it will help you. Some of the operations are necessarily
destructive and therefore dangerous if you get the parameters
wrong. Grub is great in that if you get something wrong, as long as it
finds stage1 & 2 it will give you a command line and you can change
the parameters a bit (point to a different linux kernel / partition
for windows etc). I recommend making a grub floppy before doing this
as a last resort (and I used it to put grub on my windows disk).
grub> install (hd0,0)/boot/grub/stage1 (hd0) (hd0,0)/boot/grub/stage2 (hd0,0)/boot/grub/grub.conf(Here I'm assuming that linux's /boot is in partition /dev/hda1 which appears as partition hd0,0 in grub. Filename completion with
mount | awk '$3=="/" {a=$1; gsub("/dev/hd","",a); gsub("[0-9]$","",a); } END {if (a!="") { b="ln -sf /etc/fstab"a" /etc/fstab"; system(b); print b;} else print "No mount drive found"; }'Add 20 as /dev/hdc (may need a reboot), mount the new small ext2 partition on it and copy the grub files to it (in directory /boot/grub). Swap the drives /dev/hda=30 (windows) /dev/hdc=20 (linux)
grub> install (hd0,7)/boot/grub/stage1 (hd0) (hd0,7)/boot/grub/stage2 (hd0,7)/boot/grub/grub.confI haven't checked booting into Windows with the drives reversed, but it seems to work into Linux or Windows when /dev/hda=30 (windows) and /dev/hdc=20 (linux). windows hibernates OK, but I haven't yet managed to make a hibernate file that will let me hibernate linux.
###################################################################### # /boot/grub/grub.conf on 20: default 0 timeout 20 title Linux Ultrabay root (hd1,0) kernel /boot/vmlinuz-2.4.9-31 root=/dev/hdc1 initrd /boot/initrd-2.4.9-31.img title Linux MainDrive root (hd0,0) kernel /boot/vmlinuz-2.4.9-31 root=/dev/hda1 initrd /boot/initrd-2.4.9-31.img title Win2K Ultrabay rootnoverify (hd1,0) chainloader +1 makeactive title Win2K MainDrive rootnoverify (hd0,0) chainloader +1 makeactive ###################################################################### # /boot/grub/grub.conf on 30: default 0 timeout 20 title Win2K MainDrive root (hd0,0) chainloader +1 makeactive title Linux Ultrabay rootnoverify (hd1,0) kernel /boot/vmlinuz-2.4.9-31 root=/dev/hdc1 initrd /boot/initrd-2.4.9-31.img title Linux MainDrive rootnoverify (hd0,0) kernel vmlinuz-2.4.9-31 root=/dev/hda1 initrd /boot/initrd-2.4.9-31.img title Win2K Ultrabay root (hd1,0) chainloader +1 makeactive