Ubuntu – A common /home partition for multiple Linux distributions

dual-boothome-directory

I have an Ubuntu installed in one partition, Debian on the other and now I am planning to install backtrack and SUSE also. Debian mounts a separate partition as its home mount point, whereas Ubuntu contains its own home folder in its file system.

Now, I want my home partition to be shared by all other distros I have currently or might have on the future.

How can I do this?

P.S. I have same username & nicknames on all the distros

Best Answer

Ubuntus graphical installer does not automatically create a separate partition for /home. That's true. It is recommendable to do so though, and you can do it if you choose to manually partition. But even if you didn't, you can still fix it.

However, there are a few things to consider. First, make sure that all the distros can actually use the filesystem used on the home partition. It's usually not a problem, but better safe than sorry. Second, and this is more important; don't use the same home directory between distros unless you know what you're doing. The distros may have different versions of the installed software, meaning that their settings might not be identical. It should normally not be a problem since the applications should handle different versions properly, but not all do. It is perfectly fine to have a home directory with a different name than your username though, so that's not a problem.

If I'm reading correctly, you should have two partitions for Ubuntu (swap and root) and a few partitions for Debian. Then the first thing you do, is to mount Debians home directory in Ubuntu and make sure it's mounted at boot by adding it to /etc/fstab. There are loads of documentation on how to do this, so I won't go into it.

If you mount Debians home partition on /home, then it will hide Ubuntus /home directory, so mount it somewhere else first, in /mnt, for instance. Now you have to make some decisions. You can try to use the same home directory for all the distros if you want, or you can have a different home directory for each distro. You could for instance make a separate folder in /home for each distro like:

  • /home/ubuntu/username
  • /home/debian/username
  • /home/other_distro/username

I'd say that's the safest solution. I am assuming your home directories are not encrypted. If they are, then that will complicate things although the main procedure would be similar. You should probably be logged out of your main account when you do this, so create a new user, make it admin and login as that user.

You have to configure all the current users on all your distros to use the new location for the home directory. You should also configure the distros to use those paths by default for new users you create.

If you've mounted the home partition on /mnt, you'd then create /home/ubuntu and /home/debian. You then copy /home/username to /mnt/ubuntu/username and move /mnt/username to /mnt/debian/username (for the Debian user).

You now have both Ubuntu and Debians user homes in the same partitions, but in different home directories. If you have configured both Debian and Ubuntu to mount that partition in /home at boot and changed the users to use the new paths for their homes, then everything should be fine. When you intend to install a new distro, you'd first create /home/distroname/ and install as usual, but use the home partition and configure it to use /home/distroname as default location for new user homes. If you do that, make sure not to format it, otherwise you'll loose the data from Debian and Ubuntu :)

If you want to reuse a single home directory, make sure you know what you're doing. You would need to have the same uid for the users across the distros. Otherwise the permissions would be messed up.

Good luck and take backups :)

Related Question