Sometimes "aptitude install grub2" seems to miss out your windows partition, at least that happened to me.
This is how to fix it:
Get the uuid of your windows partition:
> sudo blkid
will give a line with:
>/dev/sda2: UUID="10AC99D8AC99B8A4" TYPE="ntfs"
edit /etc/grub.d/40_custom so it contains:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Windows XP" {
insmod chain
insmod ntfs
search --fs-uuid --set 10ac99d8ac99b8a4
chainloader +1
}
Replace the UUID with the one from your system.
then run
>sudo update-grub
you can check your new boot-entry by
>cat /boot/grub/grub.cfg
Now, what does it all mean ?
>menuentry "Windows XP" => the title shown in the menu
>insmod chain => this installs the chainloader module, you need this or you get "Unknown command: chainloader"
- (maybe you also need to do "sudo grub-install --modules="pc ntfs chain" /dev/hdx" to install the modules into the first sector of your hdd, the available modules are in /boot/grub/)
>insmod ntfs => so grub learns to speak ntfs
>search --fs-uuid --set xxxx => this will search for the partition with the specified UUID and set the root= parameter to the hdd name e.g. (hd0,2) of it
you can try this in the grub shell, and remember you need to use _lower_ case letters for the UUID!
>chainloader +1 => loads the other OS