1de9c [Solved] FreeNAS & FreeBSD - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old April 7th, 2011, 14:45
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default FreeNAS & FreeBSD

Hi. I have set a FreeNAS server. Is running fine and I can get WebUI from My desktop. Now I want to mount FreeNAS hdd's on my desktop computer. According this: http://www.freebsd.org/doc/handbook/network-nfs.html I guess that my desktop computer is NFS client and FreeNAS is the NFS server. So I set to /etc/rc.conf of my desktop computer
Code:
nfs_client_enable="YES"
But Now what I must do? I have no idea and I am stuck.
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416

Last edited by sk8harddiefast; April 8th, 2011 at 13:22. Reason: A stack is a pile.
Reply With Quote
  #2  
Old April 7th, 2011, 18:28
Nukama Nukama is offline
Member
 
Join Date: Feb 2010
Posts: 109
Thanks: 18
Thanked 39 Times in 26 Posts
Default

Hi,

check, that you've exported the appropriate file-systems inside FreeNAS (ask in the FreeNAS forum for help on configuring FreeNAS for your purpose).
setup and user guide:nfs
setup and user guide:services nfs shares
setup and user guide:nfs client


On your FreeBSD client add following to
/etc/rc.conf
Code:
#
# NFS Client
#
nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
And insert the mount points corresponding to your nfs exports list (/etc/exports on your FreeNAS) to /etc/fstab for permanent use.
Use IP-Addresses if you have no name resolution, otherwise use a DNS server/forwarder or add the FreeNAS IP to your /etc/hosts.

/etc/fstab
Code:
FreeNAS.localdomain:/path/to/nfsshare /mnt     nfs     rw      0       0
Start nfs on the client:
# nfsiod -n 4

Mount filesystems from /etc/fstab:
# mount -a

Mount single filesystem which is exported from your FreeNAS box:
# mount -t nfs FreeNAS.localdomain:/path/to/nfsshare /mnt

Look out for the right UserID and GroupID or you run into trouble with permissions.

Last edited by Nukama; April 7th, 2011 at 18:40.
Reply With Quote
The Following User Says Thank You to Nukama For This Useful Post:
sk8harddiefast (April 7th, 2011)
  #3  
Old April 7th, 2011, 19:11
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

Ok. I made a step.
My /etc/rc.conf
Code:
nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
My /etc/hosts
Code:
<<<<<<< current version
::1			localhost localhost.lucifer
127.0.0.1		localhost localhost.lucifer
192.168.1.2		darkchaos.lucifer darkchaos
192.168.1.2		darkchaos.lucifer.
192.168.1.3		FreeNAS.localdomain
=======
# $FreeBSD: src/etc/hosts,v 1.16.34.1.6.1 2010/12/21 17:09:25 kensmith Exp $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1			localhost localhost.my.domain
127.0.0.1		localhost localhost.my.domain
#
# Imaginary network.
#10.0.0.2		myname.my.domain myname
#10.0.0.3		myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#	10.0.0.0	-   10.255.255.255
#	172.16.0.0	-   172.31.255.255
#	192.168.0.0	-   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
>>>>>>> 8.2-RELEASE
My /etc/fstab
Code:
# Device			       Mountpoint		            FStype		Options		Dump	Pass#
/dev/ad14s1b			          none			swap		sw		0	0
/dev/ad14s1a			          /			              ufs		rw		1	1
/dev/ad14s1d			         /tmp			ufs		rw		2	2
/dev/ad14s1f			         /usr			ufs		rw		2	2
/dev/ad14s1e		 	         /var			ufs		rw		2	2
/dev/ad10s1d            	                       /mnt/1000       	              ufs     	              rw                        1            1
/dev/ad16s1d            	                       /mnt/1500       	              ufs                   	rw                        1             1
/dev/cd0			                       /cdrom			cd9660		ro,noauto	0	0
/dev/acd0		                      /cdrom1			cd9660		ro,noauto	0	0
linproc 			                      /compat/linux/proc 	              linprocfs 	rw 		0	0
linsys  		                                    /usr/compat/linux/sys               linsysfs     	rw   		0	0
proc  			                      /proc  			procfs  	              rw 		0	0
FreeNAS.localdomain:/mnt/80g     /mnt/80                           nfs 		rw 		0         0
But
Code:
mount -a
Code:
[tcp] FreeNAS.localdomain:/mnt/80g: RPCPROG_NFS: RPC: Program not registered
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416

Last edited by sk8harddiefast; April 7th, 2011 at 19:18.
Reply With Quote
  #4  
Old April 7th, 2011, 19:16
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

Looks like nfsd and/or mountd isn't running on the server.

Have a look with # rpcinfo FreeNAS.localdomain

