Normally, you'd just boot up a rescue CD and reinstall your favorite boot loader (or that one that comes with your OS' rescue CD ).
Sadly, the Ubuntu 10.04 Alternate Desktop CD doesn't support my crypto-raid-setup. The rescue mode installer doesn't recognize my raid set up at all (even thou it gets assembled^^).
Therefore I've to repair it by hand:
After booting, the Ubuntu rescue CD offers to switch into a root terminal.
The raid was assembled automatically, so there is no need for doing it manually:
mdadm --assemble /dev/sda1 md0
I am going to build a chroot environment in /mnt, change root into it and reinstall grub2:
At first I have to mount the crypto device for the root file system:
cryptsetup luksOpen /dev/md0 md0 mount /dev/mapper/md0 /mnt
Now we've to add the missing pseudo file systems:
mount -o bind /dev /mnt/dev mount -t sysfs sys /mnt/sys mount -t proc proc /mnt/proc
Last but not least: We must not forget to mount the boot device. In my case it is just an ordinary partition:
mount /dev/sda4 /mnt/boot
Our change root environment is ready for usage and we simply have to chroot into it:
chroot /mnt
Now, grub2 can be easily restored:
grub-install /dev/sda
As a final step, we'll ensure that grub is up-to-date:
update-grub