I have a bunch of CAD Sun boxes running SunOS 5.8. One of the computers has an external hard drive that I mounted to a directory called /storage. I mounted the /storage directory to the other Sun machines for file sharing, but also the users .profile file is in the /storage directory. ( We had an old drive that ran out of room and that was were the .profile file was for each person. I don't know if it's a good idea to have the .profile file on a share, I just don't know enough to change it, so I kept .profile on the new, bigger share ). All of the users that mount to the Sun box with the external drive are fine, and they login with no problems because they are setup to look for the .profile file in a /usr3 directory which is mounted from term1:/storage /usr3. I'm not sure how to set the .profile file for the user that has the external hard drive ( lets just call his computer term1 ) On term1 the external hard drive is mounted on /dev/dsk/c1t10d0s2 /storage. So I was hoping there is a way to link /storage to /usr3? Not sure if that would work, sorry to be so wordy, I'm just not sure how to describe this.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


A symbolic link should do the trick:

ln -s /storage /usr3

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's generally a bad idea to have a user's home directory (where their .profile is stored) on a network share unless you're doing it for purposes of having a portable home directory (meaning their profile and home directory follow them to different hosts).  If that is your goal, you need to make sure the network share is fairly highly available or else if there are network or storage problems your users will have trouble and your systems will slow down.

As for the user who is on the term1 host, robocat's suggestion is probably your best bet if you want to continue using NFS off of that drive.  
JeffBeallAuthor Commented:
It must be like you said about the roaming profile thing. The CAD people sometimes use different CAD boxes for some reason. So I tried ln -s /storage /usr3, but when I cd to /usr3 I run ls and get nothing in the directory. A ls on the other Sun boxes lists a bunch of directories?
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
to see files beginning with a dot, you will have to use
   # ls -a

An ls of /storage and /usr3 should give the same output if the link was created correctly.

You can check this with ls -l /

should give something like

usr3 -> /storage
When you say that users are set up to look for .profile in /usr3, I hope you mean there are individual home directories under /usr3 for each user, owned by those individuals... Not one shared home directory for all of them..?
Brian UtterbackPrinciple Software EngineerCommented:
I would expect that if the symbolic link did not work, then the attempt to change directory into the link
would have returned a "No such file for directory" error.

I am a little confused. You talk about the .profile file for each user, but that file is usually expected
to live in the user's home directory. Are you saying that all of your user's have home directory's
that are set to something like /usr3/username, but on this one machine, the user's home directories
live at /storage/username? If so, then the symbolic link given before should have done it.

The trick to diagnosing this is to take it step by step.

On the problem machine do this:

cd /
ls -ld /storage /usr3
/storage should show as a directory and /user3 should show as a link that points to /storage

These next two should produce nearly identical output:

ls -l /storage
ls -lL /user3

cd /user3

This should show that you are in /storage

Then change directory into the problem user's home directory.
cd username
ls -l .profile

Does it exist? If so, does it have the user as its owner.

If any of the above doesn't produce what they should, then let us know.
JeffBeallAuthor Commented:
I'm sorry I didn't explain this well. Hopefully this is a better picture of the setup. All CAD users .profile file lives in their own directory. So the structure likes like, /usr3/CADuser1, /usr3/CADuser1 and so forth, then in CADuser1's directory they have their .profile file. So for everyone's mount I used  
mount term1:/storage/usr3 /usr3
and I guess the profile or something tells Sun to look in /usr3/CADuserX given whoever logins, so if CADuser1 logins, Sun looks in /usr3/CADuser1's directory for .profile.
On one of the CAD machines there is an external hard drive with a large hard drive and that is where everybody's /usr3/CADuserX directory is. For the user that uses the CAD machine with the external hard drive I can't use   mount term1:/storage/usr3 /usr3, because they are on term1, and the external drive is mounted like this
/dev/dsk/c1t10d0s2 /storage.
So in the /storage directory a ls revels
usr3  lost+found  home  and so forth
Hopefully this helps. I will try blu's suggestion.
JeffBeallAuthor Commented:
the output for
cd /
ls -ld /storage /usr3
drwxr-xr-x  11  root         512  Feb  3  15:04  /storage
drwxr-xr-x    2  root         512  Feb  4  09:11  /usr3
There's your problem.  /usr3 is a directory instead of a symlink.  Verify that /usr3 is empty, and then remove the directory.  Then do the symlink creation:

rmdir /usr3
ln -s /storage /usr3

My guess is, if you do 'ls -l /usr3' you will see that there is a symlink under there that looks like:  /usr3/storage -> /storage

Brian UtterbackPrinciple Software EngineerCommented:
Okay, you left off one level of directory in your first message. Also, there apparently already is
a /usr3 directory on this system. So, when you did the link via "ln -s /storage /usr3" what you really did was
create a link called "storage" in the /usr3 directory.

So, first you should double check this. Look in the /usr3 directory and see if it is either empty or contains
a link called storage and nothing else. If it is empty or only has the single link in it, then delete the link,
and cd to /. Then execute "rmdir user3". If says that it is not empty, then look again. Double check with
"ls -la". That should show you ".", "..". If there are any hidden files, then you need to decide why they are there
and if appropriate, delete them and try the rmdir again.

Once /usr3 is gone, then you can do the command "ln -s /storage /usr3" and you should be all set.
Hmm... I missed that usr3 in the directory listing for /storage.  Is it possible that you were sitting in the /storage directory, and did  "ln -s /storage usr3" without the leading "/" on "usr3"?  Or is that a subdirectory?

JeffBeallAuthor Commented:
I cd to / then a pwd shows that I'm in /. Then I run
ls -l /usr3
and that shows.
lrwxrwxrwx   1  root   other      13  Feb  09:11   usr3 -> /storage/usr3

I tried rmdir /usr3  and get
rmdir:  directory "/usr3": Directory not empty
If I cd into /usr3, and ls I get usr3, so I cd into usr3, do a pwd and it shows
At this point I forgot to mention that the users home directories are actually in /usr3/user_logins/  After user_logins there are the users directories.
I must have done the ln command wrong to end up with /usr3/usr3. I think /usr3/usr3 must be a link because if I run  
du -sk /usr3  
I get
2     /usr3
but if I do a du on where the other CAD users are mounted to I get
du -sk /storage/usr3
19260427    /storage/usr3
Brian UtterbackPrinciple Software EngineerCommented:
Okay, you have a real directory that is called /usr3 and it contains a line
in it that points to /storage/usr3.

Do this:

cd /usr3
rm usr3
ln -s /storage/usr3/user_logins

I think that will do it for you. Note, there is no second file name in the ln, just the on, but you must do it
within the /usr3 directory.
If you want /usr3 to look exactly like /storage, then you need to do:

cd /
rm /usr3/usr3
rmdir /usr3
ln -s /storage /usr3

Brian UtterbackPrinciple Software EngineerCommented:
Another possibility that presents itself, is that you could use loopback filesystems. Where the other
systems had a line in the vfstab that mounted the file system via NFS, you could simply use essentially
the same line on this system, but change the type from nfs to lofs, and remove the part about
"term1:", so that it would show /storage for the source and /usr3 for the mountpoint.
JeffBeallAuthor Commented:
Thanks for all the help. The ln -s thing works now. I'm always impressed with how quick the response is, and how knowledgeable everyone is. I accepted multiple solutions based on number of responses. Hope this seems fair, thanks again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.