FreeNAS & FreeBSD

Discussion related to network/web services such as Apache, BIND Sendmail, etc.

FreeNAS & FreeBSD

Postby sk8harddiefast » 07 Apr 2011, 13:45

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 [FILE]/etc/rc.conf[/FILE] of my desktop computer
Code: Select all
nfs_client_enable="YES"

But Now what I must do? I have no idea and I am stuck.
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby Nukama » 07 Apr 2011, 17:28

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
[FILE]/etc/rc.conf[/FILE]
Code: Select all
#
# 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 [man]exports[/man] list ([FILE]/etc/exports[/FILE] on your FreeNAS) to [FILE]/etc/fstab[/FILE] 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 [FILE]/etc/hosts[/FILE].

[FILE]/etc/fstab[/FILE]
Code: Select all
FreeNAS.localdomain:/path/to/nfsshare /mnt     nfs     rw      0       0


Start nfs on the client:
[CMD="#"]nfsiod -n 4[/CMD]

Mount filesystems from [FILE]/etc/fstab[/FILE]:
[CMD="#"]mount -a[/CMD]

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

Look out for the right UserID and GroupID or you run into trouble with permissions.
Nukama
Member
 
Posts: 124
Joined: 10 Feb 2010, 22:43

Postby sk8harddiefast » 07 Apr 2011, 18:11

Ok. I made a step.
My /[FILE]etc/rc.conf[/FILE]
Code: Select all
nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"

My [FILE]/etc/hosts[/FILE]
Code: Select all
<<<<<<< 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.
[B]192.168.1.3      FreeNAS.localdomain[/B]
=======
# $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 [FILE]/etc/fstab[/FILE]
Code: Select all
# 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
[B]FreeNAS.localdomain:/mnt/80g     /mnt/80                           nfs       rw       0         0[/B]


But
Code: Select all
mount -a

Code: Select all
[tcp] FreeNAS.localdomain:/mnt/80g: RPCPROG_NFS: RPC: Program not registered
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby SirDice » 07 Apr 2011, 18:16

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

Have a look with [cmd=#]rpcinfo FreeNAS.localdomain[/cmd]

Then check if the filesystems are exported correctly:
[cmd=#]showmount -e FreeNAS.localdomain[/cmd]
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16149
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby sk8harddiefast » 07 Apr 2011, 18:20

Code: Select all
 rpcinfo FreeNAS.localdomain
Return:
Code: Select all
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: Select all
showmount -e FreeNAS.localdomain
Return:
Code: Select all
Exports list on FreeNAS.localdomain:
/mnt/80g                           192.168.1.0


My FreeNAS have this IP: 192.168.1.3
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby SirDice » 07 Apr 2011, 18:24

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.
User avatar
SirDice
Old Fart
 
Posts: 16149
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby sk8harddiefast » 07 Apr 2011, 18:27

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 :)
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby Nukama » 07 Apr 2011, 18:31

In your [FILE]/etc/rc.conf[/FILE] comment out following (stop the services/restart FreeBSD):
Code: Select all
#rpc_lockd_enable="YES"
#rpc_statd_enable="YES"


Maybe FreeNAS isn't concerned about file locking.
Nukama
Member
 
Posts: 124
Joined: 10 Feb 2010, 22:43

Postby SirDice » 07 Apr 2011, 18:32

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

Code: Select all
nfs_server_enable="YES"


Or everything:
Code: Select all
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.
User avatar
SirDice
Old Fart
 
Posts: 16149
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby SirDice » 07 Apr 2011, 18:36

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.
User avatar
SirDice
Old Fart
 
Posts: 16149
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby sk8harddiefast » 07 Apr 2011, 18:44

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: Select all
[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.
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby Nukama » 07 Apr 2011, 19:01

Maybe [FILE]/etc/hosts.allow[/FILE] 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: Select all
Exports list on FreeNAS.localdomain:
/mnt/80g                           192.168.1.0


But should be
Code: Select all
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.
Nukama
Member
 
Posts: 124
Joined: 10 Feb 2010, 22:43

Postby sk8harddiefast » 07 Apr 2011, 19:42

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

Code: Select all
#
# 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
[B]ALL : 192.168.1.0 : allow[/B]

# 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
[B]#rpcbind : ALL : deny
rpcbind : 192.168.1.0/255.255.255.0 : allow[/B]

# 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."
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby sk8harddiefast » 07 Apr 2011, 21:09

After rebooting NAS server I get this:
Code: Select all
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
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby sk8harddiefast » 08 Apr 2011, 12:21

Problem solved. NFS was not enable as service on NAS. Now is working. Thanks a lot on @Nukama for his help :)
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]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!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece


Return to Web & Network Services

Who is online

Users browsing this forum: No registered users and 1 guest