"Sharing a directory in Solaris" is a small information but i think it is useful for everyone. I tried to do this, on so many location, some time it is difficult to remember them. So here I am trying to record steps required to do this.

In order to share any directory u need to login as super user. Log into machine and do following steps.
vi /etc/dfs/dfstab

This is a file which is automatically used by 'shareall' command.

Enter directory u want share in this file in following format :-

share [-F fstype] [ -o options] [-d ""] [resource]

For example:-

# Here i am sharing "/export/home/shared/" directory read only for every one.
share -F nfs -o ro -d "shared dirs" /export/home/shared/

# Here i am sharing "/export/home/code_reviews" directory read and write for everyone.
share -F nfs -o rw -d "codereview dirs" /export/home/code_reviews

Now u can run shareall command
shareall

You can also verify this shared directory by following command

-bash-3.00# share
- /export/home/shared ro "shared dirs"
- /export/home/code_reviews rw "codereview dirs"
-bash-3.00#

Thats all..

Same thing can be done on Linux, edit to /etc/exports and running exportfs command does magic for us.

Comments:

Awesome - thanks! :)

Posted by dave on August 04, 2008 at 02:15 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by kmudupa