2010-11-07

grub2 dual boot

I have two hdd's, one sata named sda and an old ide named hdb. It has happened that I had to install Windows on the latter, and this is what I had to do in order to configure dual boot.

touch /etc/grub.d/15_windows
chmod a+x /etc/grub.d/15_windows

Then edit that file as follows:

#! /bin/sh -e
echo "Adding Windows" >&2
cat << EOF
menuentry "Windows XP" {
set root=(hd1,1)
drivemap -s hd0 hd1
#drivemap (hd0) (hd1)
#drivemap (hd1) (hd0)
#set root=(hd0)
chainloader +1
}
EOF