0

I tried search for an answer to this question but whether it was bad luck or ineptitude on my part I was unable to do so.

Here's the situation I'd like to get a better understanding of before attempting to undertake it.

I have a 2.0TB (or 1,862 GiB, which will make math easier in a bit) internal HDD upon which I would like to install 2 or 3 separate distributions because there's parts of all of them that I like although they can't all be in one distribution for one reason or another.

I'd like to partition my disk as follows:

|  Partition  |    Format   |     Use     |     Size    |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     sda1     |     EX2     |  Bios Boot  |     1 GiB*  |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     sda2     |     EX4     |  Linux-1 /  |    50 GiB   |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     sda3     |     EX4     |  Linux-2 /  |    50 GiB   |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     ....     |     ....    |  .....-# /  |    50 GiB   |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     sda4     |     Swap    |     Swap    |    12 GiB   |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     sda5     |     EX4     |     /usr    |   100 GiB   |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
                           TOTAL THUS FAR |   163 GiB   |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
                       REMAINING FOR HOME |  1,699 GiB  |
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
     sda6     |     EX4     |    /home    |  1,699 GiB  |
  • Bios Boot (/boot) will be much lower, but it was easier to calculate everything as GiB. MATH.

So anyway, I have several questions about doing this.

  1. Is it possible for 2 or more distrobutions to share the same /usr and /home partitions? In case you're wondering, I'd like to have access to everything in /home as well as everything in /usr like icons, themes, and so forth.
  2. Would the partition scheme above work?
  3. I know that some of these are going to have to be Logical partitions, however I have no experience using them. How would you go about setting that up if you were me?
  4. Assuming everything above seems legit, I seem to remember reading somewhere that whenever /usr is on a separate partition, you have to go through some extra steps in order for the OSes to boot up properly. If that's the case, what should I do to get this working properly?
  5. Let's also assume that I'm fairly new to linux but am learning so much about it very quickly. What are my chances of getting this right the first time? How about my chances of messing everything up altogether and having to re-install a single distro until I have more experience?

That's all I can think of for now. I'm happy to answer any questions you might have about this idea of mine. I'm very excited to hear what you have to share with me about this little project!

Seth
  • 58,122
Ev-
  • 305
  • 3
    I think you'd have better luck just sharing /home partitions, but even that could lead to problems. Two different distributions could require different versions of the same config files, and there are thousands of config options. Don't try this on your daily computer. Use a different computer to play with odd ideas like this. – Marc Jan 06 '16 at 20:29
  • If you use a GPT partition table instead of a msdos partition table, you are not limited to 4 primary partitions. – s3lph Jan 06 '16 at 20:32
  • I have multiple installs, but only share /mnt/data. Each install is 25GB with less than 13GB used including /home. Settings are small. If you want settings to be the same you can copy them. Similar to this but on one drive: http://askubuntu.com/questions/524943/dual-boot-with-ssd-and-hdd-storage OR: http://askubuntu.com/questions/223655/windows-ubuntu-dual-boot-share-files-between-os/223670#223670 If there is a chance drive will be used in the future with UEFI system, I might also add a 300MB FAT32 partition at beginning of drive, just in case. Difficult to add if drive is full of data. – oldfred Jan 06 '16 at 21:53

2 Answers2

4

I don't think that /usr would be a good idea because of then things might clash and replace each other with their Distro's files but for /home, even though it would be less damage than /usr on the same 2 distros, I still wouldn't recommend it unless you also want a corrupt system (Especially if you do things such as Hibernate, etc).

  • The only thing you have to watch out for with hibernation is make sure not to hibernate one OS and then boot or resume another. – psusi Jan 06 '16 at 21:33
4

Sharing /usr between distributions is so close to impossible as to make no difference. That's where program files reside, and one of the key differences between distributions is their different program files. Thus, the only way that sharing /usr would make any sense is if the two distributions were just different installations of one distribution, or possibly minor variants (like Ubuntu and Lubuntu). Even then, you'd have problems with conflicts because of different packages being installed, different package versions (even when they differ only during package upgrades), etc. Overall, it might be theoretically possible to share a /usr partition in some limited cases, but actually managing it would be impractical in the extreme; and in most cases (Ubuntu and Fedora, say), sharing /usr just plain won't work.

Sharing /home is more practical, but still presents some challenges. Basically, user configuration files (~/.config-for-some-program) often include distribution-specific references -- for instance, pointers to icons that might differ from one distribution to another. Differences can even exist between different versions of one distribution (Ubuntu 14.04 and 15.10, for instance). Thus, although sharing the /home partition is practical, it's important that you take steps to ensure that users on the different distributions have different home directories. In the case of Ubuntu, and many other distributions, this is most easily done by giving the users different usernames -- for instance, use a username of ubuntu for Ubuntu and fedora for Fedora; or trusty and wily for Ubuntu 14.04 and 15.10, respectively. After installation, you can change the username without altering the home directory location by using a tool like usermod, although this is best done from another account. (Personally, I usually activate direct root logins for things like this, although that's something that's discouraged by Ubuntu's security policy. That issue is a long debate in and of itself.)

One more point: You refer to the "Bios Boot partition," but I think you mean a separate /boot partition. Such a partition should not be shared between distributions. In most cases, a separate /boot partition is not required; but if you do use one, you'll need a separate /boot partition for each distribution. The issue is similar to the one of /usr, but less extreme -- kernels and GRUB configurations reside in /boot, so there's a possibility of file conflict, particularly for closely-related distributions.

OTOH, the name BIOS Boot partition refers to a small (typically ~1 MiB) partition in which GRUB stores part of itself. This partition has no filesystem; GRUB just dumps its code there "raw." It's used only by GRUB, only on GUID Partition Table (GPT) disks, and only when booting in BIOS/CSM/legacy mode (rather than in EFI/UEFI mode). On a new installation on new hardware, I recommend using EFI mode rather than BIOS mode, which obviates the need for a BIOS Boot Partition, but creates a need for an EFI System Partition (ESP), which is a ~100-1,000 MiB (I recommend >= 550 MiB) FAT32 partition that holds the EFI boot loader(s). One ESP can be shared between distributions. I realize I've just tossed out a whole bunch of terminology and concepts with which you may not be familiar. If so, good; you'll be better off learning about these things now rather than later, after you've botched your installation because you've made mistakes because you didn't understand what you were doing. Here are some references to help you avoid making such mistakes:

This is all simpler when single-booting because you don't need to coordinate boot modes between multiple distributions -- you can install one distribution in either BIOS mode or EFI mode and it doesn't really matter which mode you use. If the boot modes differ between two distributions, though, that's where the troubles begin.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • I see all your points. I suppose what I could do is install each to their own partition and then simply make an alias/link to the other one's /usr and /home for easy access between the two. Thanks a lot! You've saved me quite a headache it seems! – Ev- Jan 07 '16 at 22:49
  • Why do you want to access one distribution's /usr directory from another one? There's very little benefit to this, since /usr contains mostly distribution-specific stuff. Making such access too easy makes accidents in which you trash one installation from another much more likely. – Rod Smith Jan 09 '16 at 15:31