=====================================Solaris 10======================================
以一台机器为例:我的/export/home路径下有四个文件夹:aaa、bbb、ccc、ddd
目的是:
共享/export/home/aaa 映射到/export/home/bbb
共享/export/home/ccc 映射到/export/home/ddd
修改/etc/dfs/dfstab文件
- bash-3.00# vi /etc/dfs/dfstab
- "/etc/dfs/dfstab" 12 lines, 430 characters
- # Place share(1M) commands here for automatic execution
- # on entering init state 3.
- #
- # Issue the command 'svcadm enable network/nfs/server' to
- # run the NFS daemon processes and the share commands, after adding
- # the very first entry to this file.
- #
- # share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource]
- # .e.g,
- # share -F nfs -o rw=engineering -d "home dirs" /export/home2
- share -F nfs -o /export/home/ccc
- share -F nfs -o /export/home/aaa
- share -F nfs -o /export/home/aaa
如果是共享给另外一台或者两台机器
- share -F nfs -o rw=app1:app2 /opt/arcgis/server/serverdir
- share -F nfs -o rw=59.255.44.13 /opt/arcgis/server/serverdir
然后执行share命令
- bash-3.00# share /export/home/aaa
- bash-3.00# share /export/home/ccc
- bash-3.00# share
- - /export/home/ccc rw ""
- - /export/home/aaa rw ""
然后我们进行映射修改/etc/vfstab
- bash-3.00# vi /etc/vfstab
- "/etc/vfstab" 14 lines, 521 characters
- #device device mount FS fsck mount mount
- #to mount to fsck point type pass at boot options
- #
- fd - /dev/fd fd - no -
- /proc - /proc proc - no -
- /dev/dsk/c0d0s1 - - swap - no -
- /dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / ufs 1 no -
- /dev/dsk/c0d0s7 /dev/rdsk/c0d0s7 /export/home ufs 2 yes
- -
- /devices - /devices devfs - no -
- sharefs - /etc/dfs/sharetab sharefs - no -
- ctfs - /system/contract ctfs - no -
- objfs - /system/object objfs - no -
- swap - /tmp tmpfs - yes -
- 192.168.205.140:/export/home/ccc - /export/home/ddd nfs - yes -
- 192.168.205.140:/export/home/aaa - /export/home/bbb nfs - yes -
那个机器共享的IP:共享机器共享的路径 - 映射到本机的路径 nfs - yes -
- 192.168.205.140:/export/home/ccc - /export/home/ddd nfs - yes -
- 192.168.205.140:/export/home/aaa - /export/home/bbb nfs - yes -
然后执行mount命令
- bash-3.00# mount /export/home/ddd
- nfs mount: mount: /export/home/ddd: Device busy
- bash-3.00# mount /export/home/bbb
- nfs mount: mount: /export/home/bbb: Device busy
- bash-3.00# mount
- / on /dev/dsk/c0d0s0 read/write/setuid/devices/intr/largefiles/logging/xattr/one rror=panic/dev=1980000 on Mon Jun 25 13:47:53 2012
- /devices on /devices read/write/setuid/devices/dev=4780000 on Mon Jun 25 13:47:3 9 2012
- /system/contract on ctfs read/write/setuid/devices/dev=47c0001 on Mon Jun 25 13: 47:39 2012
- /proc on proc read/write/setuid/devices/dev=4800000 on Mon Jun 25 13:47:39 2012
- /etc/mnttab on mnttab read/write/setuid/devices/dev=4840001 on Mon Jun 25 13:47: 39 2012
- /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4880001 on Mon Jun 25 13:47:39 2012
- /system/object on objfs read/write/setuid/devices/dev=48c0001 on Mon Jun 25 13:4 7:39 2012
- /etc/dfs/sharetab on sharefs read/write/setuid/devices/dev=4900001 on Mon Jun 25 13:47:40 2012
- /lib/libc.so.1 on /usr/lib/libc/libc_hwcap1.so.1 read/write/setuid/devices/dev=1 980000 on Mon Jun 25 13:47:49 2012
- /dev/fd on fd read/write/setuid/devices/dev=4a80001 on Mon Jun 25 13:47:53 2012
- /tmp on swap read/write/setuid/devices/xattr/dev=4880002 on Mon Jun 25 13:47:55 2012
- /var/run on swap read/write/setuid/devices/xattr/dev=4880003 on Mon Jun 25 13:47 :55 2012
- /export/home on /dev/dsk/c0d0s7 read/write/setuid/devices/intr/largefiles/loggin g/xattr/onerror=panic/dev=1980007 on Mon Jun 25 13:48:56 2012
- /export/home/bbb on 192.168.205.140:/export/home/aaa remote/read/write/setuid/de vices/xattr/dev=4b00006 on Mon Jun 25 14:46:42 2012
- /export/home/ddd on 192.168.205.140:/export/home/ccc remote/read/write/setuid/de vices/xattr/dev=4b00007 on Mon Jun 25 14:59:44 2012
在机器1上共享的路径下创建一个文件,在机器2的相关映射路径下能够看到。
