Solved

Mounting home directory

Posted on 2004-08-02
6
760 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
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

828 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