Solved

Mounting home directory

Posted on 2004-08-02
6
763 Views
Last Modified: 2013-12-27
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
0
Comment
Question by:RyanSD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 11695808
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
 

Author Comment

by:RyanSD
ID: 11695970
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
 
LVL 7

Expert Comment

by:glassd
ID: 11697451
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 3

Accepted Solution

by:
Mike R. earned 150 total points
ID: 11699429
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
 
LVL 40

Expert Comment

by:jlevie
ID: 11699536
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
 

Author Comment

by:RyanSD
ID: 11710130
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

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question