I expect there are several reasons this could be problematic. I could only come up with one: incompatible
grub-mkconfig. It kind of feels like compiling on one OS for use on a different OS. However, in this case, it could work since I believe the output is a text .cfg file. I don't know if the different versions of
grub-mkconfig would produce incompatible results (Ubuntu provides version
2.02~beta2-36ubuntu3.20 whereas SystemRescueCD provides version
I would like to not have to reinstall GRUB and I would like to be able to run
grub-mkconfig from SystemRescueCD. It would be a bonus to be able to run it on Ubuntu as well but it is not necessary.
I have installed Ubuntu 16.04 in a VM with GRUB installed in a separate partition mounted as
/boot. I have also installed SystemRescueCD in yet another partition. I modified
/etc/grub.d/40_custom to create a menu entry per the instructions found at Installing SystemRescueCd on the disk, ran
grub-mkconfig -o /boot/grub/grub.cfg. I can switch between the two installs and everything runs as expected.
To accomplish this, I moved
/boot/grub while booted in Ubuntu (I made a small change in
/etc/default/grub I want to keep -- I'm willing to abandon this change). Then I did a bind mount from both of these to their original locations and made those bind mounts persistent in
In installed SystemRescueCD on a third partion. I also did a backing store so I can modify SystemRescueCD following these instructions. I mounted
/boot over the
/boot mounted by default in SystemRescueCD (is this problematic because of the squashfs mount of the SystemRescueCD compressed image? It seems to work since I accomplished the mount after SystemRescueCD was fully launched). Then I bind-mounted the two grub locations described in the previous paragraph. All of this was made persistent in
At this point everything is still working. But when I run
grub-mkconfig on SystemRescueCD I get the error "failed to get canonical path of
none" as described in this post. (I thought this post was my answer but we diverge in that I only have one
/boot mounted). I also tried mounting the root file system for Ubuntu and ran its
grub-mkconfig (scares me but I tried anyway) with the same result.
Does anyone know how I can get this approach working? If not, what is the smallest divergence from what I'm doing to get set up so I can have Ubuntu installed and rescue partition installed on a separate partition from which I can also modify GRUB?