4

I have a 2 year old laptop with Linux Mint 13 on it. Recently I've been having some problems with it (computer freezing, my settings suddenly disappearing and more) so I've been thinking about installing a new distro. I was recommended Xubuntu and I want to try it.

Is is possible to install it instead of my Mint, but keeping (it becoming my new /home) /home directory? I have lots of files in there, including various IDEs for various programming languages (my /home takes about 100 GB) and I'm 100% sure that if I decided to back up everything I would sooner or later realize that I forgot to backup something.

isklenar
  • 143
  • 1
  • 1
  • 5
  • 1
    If you want use two (or more) systems parallel with common home, take care about UID and GID on different distros! – uzsolt Mar 11 '14 at 17:40
  • as @schaiba says, this is possible if your /home is on a separate partition, which is probably a good idea anyway. otherwise, sharing between different distributions may be possible, but would be more of a hassle. not sure how that would work. you'd have to mount the containing partition, and then just expose that directory somehow. would be a mess. – Faheem Mitha Mar 11 '14 at 17:45
  • @uzsolt What does that mean? – isomorphismes Feb 25 '15 at 23:39
  • 1
    UID="user ID", GID="group ID". If you use distroA with user 'isomprhismes' and the UID is 1000, and use distroB same user but the UID is 500, will conflict (different permissions on distroA and distroB) - because the filesystem doesn't storage username, only the UID. – uzsolt Feb 26 '15 at 10:45

4 Answers4

5

First of all, it is always good to have /home on a different partition, precisely to enable multiple installations to use the same home (you can have them installed simultaneously on different partitions, all of them using the same home). But it's too late for it now.

You can always copy everything on a different hard drive (100GB is nothing nowadays). But you can also do what you want. You don't have to erase the entire hard drive to install linux, you can just remove the distro-specific files (/usr, /bin, /sbin, /lib, /var,... everything except home) and then proceed with the installation. However, you have to be careful - installation wizards are usually annoying and want to reformat and repartition your hard drive. You can usually state that you don't want to do that, but ubuntu is the most windows-like distro and there could be problems (I've never installed it for precisely that reason - it wants to be smarter than me and just gets in my way). I'd recommend you make a backup to an external drive just in case.

Resizing partitions is a tricky business and I wouldn't recommend it (it's not always possible to do it the way you want). What would I do? I'd just put in a new hard drive and have separate drives for home and system (system is also usually partitioned to separate /boot and sometimes /var from the rest).

Edit: after installation, if you don't assign the same user ids as before, the ownership will be messed up and you will have to chown the directory recursively.

orion
  • 12,302
  • 2
  • 31
  • 41
  • [This](http://askubuntu.com/a/55227/12518) says it's not too late if you didn't make a `/home` partition at the beginning. – isomorphismes Feb 25 '15 at 23:46
1

Yes, it is possible. Just make sure to tell the installer not to format that partition (you might want to write it down, for example /dev/sda3) and , as far as I know, the *buntu installer takes care of permissions afterwards. A backup is recommended anyway.

schaiba
  • 7,493
  • 1
  • 33
  • 31
1

if your home is not a separate partition, you should do the following steps:

  1. boot with a live

  2. resize your partition and create a new partition as home directory.

  3. format your new partition

  4. copy your home data to new partition

    And finally install your favorite distro.

PersianGulf
  • 10,728
  • 8
  • 51
  • 78
1

Whether your /home is on a separate partition or not, I recommend setting up a directory under /home in which you put everything that you want to share between the different environments. E.g. mine is called /home/avdndata and I have links from my actual home directories to the subdirectories of /home/avdndata this allows me explicitly share things that I know that work, while other configuration that have incompatibilities do not.

This way I have shared material normally kept in home between SuSE and Ubuntu and between different Ubuntu versions. Before installing a new version I make a backup of everything used by the old version (especially the shared stuff). And if, after the upgrade, some program that changes a configuration file in some backward incompatible way ( I have seen .ini files being replaced by .xml), you notice that when you start the old system and it complains. At that point you can move that configuration out of the shared directory, remove the link and restore the relevant files from your backup in the old version.

Anthon
  • 78,313
  • 42
  • 165
  • 222