Mounting home directory

Hello,

Can I mount a user home directory (/home/username) from one system to (/home/username) another system by putting entry in /etc/vfstab like :

systemA:/home/username    -   /home/username   nfs   -   yes  rw

where username directory is already created?

If so, does it effect other users' home directory (on the second system) that mounted from NIS master server?

Also, does the (second) machine need to be restarted? If not, what command needs to be run to have the mounted point working?

Thanks in advance for your help.

RyanSD
RyanSDAsked:
Who is Participating?
 
Mike R.Connect With a Mentor Commented:
Hard to really understand what the question is.  

First part of the question:
Everybody above is, of course, correct...and just for clarification (from what it sounds like part of the question is) having one user's home dir mounted via /etc/vfstab will not affect DIFFERENT users which mount via NIS.  I.E...

-Three users...user1, user2 and user3.

-The dirs on server1...server1:/export/home/user1, server1:/export/home/user2, server1:/export/home/user2 (these are the dirs which are going to be mounted FROM.)  All three dirs are SHARED by one command (probably from the /etc/dfs/dfstab) which shares JUST /export/home (and, by assumption, all the dirs under it like user1, user2 and user3.)

-Three dirs on the client machine (or a myriad of client machines)...client:/home/user1, client:/home/user2, client:/home/user3

The different user dirs do not care at all by which method DIFFERENT home dirs are mounted.  I.E...
  a. You could mount user1 via /etc/vfstab "server1:/export/home/user1    -   /home/user1   nfs   -   yes  rw "
  b. Mount user2 via an NIS map.
  c. and mount user3 from a command line or RC (for whatever reason) "mount -F nfs server1:/export/home/user3  /home/user3"

Netiher the client machine, nor the serevr1, care by which method they are mounted.

Second part of the question:
The joy of UNIX is...rarely does the machine need to be restarted to make any change take affect (with the exception of kernel changes.)  Now, DAEMONS often need to be stopped and started, but this can be done with the /etc/init.d scripts.  I.E....

/etc/init.d/nfs.server stop
/etc/init.d/nfs.server start

...if the entire server daemon needed to be restarted.

However, if you add an entry to the /etc/dfs/dfstab or the /etc/vfstab, you just need to run the commands ...

shareall
mountall

...respectively to get the new changes to take place.

Best of Luck!
M


0
 
PsiCopCommented:
If I'm interpreting you correctly, then no, you can't have two subdirs in a directory with identical names. You could mount the second one as a name-variation (/home/username-NFS) or something like that. Or have /home/remote and mount the remote userdirs there instead of /home
0
 
RyanSDAuthor Commented:
Hi PsiCop,

I forgot to mention this: There is no home directory for this user on the NIS master server. In fact, the auto_home file set this user's home directory to the server that I want to mount to. Let me put it this way:

A is NIS master server
B is server that has user (called X) home directory reside on (the auto_home file of A has X home directory on B)
C is workstation that I want to mount the home directory from B. Since C is part of NIS, other users (but X) can log on C with home directory reside on A. B is also part of NIS

Please let me know if this is still not clear.

Thanks so much.
RyanSD
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
glassdCommented:
What you would normally do is put the home directories in here:
/export/home

You would then share out /export/home

On each machine (including the server) you would mount server:/export/home as /home

This enables you to put the mount into an automount map and have a common map for all machines.

If you had different home directories on different servers, you could then put entries like this into the automount map:

fred     server1:/export/home/fred
arnie   server2:/export/home/arnie

All your user passwd entries would be in the form:
/home/fred

Does this make sense.
0
 
jlevieCommented:
The most appropriate solution, in and NIS/NIS+ enviornment using the automounter, is to add:

username   systemA:/home/username

to the auto_home data on the NIS/NIS+ server.

While one could mount that NFS share elsewhere on the the system you can't have it appear in /home/username without including it in the auto home map/table.
0
 
RyanSDAuthor Commented:
Sorry for getting back here late due to other ongoing tasks :-). Thank you everyone for your GREAT inputs. I now can mount all the home directories from one server to different workstations.

Server:

Create entries in /etc/dfs/dfstab

share -F nfs -o rw=client1:client2:client3 /export/home

Start NFS daemon:

/etc/init.d/nfs.server stop (just to make sure no nfs will be running)
/etc/init.d/nfs.server start

run this command:

#shareall

On clients:

create entry in /etc/vfstab:

server:/export/home - /home nfs - yes rw,intr

then run this command:

#mountall

DONE!!!!



Best regards,
RyanSD
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.