If you are writing a piece of text that may be cut off, pay some extra attention to your first sentence…

This post is mostly a reminder to myself. Every time I reinstall Windows, it overwrites my boot sector, and I need to reinstall it from the Ubuntu live CD to get my dual-boot system back. However, since my Ubuntu install is inside an LVM partition, this is not very straightforward. Here are the instructions. I kept them general so that they may be of use to someone else as well.
sudo apt-get install lvm2
sudo vgdisplay
sudo vgchange -ay name-of-vg
sudo mkdir foo
sudo mount /dev/name-of-vg/name-of-root-lv foo
sudo mount /dev/name-of-boot-partition foo/boot
sudo mount -obind /dev foo/dev
sudo chroot foo
sudo grub
(hd0)
is your boot drive and (hd0,0)
your boot partition):root (hd0,0)
setup (hd0)