Every time I reinstall Windows, it overwrites my boot sector, and I need to reinstall it from the Ubuntu live CD to recover my dual-boot system. However, since my Ubuntu install is inside an LVM partition, this is not very straightforward. Here's how to do it.
I'm assuming some experience with the command prompt, but since you're apparently running LVM, you're not a total beginner.
- Start from the Ubuntu CD and open a terminal.
- Install LVM:
Code:sudo apt-get install lvm2
- Find the name of the volume group:
- Make the volume group available:
Code:sudo vgchange -ay name-of-vg
- Mount the root and boot file systems, and bind the dev file system:
Code: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
- Change to the root of your system:
Code:sudo chroot foo
- Drop into the GRUB prompt:
- Install the GRUB MBR (assuming that (hd0) is your boot drive and (hd0,0) your boot partition):
Code:root (hd0,0) setup (hd0)
- Reboot and have your boot menu back!