28 November, 2010

How to share /home directory between two linux installations

            Frequent re-installations of operating system due to crashes  is always been a problem for many of the linux users, and my case is also the same.... Everytime i start with doing something like trying some new commands or editing some configuration files and finally ends up with an 'OS crash' and a fresh installation thereafter. Now it's been a very usual matter that i may have to install a fresh copy of linux distro probably once in a month. Sometimes the crash may occur due to installation of a new theme (last week editing some theme files manually after it's installation made my 10.04box stand on nails...), sometimes the crash may be the by-product of installation of an incompatible version of application etc...

While fighting with all these crashes and re-installations the major problem is related to backing up of the data and personal files stored in the /home folder. Usually the contents of the /home contains files and directories including apache's root directory, downloads, files received over bluetooth, joomla/html/php projects etc. So it's very important to back up data all the time Ubuntu is reinstalled.

Solution

One of the best solution to avoid this kind of frequent backup-restore problem is separate the /home directory from the root directory during the installation. The advantages of this separation comes in two ways

1. When a crash occurs to the OS the /home directory remains intact because it is a separate disk partition. So on reinstalling after the crash we can map the old /home partition of the crashed one as the /home of the new linux. This makes it possible to access the files as if before the crash occured.

2. It's easy to share the /home folder between any no of linux distributions installed parellely on your machine. During installation of each of the distro, we can select the partition to be shared as its /home. Better keep the filesystem type (eg:- ext4) same while selecting the /home of other distro as it's new /home. This can be useful even with linux distributions of different architecture using similar filesystem types(Ubuntu and fedora can share a common /home if the /home is mounted as ext4).

On the ground...


Select the manual partitioning options


Setting up the root partition 


Selecting the /home partition of the previously crashed or parellelly installed linux.


 
Mounting the /home partition of old linux as /home of new linux. Don't check the format box. If mistaken you may lose all the data due to disk format

2 comments:

Anonymous said...

if you have two different versions of ubuntu (say 9.04 and 10.04) some panel widgets may make problems due to the difference in the versions of their corresponding applications... Itz not a serious problem...

Muc on Sunday, December 25, 2011 said...

Hi:

I usually take your approach to partitionning, now my problem is when I want to have two (or more) linux distros on the same box. I'd like to use the contents of my home folder in both of them, except the specific configuration of each distro. I tried creating symlinks to my Downloads and Documents directories, but then I get some unwanted behavior, i.e. when I delete a file from within the file manager I get a message telling me that the file can't be sent to the recycle bin. Is there a way to make the filesystem layout more transparent to the rest of the applications? Thanks.

Post a Comment

speak out... itz your time !!!

 

Terminal Diary | techblog Copyright © 2009 Gadget Blog is Designed by jintu jacob Powered by Blogger