ReadyNAS - Setting up a share
The first task after initial configuration was to create users and groups. To my way of thinking, these are Linux types of things. Since we use both Linux and Windows in our environment, and our underlying permission model is already based on Linux, this was straightforward. I setup the users and groups as we have them now. I did make sure that the UID for each user on the NAS matched the UID in our existing network. Same for the GIDs for the groups. Root UID and GID are 0:0 by default in any Linux system to they match already.
On a new NAS, enable NFSv4 from the web interface by picking System -> Services -> NFS -> Enable NFSv4.
On a new NAS, enable NFSv4 from the web interface by picking System -> Services -> NFS -> Enable NFSv4.
From the web interface, picking shares and then new folder will initiate a set of dialogs to setup a new share:
- I enabled Bit-rot protection. More about it is here. Since this is an RN204 I got a warning that it would impact performance but I don't care for my testing.
- I enabled snapshots on an hourly basis since that is what we need in our environment. The ReadyNAS does automatic pruning of snapshots keeping snapshots as detailed here:
48 hours of hourlys
4 weeks of dailys
8 weeks of weeklys - I enabled SMB for windows access, NFS for Linux/Unix access and Rsync for backup access (see later post).

I checked "Allow Snapshot Access" so that users can see the snapshots in the share and restore files themselves if needed. Otherwise the snapshots are hidden and only accessible from the NAS interface.
SMB permissions
Setting up permissions is next. By default the share is wide open. Not good for our environment. Starting with SMB protocol, uncheck "Allow anonymouse access", uncheck read/write for everyone. I enabled read/write for each group as appropriate for our environment. We don't control access on a per user basis but use group controls so I left permissions for each user unchecked. Note that user admin and the cloud username is read/write by default and I don't know how to change it.
I did not do anything with HOSTS, DFS, and ADVANCED.
With this setup I can map a drive from a windows 7 PC. I can create a folder and file within the share. Using ssh (root user) to log into the RN204, I see these permissions from ls -al:
My username and default group was on the file.docx and folder. Note that the share was in the /<volume name> directory. I'm not wild about the wide open permissions on the share and the objects created in it.
I'll skip the NFS and Rsync setups for now. Moving to the tab labeled "file access" I can see why guest was owner and group for the share. I also see why the Linux world permissions are rwx - Everyone is set to read/write.
- I changed the folder owner to root and group to our default group.
- The "Grant rename ..." control the Linux sticky bit permission. Unchecked results in a t in the permissions. I left it checked.
- I changed Everyone to read only.
- I disabled guest group access (uncheck both read only and read/write).
- I disabled guest user access (uncheck both read only and read/write).
- I enabled read/write access for our default group.

