您尚未登录。

#1 2014-10-11 14:33:45

隨風浮雲
会员
注册时间: 2014-10-11
帖子: 4

nfs 和 samba 無法看到分享的資料夾

請教 nfs 和 samba 問題:

我在 Debian 系統上是可以正常看到 nfs 和 samba 分享出來的資料夾,但是我依照
https://wiki.archlinux.org/index.php/NFS
https://wiki.archlinux.org/index.php/samba
這二個網站的設定,無論是linux 系統下或是windows 7下都是完全看不到nfs 和 samba 分享出來的資料夾,請問有什麼地方是會設定錯誤呢?
nfs的安裝
pacman -S nfs-utils
再來設定 /etc/idmapd.conf
[General]
Verbosity = 1
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = atomic

[Mapping]

Nobody-User = nobody
Nobody-Group = nobody
再設定 /etc/exports
/mnt/hd 192.168.1.0/24(rw,no_subtree_check,nohide)

最後 exportfs -rav 確認/mnt/hd是分享正確。

而 samba 是
pacman -S samba

再設定 /etc/samba/smb.conf
[global]
security = SHARE
workgroup=workgroup
host allow =192.168.1.0/24
[share]
comment = share
path = /mnt/hd
read only = No
guest ok = Yes
browseable = yes
writable = yes

再用testparm 確認無誤
restart samba

以上的程序有那裡錯誤或是少做的?

离线

#2 2014-10-11 15:41:59

atmouse
会员
注册时间: 2011-08-24
帖子: 701

Re: nfs 和 samba 無法看到分享的資料夾

mount会提示错误
我肯定你哪个步骤漏了

离线

#3 2014-10-11 20:04:39

隨風浮雲
会员
注册时间: 2014-10-11
帖子: 4

Re: nfs 和 samba 無法看到分享的資料夾

atmouse 说:

mount会提示错误
我肯定你哪个步骤漏了

因為我習慣 debian ,這是第一次使用 Archlinux ,mount 是有報錯,但是我還是無法判斷那裏出了錯誤,你能告訴我正確的方法嗎?

离线

#4 2014-10-11 21:44:49

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,478
个人网站

Re: nfs 和 samba 無法看到分享的資料夾

隨風浮雲 说:
atmouse 说:

mount会提示错误
我肯定你哪个步骤漏了

因為我習慣 debian ,這是第一次使用 Archlinux ,mount 是有報錯,但是我還是無法判斷那裏出了錯誤,你能告訴我正確的方法嗎?

我没有看到报错信息。

离线

#5 2014-10-11 23:38:51

隨風浮雲
会员
注册时间: 2014-10-11
帖子: 4

Re: nfs 和 samba 無法看到分享的資料夾

百合仙子 说:
隨風浮雲 说:
atmouse 说:

mount会提示错误
我肯定你哪个步骤漏了

因為我習慣 debian ,這是第一次使用 Archlinux ,mount 是有報錯,但是我還是無法判斷那裏出了錯誤,你能告訴我正確的方法嗎?

我没有看到报错信息。

smbclient -L 127.0.0.1 -U%
Connection to 127.0.0.1 failed (Error NT_STATUS_CONNECTION_REFUSED)

mount -t cifs //127.0.0.1/Downloads /mnt/test
Password for root@//127.0.0.1/Downloads:
Unable to find suitable address.

NFS 的部份已經解決了,不過還是有錯誤的地方。
systemctl restart nfs-common
Failed to restart nfs-common.service: Unit nfs-common.service failed to load: No such file or directory.
不過已正常連線,解決原因不知,就是一直修改重啟這三個指令。
systemctl restart rpcbind
systemctl restart nfs-common
systemctl restart nfs-server


執行 systemctl  status samba
* samba.service - Samba AD Daemon
   Loaded: loaded (/usr/lib/systemd/system/samba.service; disabled)
   Active: failed (Result: exit-code) since Sat 2014-10-11 23:54:49 CST; 28s ago
  Process: 25423 ExecStart=/usr/bin/samba $SAMBAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 25424 (code=exited, status=1/FAILURE)

Oct 11 23:54:49 lemaker systemd[1]: PID file /var/run/samba.pid not readable (yet?) after start.
Oct 11 23:54:49 lemaker systemd[1]: Started Samba AD Daemon.
Oct 11 23:54:49 lemaker samba[25424]: [2014/10/11 23:54:49.483163,  0] ../source4/smbd/server.c:475(binary_smbd_main)
Oct 11 23:54:49 lemaker samba[25424]: At this time the 'samba' binary should only be used for either:
Oct 11 23:54:49 lemaker samba[25424]: 'server role = active directory domain controller' or to access the ntvfs ...emote'
Oct 11 23:54:49 lemaker samba[25424]: You should start smbd/nmbd/winbindd instead for domain member and standalo... tasks
Oct 11 23:54:49 lemaker samba[25424]: [2014/10/11 23:54:49.485283,  0] ../lib/util/become_daemon.c:124(exit_daemon)
Oct 11 23:54:49 lemaker samba[25424]: STATUS=daemon failed to start: Samba detected misconfigured 'server role' ...ode 22
Oct 11 23:54:49 lemaker systemd[1]: samba.service: main process exited, code=exited, status=1/FAILURE
Oct 11 23:54:49 lemaker systemd[1]: Unit samba.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

執行 systemctl  status smb 
* smb.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
執行 systemctl status nmb
* nmb.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

最近编辑记录 隨風浮雲 (2014-10-11 23:57:33)

离线

#6 2014-10-12 00:27:08

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,478
个人网站

Re: nfs 和 samba 無法看到分享的資料夾

Oct 11 23:54:49 lemaker samba[25424]: At this time the 'samba' binary should only be used for either:
Oct 11 23:54:49 lemaker samba[25424]: 'server role = active directory domain controller' or to access the ntvfs ...emote'
Oct 11 23:54:49 lemaker samba[25424]: You should start smbd/nmbd/winbindd instead for domain member and standalo... tasks
Oct 11 23:54:49 lemaker samba[25424]: [2014/10/11 23:54:49.485283,  0] ../lib/util/become_daemon.c:124(exit_daemon)
Oct 11 23:54:49 lemaker samba[25424]: STATUS=daemon failed to start: Samba detected misconfigured 'server role' ...ode 22

另外没有 nfs-common.service 这个服务吧。

离线

#7 2014-10-12 01:15:22

隨風浮雲
会员
注册时间: 2014-10-11
帖子: 4

Re: nfs 和 samba 無法看到分享的資料夾

百合仙子 说:

另外没有 nfs-common.service 这个服务吧。

wiki 是這樣寫的

By default, for NFSv3 operation rpc.statd and lockd use random ephemeral ports; in order to allow NFSv3 operations through a firewall static ports need to be defined. Edit /etc/conf.d/nfs-common.conf to set STATD_OPTS:

也許 NFSv4 就用不到,但是要如何指定port,不指定的話,iptables 無法訂規則,它會隨機選port。

离线

#8 2014-10-12 12:20:14

xgdgscarch
会员
注册时间: 2012-05-07
帖子: 191

Re: nfs 和 samba 無法看到分享的資料夾

samba 是  smbd 和 nmbd 服务.
nfs的wiki写的明明是

# systemctl restart nfs-config
# systemctl restart rpc-statd
# systemctl restart nfs-server

不知道你是怎么看的wiki。

离线

页脚