[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sharing /home and swap space between two Linux systems



Dear People,

I'm planning to buy a new computer and install Debian on it. I haven't got
around to the buying yet, and I had a spare 2 Gig on one of the drives of
my current computer, so I decided to install Debian on it. The install
went very smoothly, though it was facilitated by the fact that I could
copy config files over from my old installation. However, there are still
a few minor issues outstanding, the most significant of which is that I
would like to share /home between the two Linux systems now on the drive.
I have some idea of how to do this, and will sketch it below. I would
appreciate it if people would tell me if anything I am thinking is a bad
idea.

Basic setup: I have two disks, hda and hdb. They are mounted as follows.

/dev/hda1  Win 95 installation
/dev/hda2  Debian (root partition)
/dev/hdb1  /boot (SuSE) 
/dev/hdb2  swap partition (SuSE)
/dev/hdb3  SuSE (root partition)

As you can see, part of the difficulty lies in the fact that the whole
system is in one partition. This was the SuSE 6.2 default at the time,
which it never occurred to me to change.

I would like to share the SuSE /home (my only /home till now). When
running Debian, I have mounted /dev/hdb2 as /mnt/suse. My thinking is that
I could rename my current home directory to /home/faheemold, make a
symlink from /home/faheem to /mnt/suse/home/faheem. This will take care of
the home directory.

But I still need to worry about my inbox. So I will put a symbolic link in
/var/spool/mail called faheem which points to the "real" mailbox
/mnt/suse/var/spool/mail/faheem. This takes care of the inbox.

The most obvious problem with this is

1) a) My user id on SuSE is 500. My user id on Debian is 1000. Clearly I
will need to reconcile these. I think I would prefer to change my Debian
uid to 500. I'm not sure how to do this. I could try editing /etc/passwd
my hand, but this might be dangerous.

The SuSE /etc/passwd has as my entry

faheem:x:500:100:Faheem Mitha:/home/faheem:/bin/bash

The 500 corresponds to the faheem uid, and the 100 corresponds to the
group id for users. Is there a reason why this group is special? I belong
to other groups.

The Debian /etc/passwd has

faheem:x:1000:1000:Faheem Mitha,,,:/home/faheem:/bin/bash

The 1000 corresponds to the faheem uid, and 1000 to the group faheem.

Fortunately, Debian also has a group called users with gid 100, otherwise
things would have really got complicated.

I think I would like to change the Debian uid. If I simply change the uid
faheem in /etc/passwd from 1000 to 500 then will everything be hunky-dory?
Or is there a better way to do this?

b) Also, there is a possible problem with reconciling initialisation files
in my (SuSE) home directory, which might not work with different copies of
the same program in two systems, and also there might be problems with the
.bashrc. But I could try to deal with this on a case by case basis. Is
there a simple way of doing

if (Debian)
	read this section of the file
else
	ignore  ?

Also...

2) I realised after installing that I could have used my SuSE swap
partition as swap space for my Debian system. Is it too late now?

On a side note, I read in an article a couple of years ago, that Debian
would greet its installer on successful completion with "Happy Hacking".
I've installed it (twice), but have yet to see this greeting. A pity. I
would quite like it.

                                           Sincerely, Faheem Mitha.



Reply to: