New shared volume not mounting

Discussion about using NAS on Linux and Unix OS.
Post Reply
userman93
Starting out
Posts: 31
Joined: Wed Feb 10, 2021 9:38 pm

New shared volume not mounting

Post by userman93 »

I attempted to mount my newly shared volume, and I get this: "mount.nfs: access denied by server while mounting ip:/share".
On my qnap, I ssh in, do a cat /etc/exports, and do not see my new share listed. I assume I also don't need to modify the file after already sharing it through the gui? Did I miss a step?
userman93
Starting out
Posts: 31
Joined: Wed Feb 10, 2021 9:38 pm

Re: New shared volume not mounting

Post by userman93 »

bump
algn2
New here
Posts: 2
Joined: Fri Sep 11, 2020 4:44 am

Re: New shared volume not mounting

Post by algn2 »

Did you ever get a response? I faced this same problem today when all of a sudden, NONE of the shared NFS directories were mountable, after a new share was created. Deleting the new share didn't fix the problem.

I did a shell login as admin, and realized that /etc/exports wasn't being generated.
It turns out that the export list is created in /etc/init.d/nfs, whenever a nfs start, restart, reexport is done.

The culprit is the line below (in shell function nfs_reexport):

Code: Select all

        /sbin/gen_exports > /etc/exports
The problem is, /sbin/gen_exports is a binary, so I have no clue why it's failing.
This script could've easily been done with shell/awk/sed.

My Solution
Rather than reverse engineer gen_export, I just commented out the line in /etc/init.d/nfs.
manually created /etc/exports, and ran /usr/sbin/exportfs -r so that we can get working.
Just below it, I placed an advisory (Note: ANGRYWORDS are choice 4-letter expletives):

Code: Select all

       # /sbin/gen_exports > /etc/exports
       echo "WARNING: Disabled gen_exports, which is trashing /etc/exports.  [ANGRYWORDS] "  >&2  
Later, I'll try to figure out what went wrong, or create a quick-and-dirty way to create /etc/exports from the contents of /etc/smb.conf .

We lost a day's work because of this.
algn2
New here
Posts: 2
Joined: Fri Sep 11, 2020 4:44 am

Re: New shared volume not mounting

Post by algn2 »

Fixed the issue. Following are my notes.

To create a shared directory in a QNAP NAS for use by Windows and Linux clients:
  1. Login to QNAP and start ControlPanel.
  2. From ControlPanel, launch NetworkServices Win/Mac/NFS app, and make sure that Microsoft Networking and NFS are enabled:
    1. In NetworkServices MicrosoftNetworking settings:
      - Make sure file service for Microsoft Networking is enabled.
      - Set server description.
      - Set workgroup
      - Simplest setup: StandaloneServer (DO NOT SET: AD DOMAIN or LDAP).
      - Advanced Options: Select Local Master Browser only
    2. In NetworkServices NFSService settings
      - Enable NFS v2, v3 service
      - Don't touch anything else
  3. Under ControlPanel, in PrivilegeSettings section, launch SharedFolders
    1. In SharedFolders "SharedFolder" settings:
      - Create the shared folders as needed.
    2. In the "Action" column, select "EditProperties" (pencil mini icon):
      Set common share permissions for the shared folder.
      - Enable Lock File (Oplocks).
      - Enable Network Recycle Bin (saves you in accidental delete).
      - Only allow long file name format (no MSDOS 8-char limit).
    3. In the “Action” column, select "EditSharedPermission" (middle mini icon):
      • Select Shared Permission TypeUsers and Group Permission:
        - Use this to set the users and groups that will have read/write access
        - If needed, create additional users and groups via ControlPanelUsers.
      • Select Shared Permission TypeMicrosoft Networking Access:
        - This enables Microsoft sharing via SAMBA.
        - If not done, file sharing may not be possible because QNAP uses the smb.config to generate the NFS /etc/exports file.
        - To restrict access to specific IP addresses, add entries here.
        - Otherwise add an entry for “*” to allow everyone who can authenticate to access.
        - Press the APPLY button.
      • Select Shared Permission TypeNFS Host Access:
        - Without this setup, and NFS entry in /etc/exports is not generated for the shared directory.
        - Set access right to: NoLimit(read/write), ReadOnly, or Deny.
        - Set squash option to: NO_ROOT_SQUASH for now.
        - Allowed IP addresses: Add "*" to allow all for now.-
        - Press the APPLY button.
    If everything has been setup correctly, the following changes will be done in the QNAP server:
    - /etc/smb.conf will be created (and SAMBA services re-started) to allow Windows clients to remote mount.
    - /etc/exports will be created (and NFS services re-started) to allow Linux/Unix NFS clients to remote mount.
If things don’t work.
Refrain from making manual changes! All changes should be done from the web interface.
If manual changes are done (eg. in an emergency), look to resolve the problem(s) that caused the automated changes to fail. Once resolved, back out the manual changes to return to standard operating mode.

Resources in QNAP.
Diagnostic utilities. None of these applications make changes. They only print to the terminal.
/usr/bin/testparm - Run to check if samba config is correct. If there are errors, no SMB or NFS shares are possible.
/sbin/gen_exports - Run to check if /etc/exports can be generated.


Related Init Scripts. Don’t mess with these unless you know what you’re doing.
/etc/init.d/smb – This is the sysv init script that runs the Samba services.

/etc/init.d/nfs – This is the sysv init script that runs the NFS services.
Usage: /etc/init.d/nfs command
Where command is one of:
start – To start NFS service
stop – To stop NFS service
restart – Essentially, a stop followed by a start, re-generate and load /etc/exports
Post Reply

Return to “Linux & Unix (NFS)”