Then check if the filesystems are exported correctly:
# showmount -e FreeNAS.localdomain
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #5  
Old April 7th, 2011, 19:20
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

Code:
 rpcinfo FreeNAS.localdomain
Return:
Code:
program version netid     address                service    owner
    100000    4    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    3    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    2    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    4    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    3    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    2    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    4    tcp6      ::.0.111               rpcbind    superuser
    100000    3    tcp6      ::.0.111               rpcbind    superuser
    100000    4    udp6      ::.0.111               rpcbind    superuser
    100000    3    udp6      ::.0.111               rpcbind    superuser
    100000    4    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    3    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    2    local     /var/run/rpcbind.sock  rpcbind    superuser
    100005    1    udp6      ::.3.239               mountd     superuser
    100005    3    udp6      ::.3.239               mountd     superuser
    100005    1    tcp6      ::.3.239               mountd     superuser
    100005    3    tcp6      ::.3.239               mountd     superuser
    100005    1    udp       0.0.0.0.3.239          mountd     superuser
    100005    3    udp       0.0.0.0.3.239          mountd     superuser
    100005    1    tcp       0.0.0.0.3.239          mountd     superuser
    100005    3    tcp       0.0.0.0.3.239          mountd     superuser
and
Code:
showmount -e FreeNAS.localdomain
Return:
Code:
Exports list on FreeNAS.localdomain:
/mnt/80g                           192.168.1.0
My FreeNAS have this IP: 192.168.1.3
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
  #6  
Old April 7th, 2011, 19:24
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

There's no nfsd running on the server, hence no exports.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #7  
Old April 7th, 2011, 19:27
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

Quote:
There's no nfsd running on the server, hence no exports.
That means? What I must do? First time try to do this so, I just learn
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
  #8  
Old April 7th, 2011, 19:31
Nukama Nukama is offline
Member
 
Join Date: Feb 2010
Posts: 109
Thanks: 18
Thanked 39 Times in 26 Posts
Default

In your /etc/rc.conf comment out following (stop the services/restart FreeBSD):
Code:
#rpc_lockd_enable="YES"
#rpc_statd_enable="YES"
Maybe FreeNAS isn't concerned about file locking.

Last edited by Nukama; April 7th, 2011 at 19:47.
Reply With Quote
  #9  
Old April 7th, 2011, 19:32
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

No idea how to turn it on with FreeNAS. On FreeBSD you'd add something like this to /etc/rc.conf:

Code:
nfs_server_enable="YES"
Or everything:
Code:
rpcbind_enable="YES"
mountd_enable="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"
nfs_server_enable="YES"
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #10  
Old April 7th, 2011, 19:36
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

Oh, in case you started things by hand, make sure to start rpcbind first. Both mountd and nfsd need to register their RPC.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #11  
Old April 7th, 2011, 19:44
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

Pfff I tried the last 2 post but I get the same
On boot say: NFS server: ......re0 link up (That means that try to connect to FreeNAS)
But again return
Code:
[tcp] FreeNAS.localdomain:/mnt/80g: RPCPROG_NFS: RPC: Program not registered
. And I tried all options
Is everything on my fstab and hosts file fine? To be sure that the problem is not there.
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
  #12  
Old April 7th, 2011, 20:01
Nukama Nukama is offline
Member
 
Join Date: Feb 2010
Posts: 109
Thanks: 18
Thanked 39 Times in 26 Posts
Default

Maybe /etc/hosts.allow on FreeNAS will help, if it's not related to statd and lockd, which must run on both server and client to enable file locking and will refuse to connect, if it is only configured on the client.

@SirDice:
nfsd is running on the FreeNAS box
Code:
Exports list on FreeNAS.localdomain:
/mnt/80g                           192.168.1.0
But should be
Code:
Exports list on FreeNAS.localdomain:
/mnt/80g                           192.168.1.0/24
#or with the client IP
/mnt/80g                           192.168.1.2
to allow the mount.
Reply With Quote
  #13  
Old April 7th, 2011, 20:42
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

Also I change a little my /etc/hosts.allow

Code:
#
# hosts.allow access control file for "tcp wrapped" applications.
# $FreeBSD: src/etc/hosts.allow,v 1.23.10.1.6.1 2010/12/21 17:09:25 kensmith Exp $
#
# NOTE: The hosts.deny file is deprecated.
#       Place both 'allow' and 'deny' rules in the hosts.allow file.
#	See hosts_options(5) for the format of this file.
#	hosts_access(5) no longer fully applies.

#	 _____                                      _          _
#	| ____| __  __   __ _   _ __ ___    _ __   | |   ___  | |
#	|  _|   \ \/ /  / _` | | '_ ` _ \  | '_ \  | |  / _ \ | |
#	| |___   >  <  | (_| | | | | | | | | |_) | | | |  __/ |_|
#	|_____| /_/\_\  \__,_| |_| |_| |_| | .__/  |_|  \___| (_)
#					   |_|
# !!! This is an example! You will need to modify it for your specific
# !!! requirements!


