NFS. Need help

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Post Reply
grimly64
Simple Hen
Posts: 43
Joined: Sun Apr 17, 2011 2:38

NFS. Need help

Post by grimly64 » Sat Jan 25, 2014 0:40

can't get the NFS to broadcast. want the HDTwo and HDFive on the NFS and FYI not using systemd

IP address of the PC 192.168.1.10
IP address of the WD TV 192.168.1.12
Actual path to external Hard Drives /run/media/devos/HDTwo
Guess I want to use NFS version 3, but if can figure out what to do in in NFS version 4, just want either one to work.
Currently not using systemd,
NFS-utils-1.2.9 - Installed
NFS4-acl-tools 03.3. intalled
Libnfs 1.5.0 installed
Libnfsidmap 0.25 Installed (NFSV4 ID <-> name mapping library)

Code: Select all

systemctl start rpc-mountd
Failed to get D-Bus connection: No connection to service manager.

Code: Select all

rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  48981  status
    100024    1   tcp  48910  status
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100227    3   udp   2049  nfs_acl
    100021    1   udp  39878  nlockmgr
    100021    3   udp  39878  nlockmgr
    100021    4   udp  39878  nlockmgr
    100021    1   tcp  60380  nlockmgr
    100021    3   tcp  60380  nlockmgr
    100021    4   tcp  60380  nlockmgr
    100005    1   udp  32844  mountd
    100005    1   tcp  56545  mountd
    100005    2   udp  59583  mountd
    100005    2   tcp  43717  mountd
    100005    3   udp  51076  mountd
    100005    3   tcp  51366  mountd

Code: Select all

Code: Select all
     Devos-PC devos #  df -h
    Filesystem                      Size  Used Avail Use% Mounted on
    /dev/mapper/vg_devospc-lv_root   50G   17G   31G  35% /
    none                            3.9G  1.3M  3.9G   1% /run
    none                            3.9G   80K  3.9G   1% /dev/shm
    udev                             10M     0   10M   0% /dev
    cgroup_root                      10M     0   10M   0% /sys/fs/cgroup
    /dev/sda1                       477M  208M  240M  47% /boot
    /dev/mapper/vg_devospc-lv_home   58G   19G   37G  35% /home
    tmpfs                           3.9G   80K  3.9G   1% /dev/shm
    /dev/sdd1                       931G  848G   84G  92% /run/media/devos/HDTwo
    /dev/sdc1                       1.9T  1.8T   60G  97% /run/media/devos/HDFive

Code: Select all

