Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a working install of gentoo 3.12.21-r1 x86_64. Is it possible to create a folder : /funtoo and untar a fully functional funtoo backup into that folder and then use Grub2 to 'boot' into that folder as if it were the main linux partition?
I am trying to install multiple additional linux distros onto the same partition using unique folders.
the /funtoo (/dev/sda4/funtoo) folder has the entire funtoo distro including its own /boot, /sys, /proc, etc folders.
If you don't mind me asking - what is it you are trying to do? It may be much much easier just to use separate partitions. If shared space is your concern, maybe you can look at using ZFS (although not sure how easy it is to boot that). ZFS will let you create multiple partition spaces all using shared space. Then you should be able to just mount those as usual.
Basically, I want to know if it is possible to replace the root mount point: " /dev/sda4 / (root) " with a 'subfolder ON /dev/sda4 as in: /dev/sda4/funtoo or /dev/sda4/RHEL ... etc.
I do NOT want to use different partitions. That would be too easy. :-)
I want to have multiple flavors of Linux on a single partition with one overarching 'master' linux install. I imagine the structure would look like this:
/dev/sda1 = EFI
/dev/sda2 = BOOT
/dev/sda3 = SWAP
/dev/sda4 = / (root) <- master OS which is currently Gentoo
GRUB2 would be configured so that the Gentoo (master OS) boot was used, OR the Funtoo folder (child #1) /boot was used, OR the RHEL folder (child #2) /boot was used so the specific/unique Kernel (vmlinux + initramfs) for each distro could be activated at boot.
Yes, I could copy all the different Kernels to the master /boot partition and Grub them, but then I would have the issue of keeping all of the distro specific folders/files separated, and I do NOT want to share folders between distros. If I had subfolders, then that folder would essentially become the / (root) of the distro and operate from there with all of the necessary folders (/proc, /dev/, /bin, etc).
I have thought about 'chroot' and 'pivot_mount', but don't see how they would function like a partition mounted linux install. I have also thought about virtualization, but again, that would be the easy way out instead of finding a solution to the stated problem. :-)
I think that is where the custom initrd comes in from the post I linked. What you would pretty much have to do is build a custom initrd that will mount the folder over the root with a -o bind.
There are a couple of big gotchas though - anything that updates the initrd (kernel updates, etc) will break it. Pretty much everything out there I know of is designed to be partition-based. So it probably can be done, but it'll take a lot of work, and won't be very upgrade safe
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.