If you have grub installed, run os-prober as root. It does exactly what you want.
Update
os-prober will only list operating systems other than the one it's on: it's used by GRUB during installation to generate grub.cfg so it's natural that GRUB doesn't need info about the OS it's being installed on. To get the partition mounted as the current /, you can do this:
ROOT_PARTITION="$(readlink -e -- "$(findmnt /|awk 'END{print $2}')")"
This will fail in the unlikely case that the partition mounted as / has a space in its name.
References