Why can't I create a home directory under /home?

Why can't I create a home directory under /home?


For Solaris,
/home is not an on-disk file system, it is a file system under the
control of the automounter, and only the automounter can create
directories/files in it.


If you don't want the automounter to manage /home, then remove the
"/home" entry from /etc/auto_master
(and issue the command "automount -v" to force the file
to be reread, or reboot).


However, the typical setup for Solaris is to locate user's home directories
in /export/home.


/home is intended to be where all users' home directories appear regardless
of which machine they are really located on--by virtue of the
automounter and auto_home map. This makes your home directory
always appear in the same place regardless of which machine you
login to, and regardless of which server the sysadmin decides to move
your home directory.


If you are not part of a network with workstations and servers,
this may look strange. If you want to, as a demonstration, you can
set up a standalone workstation to operate this way, as follows.
(I'm assuming you still have the default setup of /home under the control
of the automounter.)


Create a user with a home directory in /export/home, say,
/export/home/andrew, so that the directory is correctly created
with .profile, .login, etc in it.


Put the following line in /etc/auto_home:


andrew cucumber:/export/home/andrew

(substitute your user name for 'andrew' and your hostname for 'cucumber').
If there is an "+auto_home" entry in there, comment it out.
Make the automounter reread the files: "automount -v".


You should now be able to "ls /home/andrew" and see the files there
which are in /export/home/andrew.



If you issue the command "mount -p", you will see that
/export/home/andrew has been mounted on /home/andrew (by the
automounter). Normally this would be an NFS mount to a remote server,
but in this case the system has spotted that is it attempting to NFS
mount itself and uses the loop-back filesystem instead (lofs) which
avoids the NFS overhead when the filesystem is on the same machine.


Finally, to complete the use of /home, you should change Andrew's entry
in the passwd file such that the home directory is /home/andrew.


In a networked environment, you also need to add /export/home to the
/etc/dfs/dfstab file so that it is available for other clients to mount.
Also, the password file and /etc/auto_master file (and much more
besides) would be obtained using naming services from a single networked
copy, so you would only need to set this up once whatever the size of
your network, not once per workstation.


[Thanks to Andrew Gabriel]




Home
FAQ