Is that that easy?
You'll have to have everything in system A shut down, I think, or you won't be able to umount
the old root.
You can use chroot
on its own without pivot_root
, in which case both systems can be accessible at the same time, e.g., by switching VT's, or just starting from a GUI terminal (this means not umounting old root, too). I recommend you try this out first.
Could I break something doing this
It isn't a serious risk, no.
Will this just stop running the distribution A and start running the distribution B 'as if' I had re-booted?
Not as if you had rebooted, no. I've actually never tried this with a full-fledged distro installation, but I think one issue will be that the usual system services won't be running. Nothing will be running but your instance of the shell, and init. So if you want to make things normal, you'll have to tell init/upstart something to get it to start services. This is one reason tooling around with just chroot
will be easier until you have everything figured out, since if something gets screwed up, system A will still be running and you can start again from there rather than having to reboot. It's also easy to copy stuff back and forth from the perspective of system A (just be sensible about it, e.g., don't replace in-use files).
Both distributions have different kernels.
Only the system A kernel will be used. I think it is possible to hot swap kernels (q.v. kexec) but that is a whole other question, and something you probably want to avoid if possible. It should not be necessary anyway.
However...
Make sure you place a copy of the /lib/modules/x.x.x
directory for the system A kernel in the system B root filesystem, or you won't be able to load any kernel modules!