Solved

Mounting home directory

Posted on 2004-08-02
6
757 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now