5

Before I start asking my question, I would like you to know that I am aware of the "Different linux distros sharing the same /home folder?" question already asked on this website. It did not quite answer my question though, and as it's too broad I don't think it ever will.

Is it possible to share the user directory between Ubuntu and Arch, and how to make that work? I'm talking about what's known as ~.

I already have Ubuntu installed, but I am really annoyed by outdated packages. I would like to run them next to each other so when I need to use new software I can use ArchLinux. I could just switch completely to ArchLinux, but I don't want to take any risks. (Maybe I'll hate it)

Just as a sidenote, my /home is on a different partition, but my users' directories also encrypted.

Jeroen
  • 807

2 Answers2

4

No problem. This is the easiest to do if home is a separate partition, but in any case, it can be done. Just put the mount in your fstab (regular mount if it is a partition, mount --bind if it is a subdirectory on another mounted hard drive).

The only catch is, all the users need to have the same uid's, otherwise the ownership will be wrong.

orion
  • 12,502
  • How to fix the user IDs? Will it work if my home directories are encrypted? – Jeroen Mar 11 '14 at 21:26
  • 2
    http://stackoverflow.com/questions/18248056/change-user-id-in-linux

    Encryption just means you need to do the same thing you did in the other installation to decrypt it.

    – orion Mar 11 '14 at 21:27
2

You have some problem:

  1. usernames and groupnames store with UIDs and GUIDs suppose you have username joe with id 1000 on ubuntu machine, and username joe has been stored with 1003 on Arch machine.
  2. some dot files contains some configuration files , you have separate version of application on two machines.
PersianGulf
  • 10,850
  • I only just realized, I also have my /home encrypted, so I'm guessing this is a no-go. – Jeroen Mar 11 '14 at 21:24
  • 1
    encryption shouldn't be a problem, it doesn't depend on the os but the credentials and key/passwords that can be transferred or reinitialized. – orion Mar 11 '14 at 21:26
  • 1
    You only just syncronize /etc/passwd and /etc/groups. – PersianGulf Mar 11 '14 at 21:28
  • 2
    Exactly. You can clone (copy or just mount --bind) the /etc/{passwd, group, shadow, gshadow} between distributions if they really have the same groups and users. If there are features specific to the distribution, just copy the relevant lines. – orion Mar 11 '14 at 21:43
  • Config files shouldn't be a problem, it's rare that the config becomes incompatible. – orion Mar 11 '14 at 21:53
  • +orion I'm guessing I could just partition the /etc/ and the /home/ in one partition, and use the same one for both distributions, and it'll work fine? I know it might have some problems with updated software as /etc/ is where the configuration files go, but surely a program doesn't just error on abundant lines. – Jeroen Mar 12 '14 at 13:18