Code: Select all
    Devos-PC devos # netstat -tn | egrep '2049|Active|Pro'
    Active Internet connections (w/o servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State  

Code: Select all

Code: Select all
    Devos-PC devos # /etc/init.d/nfsmount start
     * Starting NFS sm-notify ...                                                                        [ ok ]
     * Mounting NFS filesystems ...
    mount.nfs: mount point /media/HDTwo does not exist  

Code: Select all

Code: Select all
    In FSTAB
    nfs://192.168,1.10:/run/media/devos/HDTwo   /media/HDTwo   nfs    rw,_netdev,auto   0 0

Code: Select all

Code: Select all
    In EXPORTS
    //run/media/devos/HDTwo 192.168.1.11/255.255.0.0(rw,no_subtree_check,async,insecure,no_root_squash,fsid=0)

Code: Select all

in HOST.CONF

Code: Select all
    # /etc/host.conf:
    # $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/host.conf,v 1.1 2006/09/29 23:52:23 vapier Exp $

    # The  file /etc/host.conf contains configuration information specific to
    # the resolver library.  It should contain one configuration keyword  per
    # line,  followed by appropriate configuration information.  The keywords
    # recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.



    # This keyword specifies how host lookups are to be performed. It
    # should be followed by one or more lookup methods, separated by
    # commas.  Valid methods are bind, hosts, and nis.
    #
    order, hosts, bind,


    # Valid  values are on and off.  If set to on, the resolv+ library
    # will return all valid addresses for a host that appears  in  the
    # /etc/hosts  file,  instead  of  only  the first.  This is off by
    # default, as it may cause a substantial performance loss at sites
    # with large hosts files.
    #
    multi on

Code: Select all

In HOST.ALLOW

Code: Select all
    All: All

    portmap:ALL
    lockd:ALL
    mountd:ALL
    rquotad:ALL
    statd:ALL

Code: Select all

In etc/conf.d/nfs

Code: Select all
    # /etc/conf.d/nfs

    # If you wish to set the port numbers for lockd,
    # please see /etc/sysctl.conf

    # Optional services to include in default `/etc/init.d/nfs start`
    # For NFSv4 users, you'll want to add "rpc.idmapd" here.
    NFS_NEEDED_SERVICES="rpc.idmapd"

    # Number of servers to be started up by default
    OPTS_RPC_NFSD="8"

    # Options to pass to rpc.mountd
    # ex. OPTS_RPC_MOUNTD="-p 32767"
    OPTS_RPC_MOUNTD="-V 4 -V 3 -N 2" # supporte la version 3 et 4, mais pas la version 2

    # Options to pass to rpc.statd
    # ex. OPTS_RPC_STATD="-p 32765 -o 32766"
    OPTS_RPC_STATD=""

    # Options to pass to rpc.idmapd
    OPTS_RPC_IDMAPD=""

    # Options to pass to rpc.gssd
    OPTS_RPC_GSSD=""

    # Options to pass to rpc.svcgssd
    OPTS_RPC_SVCGSSD=""

    # Options to pass to rpc.rquotad (requires sys-fs/quota)
    OPTS_RPC_RQUOTAD=""

    # Timeout (in seconds) for exportfs
    EXPORTFS_TIMEOUT=80

    # Options to set in the nfsd filesystem (/proc/fs/nfsd/).
    # Format is <option>=<value>.  Multiple options are allowed.
    #OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096"


In summary: don't understand why in FSTAB, it is told exactly where the external hard drive is, ...nfs can't find it.
Also, on my network, no device can even see the IP addresss of the NFS,

Code: Select all

rc-update show 
       NetworkManager |      default                                  
 NetworkManager-setup |      default                                  
            alsasound |      default                                  
         avahi-daemon |      default                                  
             bootmisc | boot                                          
          consolefont | boot                                          
         cpufrequtils |      default                                  
                cupsd |      default                                  
                 dbus | boot                                          
                devfs |                                        sysinit
        device-mapper | boot                                          
              dmcrypt | boot                                          
                dmesg |                                        sysinit
           fbcondecor | boot                                          
                 fsck | boot                                          
             hostname | boot                                          
              hotplug | boot                                          
              hwclock | boot                                          
              keymaps | boot                                          
            killprocs |                        shutdown               
                local |      default nonetwork                        
           localmount | boot                                          
               logind | boot                                          
             loopback | boot                                          
                  lvm | boot                                          
                mdadm |      default                                  
              modules | boot                                          
             mount-ro |                        shutdown               
                 mtab | boot                                          
               net.lo | boot default                                  
                  nfs |      default                                  
             nfsmount |      default                                  
               procfs | boot                                          
                 root | boot                                          
            savecache |                        shutdown               
                 swap | boot default                                  
            swapfiles | boot                                          
               sysctl | boot                                          
                sysfs |                                        sysinit
            syslog-ng |      default                                  
         termencoding | boot                                          
         tmpfiles.dev |                                        sysinit
       tmpfiles.setup | boot                                          
                 udev |                                        sysinit
                  ufw |      default                                  
              urandom | boot default                                  
           vixie-cron |      default                                  
              x-setup | boot                                          
                  xdm |      default                                  
                  zfs | boot                                   

User avatar
linuxfluesterer
Old Dear Hen
Posts: 855
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: NFS. Need help

Post by linuxfluesterer » Sat Jan 25, 2014 13:31

grimly64 wrote:

Code: Select all

    Devos-PC devos # /etc/init.d/nfsmount start
     * Starting NFS sm-notify ...                                                                        [ ok ]
     * Mounting NFS filesystems ...
    mount.nfs: mount point /media/HDTwo does not exist 
Just a simple fact. You must define (mkdir) the mount point on your client by yourself, where you mount any device (here your nfs). Anyway, before you can connect a client to a server check on server as root, if any nfs is exported with:

Code: Select all

showmount -e
And, before I try with an fstab entry on my client, I would try to mount manually. For nfs there is no specific need to use systemd or sysvinit. You can us mixed, but each nfs parts (server & client) must be loaded and executed correctly.

-Linuxfluesterer (I love KDE ...)
Take away Facebook from me and let there be real people again...

User avatar
sabayonino
Sagely Hen
Posts: 3157
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: NFS. Need help

Post by sabayonino » Sun Jan 26, 2014 16:17

Hi

Code: Select all

 mount point /media/HDTwo does not exist 
somewhere in fstab you have "something" points to /media/HDTwo

Does /media/HDTwo exist ?

and

Bad

Code: Select all

nfs://192.168,1.10:/run/media/devos/HDTwo   /media/HDTwo   nfs    rw,_netdev,auto   0 0
This is wrong (most syntax errors in the IP address line)


right

Code: Select all

192.168.1.10:/run/media/devos/HDTwo   /media/HDTwo   nfs    rw,_netdev,auto   0 0 

check fstab client.
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

grimly64
Simple Hen
Posts: 43
Joined: Sun Apr 17, 2011 2:38

Re: NFS. Need help

Post by grimly64 » Mon Jan 27, 2014 2:00

Update, couldn't get systemd to work, changed to it, reboot, get blinking cursor. So got the newest ISO and reinstalled.

Now see that systemd and NFS is not easy, if working at all with each other. Many of the needed services are not there.

Tried @sabayonino suggested, could not get it to work.

192.168.1.10:/run/media/devos/HDTwo /media/HDTwo NFS rw,_netdev,auto 0 0

192.168.1.10 - ip address of the target (WDTV)
HDTwo is the name of the external hard drive
Path from root is /run/media/devos/HDTwo
/media/HDTwo is what is needed to mount....not sure why it isn't /media/devos/HDTwo
NFS is what it is
rw - read/write
_netdev - don't know what that does
auto - don't know what that does
0 0 - pretty sure this part is correct.


In summary - do have systemd working. (good thing)
none of the old commands work now /etc/init.d/nfs-restart (bad thing)

This happened when upgrading to rpc.
Why, when there is an upgrade, and is broken, is cool, I don't know.

User avatar
sabayonino
Sagely Hen
Posts: 3157
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: NFS. Need help

Post by sabayonino » Mon Jan 27, 2014 2:49

you're running OpenRc init script (/etc/init.d/nfs restart)

I'm not sure but Systemd provided nfs by default

[edit] setting up NFS with OpenRc is pretty easy :roll:
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

User avatar
sabayonino
Sagely Hen
Posts: 3157
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: NFS. Need help

Post by sabayonino » Mon Jan 27, 2014 13:05

regarding NFS i suggest to read gentoo wiki : https://wiki.gentoo.org/wiki/NFSv4 to configure NFS properly

pay attention Server and Client points ...
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

grimly64
Simple Hen
Posts: 43
Joined: Sun Apr 17, 2011 2:38

Re: NFS. Need help

Post by grimly64 » Wed Jan 29, 2014 4:29

Got rpc and nfs services running in systemd

After reading http://www.bermweb.net/?p=41 it is starting to make sense, (at work can't test it)

For NFS4 in exports, need to establish a root with fsid=0 then the actual files/folders to share should be like normal as when using NFS3.

exports

Code: Select all

//run/media 192.168.1.0/24(rw,no_subtree_check,async,insecure,no_root_squash,fsid=0)
//media/HDTwo 192.168.1.0/24(rw,no_subtree_check,async,insecure,no_root_squash)

grimly64
Simple Hen
Posts: 43
Joined: Sun Apr 17, 2011 2:38

Re: NFS. Need help

Post by grimly64 » Wed Jan 29, 2014 6:39

I wonder with ZFS, what needs to be done, if anything?

Post Reply