Find the answer to your Linux question:
Results 1 to 5 of 5
I have two computers that boot at the same time. They both mount nfs shares served by the other. Shares appear to mount correctly. However, there is a delay of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! RobertF's Avatar
    Join Date
    Feb 2008
    Location
    Cape Town
    Posts
    19

    NFS: Delay before write access to mounted nfs shares at boot time


    I have two computers that boot at the same time. They both mount nfs shares served by the other. Shares appear to mount correctly. However, there is a delay of about 60 seconds before writes can be made to the mounted shares. A tcpdump shows that write access is being denied during the first 60 seconds after which write access is granted.

    I would like to get rid of this delay!

    NFS servers are running on custom Gentoo installs. Kernel 2.6.38-gentoo-r6
    net-fs/nfs-utils 1.2.3-r1

    /var/log/messages from server1 output:
    Code:
    Jul  5 13:33:08 localhost syslog-ng[1980]: syslog-ng starting up; version='3.2.4'
    Jul  5 13:33:08 localhost ipmievd: Reading sensors...
    Jul  5 13:33:12 localhost rpc.statd[2268]: Version 1.2.3 starting
    Jul  5 13:33:12 localhost rpc.statd[2268]: Flags: TI-RPC
    Jul  5 13:33:12 localhost rpc.statd[2268]: Running as root.  chown /var/lib/nfs to choose different user
    Jul  5 13:33:12 localhost rpc.idmapd[2293]: libnfsidmap: using domain: localdomain
    Jul  5 13:33:12 localhost rpc.idmapd[2293]: libnfsidmap: loaded plugin libnfsidmap_nsswitch.so for method nsswitch
    Jul  5 13:33:12 localhost rpc.idmapd[2294]: Expiration time is 600 seconds.
    Jul  5 13:33:12 localhost rpc.idmapd[2294]: Opened /proc/net/rpc/nfs4.nametoid/channel
    Jul  5 13:33:12 localhost rpc.idmapd[2294]: Opened /proc/net/rpc/nfs4.idtoname/channel
    Jul  5 13:33:12 localhost rpc.mountd[2315]: v4root_create: path '/'
    Jul  5 13:33:12 localhost rpc.mountd[2315]: v4root_create: path '/home'
    Jul  5 13:33:12 localhost rpc.mountd[2315]: v4root_create: path '/home/mruser'
    Jul  5 13:33:12 localhost rpc.mountd[2316]: Version 1.2.3 starting
    Jul  5 13:33:13 localhost sm-notify[2333]: Version 1.2.3 starting
    Jul  5 13:33:13 localhost cron[2408]: (CRON) STARTUP (V5.0)
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: New client: 0
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: Opened /var/lib/nfs/rpc_pipefs//nfs/clnt0/idmap
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: New client: 1
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: Client 0: (user) name "root@localdomain" -> id "0"
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: Client 0: (group) name "root@localdomain" -> id "0"
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: New client: 2
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: Client 0: (user) name "ftp@localdomain" -> id "21"
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: Client 0: (group) name "ftp@localdomain" -> id "21"
    Jul  5 13:33:15 localhost rpc.idmapd[2294]: Stale client: 1
    Jul  5 13:33:15 localhost rpc.idmapd[2294]:     -> closed /var/lib/nfs/rpc_pipefs//nfs/clnt1/idmap
    Jul  5 13:33:17 localhost rpc.mountd[2316]: auth_unix_ip: inbuf 'nfsd 10.0.1.10'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: auth_unix_ip: client 0x82fbd00 '10.0.1.10'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_fh: inbuf '10.0.1.10 1 \x00000000'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_fh: found 0x82fc280 path /
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=user
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: Server : (user) id "0" -> name "root(a)localdomain"
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=group
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: Server : (group) id "0" -> name "root@localdomain"
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_export: inbuf '10.0.1.10 /home'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_export: found 0x82fc710 path /home
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_fh: inbuf '10.0.1.10 7 \x81fc0600000000002b5d0d4634c44bc3992bd937d568d60b'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_fh: found 0x82fc718 path /home
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_export: inbuf '10.0.1.10 /home/mruser'
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=user
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: Server : (user) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_export: found 0x82fcba8 path /home/mruser
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=group
    Jul  5 13:33:17 localhost rpc.idmapd[2294]: Server : (group) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_fh: inbuf '10.0.1.10 7 \x82fc0600000000002b5d0d4634c44bc3992bd937d568d60b'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_fh: found 0x82fcbb0 path /home/mruser
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_export: inbuf '10.0.1.10 /home/mruser/SCC_Runtime'
    Jul  5 13:33:17 localhost rpc.mountd[2316]: nfsd_export: found 0x82fbde0 path /home/mruser/SCC_Runtime
    Jul  5 13:33:20 localhost rpc.mountd[2316]: nfsd_fh: inbuf '10.0.1.10 7 \x7c2a0700000000002b5d0d4634c44bc3992bd937d568d60b'
    Jul  5 13:33:20 localhost rpc.mountd[2316]: nfsd_fh: found 0x82fbde8 path /home/mruser/SCC_Runtime
    Jul  5 13:38:19 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=user
    Jul  5 13:38:19 localhost rpc.idmapd[2294]: Server : (user) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:38:19 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=group
    Jul  5 13:38:19 localhost rpc.idmapd[2294]: Server : (group) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:40:01 localhost cron[4507]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
    Jul  5 13:43:18 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=user
    Jul  5 13:43:18 localhost rpc.idmapd[2294]: Server : (user) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:43:18 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=group
    Jul  5 13:43:18 localhost rpc.idmapd[2294]: Server : (group) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:48:16 localhost rpc.mountd[2316]: auth_unix_ip: inbuf 'nfsd 10.0.1.10'
    Jul  5 13:48:16 localhost rpc.mountd[2316]: auth_unix_ip: client 0x82de640 '10.0.1.10'
    Jul  5 13:48:20 localhost rpc.mountd[2316]: nfsd_export: inbuf '10.0.1.10 /home/mruser/SCC_Runtime'
    Jul  5 13:48:20 localhost rpc.mountd[2316]: nfsd_export: found 0x82fbde0 path /home/mruser/SCC_Runtime
    Jul  5 13:48:20 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=user
    Jul  5 13:48:20 localhost rpc.idmapd[2294]: Server : (user) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:48:20 localhost rpc.idmapd[2294]: nfsdcb: authbuf=10.0.1.10 authtype=group
    Jul  5 13:48:20 localhost rpc.idmapd[2294]: Server : (group) id "1000" -> name "mruser(a)localdomain"
    Jul  5 13:50:01 localhost cron[7230]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
    Jul  5 13:53:08 localhost -- MARK --
    /etc/exports on server1:
    Code:
    # /etc/exports: NFS file systems being exported.  See exports(5).
    
    /home/mruser/SCC_Runtime 10.0.1.10(rw,sync,anongid=1000,anonuid=1000)

    /etc/exports on server2:
    Code:
    # /etc/exports: NFS file systems being exported.  See exports(5).
    
    /home/ftp 10.0.1.20(rw,sync,anongid=21,anonuid=21)
    Dont know if this will be helpfull but this is the idmapd.conf file:

    Code:
    [General]
    #Verbosity = 0
    # The following should be set to the local NFSv4 domain name (REQUIRED)
    #Domain = local.domain.edu
    Domain = localdomain
    [Mapping]
    
    #Nobody-User = nobody
    #Nobody-Group = nobody
    
    [Translation]
    
    # Translation Method is an comma-separated, ordered list of
    # translation methods that can be used.  Distributed methods
    # include "nsswitch", "umich_ldap", and "static".  Each method
    # is a dynamically loadable plugin library.
    # New methods may be defined and inserted in the list.
    # The default is "nsswitch".
    #Method = nsswitch
    
    # Optional.  This is a comma-separated, ordered list of
    # translation methods to be used for translating GSS
    # authenticated names to ids.
    # If this option is omitted, the same methods as those
    # specified in "Method" are used.
    #GSS-Methods = <alternate method list for translating GSS names>
    
    #-------------------------------------------------------------------#
    # The following are used only for the "static" Translation Method.
    #-------------------------------------------------------------------#
    [Static]
    
    # A "static" list of GSS-Authenticated names to
    # local user name mappings
    
    #someuser(a)REALM = localuser
    
    
    #-------------------------------------------------------------------#
    # The following are used only for the "umich_ldap" Translation Method.
    #-------------------------------------------------------------------#
    
    [UMICH_SCHEMA]
    
    # server information (REQUIRED)
    #LDAP_server = ldap-server.local.domain.edu
    LDAP_server = ldap-server.localdomain
    
    # the default search base (REQUIRED)
    #LDAP_base = dc=local,dc=domain,dc=edu
    LDAP_base = dc=localdomain
    
    #-----------------------------------------------------------#
    # The remaining options have defaults (as shown)
    # and are therefore not required.
    #-----------------------------------------------------------#
    
    # whether or not to perform canonicalization on the
    # name given as LDAP_server
    #LDAP_canonicalize_name = true
    
    # absolute search base for (people) accounts
    #LDAP_people_base = <LDAP_base>
    
    # absolute search base for groups
    #LDAP_group_base = <LDAP_base>
    
    # Set to true to enable SSL - anything else is not enabled
    #LDAP_use_ssl = false
    
    # You must specify a CA certificate location if you enable SSL
    #LDAP_ca_cert = /etc/ldapca.cert
    
    # Objectclass mapping information
    
    # Mapping for the person (account) object class
    #NFSv4_person_objectclass = NFSv4RemotePerson
    
    # Mapping for the nfsv4name attribute the person object
    #NFSv4_name_attr = NFSv4Name
    
    # Mapping for the UID number
    #NFSv4_uid_attr = UIDNumber
    
    # Mapping for the GSSAPI Principal name
    #GSS_principal_attr = GSSAuthName
    
    # Mapping for the account name attribute (usually uid)
    # The value for this attribute must match the value of
    # the group member attribute - NFSv4_member_attr
    #NFSv4_acctname_attr = uid
    
    # Mapping for the group object class
    #NFSv4_group_objectclass = NFSv4RemoteGroup
    
    # Mapping for the GID attribute
    #NFSv4_gid_attr = GIDNumber
    
    # Mapping for the Group NFSv4 name
    #NFSv4_group_attr = NFSv4Name
    
    # Mapping for the Group member attribute (usually memberUID)
    # The value of this attribute must match the value of NFSv4_acctname_attr
    #NFSv4_member_attr = memberUID

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    Don't try to do this! The data may be available (read-only), but the system has not yet been fully initialized. Trying to bypass this time to stabilize and fully initialize the system will only result in data corruption and much tearing of hair and gnashing of teeth...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined! RobertF's Avatar
    Join Date
    Feb 2008
    Location
    Cape Town
    Posts
    19
    Rubberman, The problem is that a previous system with a similar setup but using older versions did not have this delay. Was kind of hoping it was a configuration issue. I will try get the specs of this system.

    Is this delay common then?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    Quote Originally Posted by RobertF View Post
    Rubberman, The problem is that a previous system with a similar setup but using older versions did not have this delay. Was kind of hoping it was a configuration issue. I will try get the specs of this system.

    Is this delay common then?
    Not sure. I don't usually have interdependent NFS servers like this.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined! RobertF's Avatar
    Join Date
    Feb 2008
    Location
    Cape Town
    Posts
    19
    Ok... Fixed the delay.
    Process:
    Disabled NFSv4 in the kernel. (Kernel now only uses NFSv3)
    Set ports for various NFS daemons in /etc/conf.d/nfs (This is probably Gentoo specific)
    In grub kernel boot line specify nlm ports for udp and tcp. (NFS/Server - Gentoo Linux Wiki)

    In otherwords I just followed the documentation a bit more to the letter.

    Result: Delay fixed. Still don't know what was causing delay in the first place though but stocked that system is now working as required.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •