Ever since I first used Linux, I’ve been a distro hopper. This means that instead of just installing Ubuntu (or OpenSUSE or Fedora), and sticking with it, I tend to try out a lot of different varieties of Linux. I’ll use Ubuntu one week, switch to Mint Linux the next, then maybe try Kubuntu or Fedora or something else, all in the “quest” to find the perfect Linux for me. What this means is that keeping all my files off my main installation partition is important, as when I install a new version of Linux, I usually wipe out the previous installation completely. A couple weeks ago I decided that enough was enough, and looked for a way to be able to install new versions of Linux as often as I want, but still keep all my files and program settings. It turns out this was easier than I expected. The key was creating a partition specifically for my Home folder, then making sure that home folder was never formatted or used for anything else.
First, if you currently have a standard Linux setup, it’s likely that your Home folder is part of your root directory. Because of this, you’ll first need to either copy all your important files to another hard drive, or find a guide (there are some good ones out there), for backing up or moving your existing Home directory. Once that’s done, we’re going to format our hard drive so that from now on, we can always use the same Home directory.
I’m going to use Ubuntu in my examples but that’s just because I have installation discs at hand. The same basic steps should work fine for any Linux distribution, although the installer may look a bit different.
First, boot your computer with the installer disc in the CD drive. When the installer or Live CD boots up, start the installation process. The key step is when you arrive at the formatting or partitioning screen. Instead of creating a Root directory, a Files partition and a swap file (my previous setup), we’ll create a Root directory, a Home directory and a swap file. The difference is subtle, but important.
Linux saves personal settings in hidden files inside your Home folder. Things such as fonts, themes, wallpapers are saved there, in addition to many program settings. For instance, I am currently using VLC as my media player, and tweaked the interface so the button layout was the way I like it. This setting is saved in my Home folder. So if I can use the same Home folder every time I switch the variety of Linux I’m using, then I don’t have to tweak VLC time and again.
I chose this layout:
Partition 1 – my Root folder (designed as “/” in the file system)
Partition 2 – my Home folder (designated as “/home” in the file system)
Partition 3 – my swapfile (has no mount point)
On my computer, the partitions are /dev/sda1, /dev/sda2 and /dev/sda3, but those may be slightly different depending on the type of hard drive being used. Regardless, once those three partitions are created and in use, installing a new Linux distribution is simple.
But there is one thing we need to make sure of when performing subsequent installations. Usually, Linux installers want to erase any information on an already existing partition. When installing one Linux on top of another (for instance, installing Ubuntu when Fedora is already installed), this is necessary. But for the Home folder, we don’t want this. As you can see in the screenshot, there is a checkbox beside the home folder which gives the option to format a partition or to leave it alone. In sharing a Home folder, this box must be unchecked, so the partition is not formatted. If we format it, all our settings and files are lost; if we don’t format it, we can use the files regardless of which version of Linux is installed.
I’ve read that it’s also important in using a Home folder with multiple Linux distributions that it’s important to keep the same username and password. This makes sense, as the username and password associated with an account are the owners of the files inside the Home directory. Because of this, I could see instances where permissions to modify and save files don’t exist if the new account doesn’t match the old account (but couldn’t speak to that from person experience, as I always use the same account info).
And there you have it. Create three partitions, one for the installation, the other for a swap file and the third as the Home directory. Then, whenever you install a new version of Linux, just point to that directory as your Home directory, and be careful not to format it. From then on, it will be available, your files and preferences unchanged whenever, and whatever, you install.