Novell Home

How to keep consistent user data across multiple installations of Linux on the same machine

Novell Cool Solutions: Trench
By Pim Dennendal

Digg This - Slashdot This

Posted: 2 Feb 2006
 

Applies to:

  • SUSE Linux 10.0
  • SUSE Linux Professional 9.2-9.3
  • Novell Linux Desktop 9
  • SUSE Linux Enterprise Server 9

PROBLEM: Multi-boot with different versions Linux mucks up the hidden file (.bashrc, etc,) and gives problems with choosing the right kernel/initrd.

SOLUTION: By its very nature this is really two seperate questions. Only the first is addressed here AND only in part. The original article suggested the use of (soft) links (ln -s <file-path> <my-link-name>). The problem was being addressed backwards and that was the rub.

The real problem is "How can I get hold of my data from every system?". The answer is very simple.

Make a second directory in /home such as /home/local. This is either used directly or as a mount point for the real "home" partition. For the paranoid, this may be .local - the DOT makes it hidden causing a very confusing // where you would expect a /.

Move all important AND user-visable directories from /home/<user-name> to /home/local/<user-name> maintaining all ownership (not root:root) and permissions (u-mask). Mostly, this ./bin ./Documents and ./public_html.

Make appropriate soft links (ln ../local/<user-name>/Documents Documents) for everything you moved. This makes them visible to the user under /home.

Unless you feel incredibly adventurous, DO NOT move the hidden files and directories. ,But, if you really are and just cannot help yourself, make a /home/local/<user-name>/etc/ as a catchall, move it there and then do you ln -s -bit.

Other things you can do:

Firstly secure /home so that your wonderfull and incredibly saintly users do not go and muck-up all this hard work - Well this ancient newbie is his very own hacker and in-house, too.

Secondly - and hopefully some bright spark will tell me how - Adjust /etc/skeleton so it all gets done automatically - Saves all the finger trouble.

For multi-booting with GRUB, please see my comments on my previous article.

EXAMPLE:

 # /bin/bash  --- running as root
# Make your real home-dir
mkdir /home/local
# make user home-dir
mkdir /home/local/pluto
chown  pluto:users ../local/pluto
# Go to original and move user-stuff
cd /home/pluto
mv bin ../local/pluto/bin
chown  pluto:users ../local/pluto/bin
ln ../local/pluto/bin bin
mv Documents ../local/pluto/Documents
chown  pluto:users ../local/pluto/Documents
ln ../local/pluto/Documents Documents
mv public_html ../local/pluto/public_html
chown  pluto:users ../local/pluto/public_html
chmod 0755 ../local/pluto/public_html
ln ../local/pluto/public_html public_html
# We are done for user named pluto aka doggie-features.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell