Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When installing more than one Linux version on the same computer (for testing purposes e.g. Ubuntu 10.10 and 11.04), is it possible to have the same home folder (e.g. on a separate partition) on all Operating system versions?

share|improve this question
add comment

2 Answers

Although it is possible to have the same partition as a home partition on both installations, I would not recommend this: Apart from user files, the home folder includes also the settings for programs in hidden folders, and if the both operating system (OS) versions use the same programs in different versions, this can lead to conflicts.

Therefore it is better to only share only the user files. This can be done as follows:

  • On the first OS installation, just use a normal separate home partition
  • On the second OS installation, don't use a separate home partition, but bind all folders inside the home folder you want to share on both operating systems via /etc/fstab:
  • first, be sure to mount your home partition from the other OS somewhere. E.g., when your home partition is a ext3 partition on /dev/sda5, this fstab line does this: /dev/sda5 /mnt/sda5 ext3 defaults 0 2

  • now, bind all folders from that home partition to your own home folder on the second OS. This could also be done with a /etc/fstab line:

    /mnt/sda5/username/Downloads /home/username/Downloads none bind 0 0 does this for your Downloads folder. (adjust path to your own needs and repeat that with all other folders you want to.)

  • when you have finished /etc/fstab editing, remount all /etc/fstab entries by sudo mount -a.
share|improve this answer
    
I answered this myself to share this solution I found to be very useful. Additional tips and opinions are welcome! :-) –  tobi May 13 '11 at 16:49
    
+1, but why bind mounts and not symlinks? –  enzotib May 13 '11 at 16:57
    
@enzotib: I tried symlinks before, but that caused troubles: e.g., before creating a symlink, I renamed my Music folder to "Music-old" and then created a symlink from my other home partition's Music folder to ~/Music. But now, all programs looking for Music (e.g. Banshee) supposed them in "Music-old", not in "Music". (Same for Downloads and so on...) The System seems to have "remembered" the original folder although I renamed it. Using binds solved that problem for me. –  tobi May 13 '11 at 17:41
    
tobi: your problem with Music-old was not caused by symlinks - you renamed the folder via Nautilus, which is smart enough to notice that you renamed a special folder and to update its settings (i.e. "the folder for music is now ~/Music-old"). Editing /etc/fstab allowed you to "fool" Nautilus and swap the folder without it noticing, that's all. You could achieve the same by creating a symlink in terminal :) –  Sergey Oct 14 '11 at 13:59
add comment

I am currently running Fedora 15 and Ubuntu 11.10 on the first 2 partitions, but they both share the third partition as a home partition. It seemed the real conflict was trying to share the same directory, not the same partition. If you want to point out why what I did was so terrible I would love to hear it, but I have had no issues so far.

share|improve this answer
2  
So you're saying you have a real experience (not guesses) in sharing a home partition between Fedora and Ubuntu (i.e. they use the same home directory - is that right?) - and you experienced no problems? –  Sergey Oct 14 '11 at 14:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.