The result from ls -al after creating a folder and file with the new setup:
I can see the permissions for the share, new file and new folder are per the dialog "folder owner" and "folder group". World permissions are per the "Everyone" permissions in the dialog. The NAS is using ACLs too, denoted by the + in the permissions so let's see what those are.
Whiteouts are our standard group. This seems reasonable. I'm not sure if the admin user and group are needed for proper operation of some service in the NAS. I'll have to test that.
For the new folder:
Whiteouts are our standard group and my user name. Seems reasonable.
For the new file:
Whiteouts are our standard group and my user name. Seems reasonable.
The dialogs for the share setup in ReadyNAS assume that all files and folders under the share will have the same permissions. For us, we have more complicated permission schemes than that. We will have different permissions on folders in a single share. I'm assuming that I will have to set those up using SSH into the NAS or from a Linux/Unix mount of the share.
NFS Permissions
The default permissions for NFS access to the share are set as:
I checked read/write for AnyHost.
Information about mounting a share on a Linux / Unix box can be found at Netgear or on the web at a lot of pages but I like this one.
Testing an NFS mount of a NAS share from CentOS
For my testing I mounted from a CentOS machine at /net/rn204 as su:
cd /net/rn204
mkdir test2
chown root:XXXX test2 (where XXXX is our standard group)
mount -t nfs 172.21.1.21:/RN204/test2 test2
In the dialog box above I had to set AnyHost to allow read/write in order to get it mounted.
As root, I could cd into the mounted share, but I could not create a file or folder in the share. I got permission denied. I guess that makes sense since the IP for the CentOS machine was not in the list of hosts for NFS.
I could create a folder and file when I was my own user.
I added the IP of my CentOS machine to the list of hosts in the NFS setup on the NAS and set allow root access. Now as soon as I tried to cd into the share or ls the share my CentOS machine hung at the command line. Both logged in as me or as root.
I disabled root access but left the IP of the CentOS machine in the list of hosts. Again I could not cd or ls the share in the root of it without hanging the CentOS shell.
It turns out I uncovered a bug. If snapshots are enabled, and allow snapshot access is turned on, then any operation in the root of the share will hang a shell on a linux machine which has that share mounted. Operation in a sub-directory of the root of the share works fine. Turning off allow snapshot access is a workaround for this problem. See this post in the NetGear community. NetGear confirmed this is a bug in 6.4.2.
Testing an NFS mount of a NAS share from Ubuntu
I decided to install Ubuntu on a USB memory stick. See http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows and make sure the drive is formatted as FAT32 by checking the format box in the dialog shown in step 3.
Once Ubuntu booted, I added my user, changed my UID and GID to match our network and the NAS and cd /mnt. Using sudo, I created a rn204 directory and changed it to 770 root:<default group>. Sudo su made me the root user. I created a sub-directory, rn204/temp and tried to mount the NAS share: mount -t nfs <ip of nas>:/RN204/temp temp. I got an error message. The fix is to install nfs-common. The problem and fix are here. Once that was done I was able to mount the share.
I made myself my login by su <username>. I was able to list the share and create a file on it. I became root (sudo su). I could not cd temp or list temp due to permission denied. I then added the IP of the Ubuntu machine to the list of hosts and checked allow root access. I could cd into temp with no problem. But an ls -al never returned. Same problem as with CentOS. The same bug is operating as described for CentOS so it is not a problem due to different Linux flavors. I also tested with nfsv4 with the same bug showing up.
Summary of setting up a share
Let's assume that UIDs and GIDs are setup as described in the beginning of this post.
From the web interface, picking shares and then new folder will initiate a set of dialogs to setup a new share:
- I enabled Bit-rot protection. More about it is here. Since this is an RN204 I got a warning that it would impact performance but I don't care for my testing.
- I enabled snapshots on an hourly basis since that is what we need in our environment. The ReadyNAS does automatic pruning of snapshots keeping snapshots as detailed here:
48 hours of hourlys
4 weeks of dailys
8 weeks of weeklys - I enabled SMB for windows access, NFS for Linux/Unix access and Rsync for backup access (see later post).
Hit Create.
Once the share is created, pick the Shares tab on the web interface, select the share just created, and RMB on the gear and pick Settings.
DO NOT ENABLE "ALLOW SNAPSHOT ACCESS" at this time. This will allow you to operate in the root of the new share without encountering the bug described above.
Setup the SMB permissions for this share: Pick "Network Access" tab, then "SMB". Set the permissions you want for the share. Typically I disable all access from Everyone. You are effectively setting group permissions on this dialog. Once set click Apply.
Setup the folder owner and group for this share: Pick "File Access" tab. Select the folder owner and folder group from the drop downs. Setup permissions to allow them access and disable everyone else except Admin. Once set click Apply.
Setup the NFS permissions for this share: Pick "Network Access" tab, then NFS. I disable AnyHost and add specific IP addresses for all of our Linux / Unix machines. I allow Read/Write and Root Access for each machine IP. Once set click Apply.
Now enable async for NFS. Pick Advanced and check "Enable async".
Hit OK.
Since I use RSync to backup the share and Rsync is much slower than cp, I first run an RSync backup without any files in the share. Then I copy the files onto the backup drive using cp. See the backup post for more details.
Copy files and directories into the share. I prefer to use NFS to do this since I can preserve date, time and permissions when I do it. From a Linux machine with the share mounted:
cd <root_of_share>
cp -R --preserve <path_to_source> ./
Once this has completed double check the permissions from the Linux machine or from SSH on the NetGear NAS. Set them if you don't have what you want.
Now go back and "Allow Snapshot Access" if you want users to be able to get at the snapshot for this share.
You can now use the share.
Now enable async for NFS. Pick Advanced and check "Enable async".
Hit OK.
Since I use RSync to backup the share and Rsync is much slower than cp, I first run an RSync backup without any files in the share. Then I copy the files onto the backup drive using cp. See the backup post for more details.
Copy files and directories into the share. I prefer to use NFS to do this since I can preserve date, time and permissions when I do it. From a Linux machine with the share mounted:
cd <root_of_share>
cp -R --preserve <path_to_source> ./
Once this has completed double check the permissions from the Linux machine or from SSH on the NetGear NAS. Set them if you don't have what you want.
Now go back and "Allow Snapshot Access" if you want users to be able to get at the snapshot for this share.
You can now use the share.