# Start by allowing everything (this prevents the rest of the file
# from working, so remove it when you need protection).
# The rules here work on a "First match wins" basis.
ALL : ALL : allow

# Wrapping sshd(8) is not normally a good idea, but if you
# need to do it, here's how
#sshd : .evil.cracker.example.com : deny

# Protect against simple DNS spoofing attacks by checking that the
# forward and reverse records for the remote host match. If a mismatch
# occurs, access is denied, and any positive ident response within
# 20 seconds is logged. No protection is afforded against DNS poisoning,
# IP spoofing or more complicated attacks. Hosts with no reverse DNS
# pass this rule.
ALL : PARANOID : RFC931 20 : deny

# Allow anything from localhost.  Note that an IP address (not a host
# name) *MUST* be specified for rpcbind(8).
ALL : localhost 127.0.0.1 : allow
# Comment out next line if you build libwrap without IPv6 support.
ALL : [::1] : allow
#ALL : my.machine.example.com 192.0.2.35 : allow
ALL : 192.168.1.0 : allow

# To use IPv6 addresses you must enclose them in []'s
#ALL : [fe80::%fxp0]/10 : allow
#ALL : [fe80::]/10 : deny
#ALL : [2001:db8:2:1:2:3:4:3fe1] : deny
#ALL : [2001:db8:2:1::]/64 : allow

# Sendmail can help protect you against spammers and relay-rapers
sendmail : localhost : allow
#sendmail : .nice.guy.example.com : allow
#sendmail : .evil.cracker.example.com : deny
sendmail : ALL : allow

# Exim is an alternative to sendmail, available in the ports tree
exim : localhost : allow
#exim : .nice.guy.example.com : allow
#exim : .evil.cracker.example.com : deny
exim : ALL : allow

# Rpcbind is used for all RPC services; protect your NFS!
# (IP addresses rather than hostnames *MUST* be used here)
#rpcbind : 192.0.2.32/255.255.255.224 : allow
#rpcbind : 192.0.2.96/255.255.255.224 : allow
#rpcbind : ALL : deny
rpcbind : 192.168.1.0/255.255.255.0 : allow

# NIS master server. Only local nets should have access
# (Since this is an RPC service, rpcbind needs to be considered)
ypserv : localhost : allow
#ypserv : .unsafe.my.net.example.com : deny
#ypserv : .my.net.example.com : allow
ypserv : ALL : deny

# Provide a small amount of protection for ftpd
ftpd : localhost : allow
#ftpd : .nice.guy.example.com : allow
#ftpd : .evil.cracker.example.com : deny
ftpd : ALL : allow

# You need to be clever with finger; do _not_ backfinger!! You can easily
# start a "finger war".
fingerd : ALL \
	: spawn (echo Finger. | \
	 /usr/bin/mail -s "tcpd\: %u@%h[%a] fingered me!" root) & \
	: deny

# The rest of the daemons are protected.
ALL : ALL \
	: severity auth.info \
	: twist /bin/echo "You are not welcome to use %d from %h."
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
  #14  
Old April 7th, 2011, 22:09
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

After rebooting NAS server I get this:
Code:
Mounting NFS file systems:re0: link state changed to UP
[tcp] FreeNAS.localdomain:/mnt/80g: RPCPROG_NFS: RPC: Port mapper failure - RPC:
 Timed out
Also I forgot to say that I use FreeNAS-8.0-RC3-amd64
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416

Last edited by sk8harddiefast; April 8th, 2011 at 07:52.
Reply With Quote
  #15  
Old April 8th, 2011, 13:21
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,731
Thanks: 217
Thanked 143 Times in 89 Posts
Default

Problem solved. NFS was not enable as service on NAS. Now is working. Thanks a lot on @Nukama for his help
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FreeNAS] Marvell 88SE9128 & SB710 Arghtastic System Hardware 2 February 5th, 2011 11:03
[FreeNAS] FreeNAS + Diaspora : Need more FreeBSD Packages waazdakka Installation and Maintenance of FreeBSD Ports or Packages 4 January 24th, 2011 20:15
[FreeNAS] FreeNAS isn't booting properly, bad sectors in a raid5. Evil_AnAnAs General 4 September 15th, 2010 10:45
[FreeNAS] 3G sata card with freenas support sowens System Hardware 6 December 29th, 2009 08:47
libc.so.6 && FMOD && FreeBSD Sa3r Userland Programming & Scripting 6 February 5th, 2009 11:54


All times are GMT +1. The time now is 23:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0