LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 06-17-2014, 10:08 AM   #1
n0nuf2
LQ Newbie
 
Registered: Jun 2014
Posts: 2

Rep: Reputation: Disabled
Help: Multiple linux distros in folders...


Good morning.

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.

Physical schema:

/dev/sda1 EFI +32M
/dev/sda2 /boot +1024M
/dev/sda3 swap +16G
/dev/sda4 / +482G (gentoo install)

This method should hide/mask the contents of the top level gentoo linux distro and appear as if the folder /funtoo is actually the root of /dev/sda4 .

Grub2 should be able to load and use the /funtoo/boot/vmlinux-funtoo-debian and /funtoo/boot/initramfs-funtoo-debian kernels with this config.

Granted, I could chroot into this folder, but that is not what I am after as some functionality is unavailable in a chroot environment.

If possible, how do I setup grub.cfg, /funtoo/etc/fstab, etc config files to support this configuration?

Any information, guidance, step-by-step instruction appreciated. Alternatively, if this is not possible, please tell me how do do this effectively.

V/r,
Scott
 
Old 06-17-2014, 05:34 PM   #2
fang0654
Member
 
Registered: Oct 2003
Location: New York, NY
Distribution: Ubuntu
Posts: 110

Rep: Reputation: 28
You can try adapting the steps found here:

http://unix.stackexchange.com/questi...on-a-partition

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.
 
Old 06-17-2014, 06:33 PM   #3
n0nuf2
LQ Newbie
 
Registered: Jun 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
fang reply

Fang:

Thank you for your reply...

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

... Child OS #1 ...

/dev/sda4/funtoo = / (root)
/dev/sda4/funtoo/boot = BOOT

... Child OS #2 ...

/dev/sda4/RHEL = / (root)
/dev/sda4/RHEL/boot = boot

... and so on ...

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 hope this has made my intentions clearer.

V/r,
-S
 
Old 06-17-2014, 06:43 PM   #4
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Don't know if it could be done with folders, but I'm pretty sure you could boot disk images under the same partition.
 
Old 06-17-2014, 08:45 PM   #5
fang0654
Member
 
Registered: Oct 2003
Location: New York, NY
Distribution: Ubuntu
Posts: 110

Rep: Reputation: 28
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
 
Old 06-17-2014, 08:54 PM   #6
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
If you modify /usr/share/initramfs-tools/scripts/local, any time the initrd.img gets updated, it should update with the changes you've made.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions for folders on Linux in multiple AD environment boqler Linux - Software 1 05-29-2013 03:34 AM
Those of you with multiple Linux distros across multiple partitions ... SlowCoder General 14 05-15-2009 03:24 PM
multiple linux distros leovil Linux - Newbie 3 03-28-2009 05:26 PM
Can multiple linux distros use the same partitions? TheOneAndOnlySM Linux - Newbie 18 07-22-2003 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration