+ -
当前位置:首页 → 问答吧 → freebsd 7.3如何安装nfs server?

freebsd 7.3如何安装nfs server?

时间:2010-09-13

来源:互联网

我安装的时候记得没有选择nfs,那么系统安装完成之后,如何安装,并简单共享一个/home的文件系统呢?

我在网上看到一篇帖子说是安装/usr/ports/math/rpc

cd /usr/ports/math/rpc
make install clean

然后确认 /etc/exports中的内容如下:


QUOTE:
/home -ro bsd01



/etc/rc.conf


QUOTE:
# Created: Thu Sep  9 22:10:55 2010
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
ifconfig_msk0="inet 172.27.186.66  netmask 255.255.255.0"
defaultrouter="172.27.186.1"
sshd_enable="YES"
inetd_enable="YES"
hostname="bsd01"
ntpd_enable="YES"
# -- sysinstall generated deltas -- # Fri Sep 10 21:59:31 2010
rpcbind_enable="YES"
nfs_server_enable="YES"
nfs_client_enable="YES"
inetd_enable="YES"
# -- sysinstall generated deltas -- # Mon Sep 13 11:34:50 2010
nfs_client_enable="YES"
nisdomainname="NO"



reboot
showmount -e bsd01


QUOTE:
Exports list on bsd01:



为啥我就共享不出来嗫?

作者: nimysun   发布时间: 2010-09-13

本帖最后由 congli 于 2010-09-13 17:35 编辑

系统默认自带nsfd. 不需要安装任何软件.

/etc/rc.conf:
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_enable="YES"
mountd_flags="-r"


/etc/exports:
/home/pxe/iso -maproot=root -network 10.0.0.0 -mask 255.255.0.0

作者: congli   发布时间: 2010-09-13



QUOTE:
系统默认自带nsfd. 不需要安装任何软件.

/etc/rc.conf:
nfs_server_enable="YES"
nfs_server_flags="- ...
congli 发表于 2010-09-13 17:31



谢谢。已经解决。但是不知道原因在哪里?

cd /usr/ports/math/rpc && make install clean
cd /usr/ports/net/pcnfsd && make install clean
cd /usr/ports/net/unfs3 && make install clean

然后一reboot就可以了。

现在我还是bsd新手,没有精力去查究竟是为什么。其他的配置文件都没有动。

作者: nimysun   发布时间: 2010-09-13



QUOTE:
系统默认自带nsfd. 不需要安装任何软件.

/etc/rc.conf:
nfs_server_enable="YES"
nfs_server_flags="- ...
congli 发表于 2010-09-13 17:31




   
专门测试一下,就像你这样做,不要安装ports下面的packages也是可以的。

bsd01# w
6:40PM  up 34 secs, 1 user, load averages: 1.07, 0.33, 0.12
USER             TTY      FROM              LOGIN@  IDLE WHAT
root             p0       10.208.248.69     6:40PM     - w
bsd01# more /etc/exports
#The following examples export /usr to 3 machines named after ducks,
#/usr/src and /usr/obj read-only to machines named after trouble makers,
#/home and all directories under it to machines named after dead rock stars
#and, /a to a network of privileged machines allowed to write on it as root.
#/usr                   huey louie dewie
#/usr/src /usr/obj -ro  calvin hobbes
#/home   -alldirs       janice jimmy frank
#/a      -maproot=0  -network 10.0.1.0 -mask 255.255.248.0
#
# You should replace these lines with your actual exported filesystems.
# Note that BSD's export syntax is 'host-centric' vs. Sun's 'FS-centric' one.
#/usr/ports  -alldirs -ro -network 172.27.186.0 -mask 255.255.255.0
/home -ro
bsd01# showmount -e bsd01
Exports list on bsd01:
/home                              Everyone


比较纳闷。赫赫。

作者: nimysun   发布时间: 2010-09-13