I have a working setup of Ubuntu Server 12.04 LTS (precise) installed on a LVM Volume (/dev/vg0/root). /boot is on the same LV, and Grub2 boots nicely from it using its own raid/lvm/xfs modules. Great thing!
Now I would like to test Ubuntu Server 14.04 LTS (trusty) to evaluate if the more recent packages improve things in my setting. So what I do is simply create another LV, say /dev/vg0/root-trusty, and prepare it just the way I normally do when I do bare metal setups using debootstrap and chroot, installing kernel, grub-pc, etc.
Now I have two full-fledged root filesystems on my LVM, including two /boot directories and two differing /boot/grub/grub.cfg files. Please help me think: How does Grub know now which grub.cfg to use?
The only way that would make sense to me is that
grub-install saves information about what the systemfrom which grub-install is run thinks is the correct root-fs. So switching between the two root-LVs for boot could be done by issuing
grub-install from the respective (chrooted) filesystem and then reboot.
Is that so? If not, what else does Grub2 do when it "finds" multiple filesystems it could use to stage-2-boot from? I could not seem to find any hard information about that so far. So I thought I'd just ask before I invest the late evening hours in trial-and-error.
Thanks for any light shed on this!
PS: for clarity - I do NOT mean typical dual-booting using multiple OS entries in a single grub.cfg on a separate /boot partition. I know that, but here I sort of WANT to use concurrent Grub2-installations on separate partitions.