Enabling Read-Only AFP Share On Replication Target Possible?

Status
Not open for further replies.

FFF

Dabbler
Joined
Mar 10, 2017
Messages
28
Hi all,
I've got a pair of FreeNAS servers, let's call them primary and mirror. Primary takes regular snapshots and replicates them to mirror. I've got read-write AFP sharing enabled on primary and all is well. However, I'm being asked to provide access to mirror and figured it would be best to only give read-only access to avoid accidental writes to the mirror. I've gone through and setup the share and believe all the settings and permissions are correct. However, when I try to connect to the mirror (without even specifying a share name, just afp://user@mirror) I cannot get it to show me the share I should have read-only access to. I found the following in the logs:
Code:
Mar 10 18:30:17 mirror afpd[11280]: Login by user (AFP3.4)
Mar 10 18:30:17 mirror cnid_dbd[11281]: Error opening lockfile: Read-only file system 
Mar 10 18:30:17 mirror cnid_dbd[11281]: main: fatal db lock error
Mar 10 18:30:17 mirror cnid_dbd[11281]: Failed to open CNID database for volume "Sharename-mirror"
Mar 10 18:30:17 mirror cnid_dbd[11281]: delete_db() failed: Read-only file system 
Mar 10 18:30:17 mirror cnid_dbd[11281]: reinit_db() failed: Read-only file system 
Mar 10 18:30:17 mirror cnid_dbd[11282]: Error opening lockfile: Read-only file system 
Mar 10 18:30:17 mirror cnid_dbd[11282]: main: fatal db lock error
Mar 10 18:30:17 mirror cnid_dbd[11282]: Failed to open CNID database for volume "Sharename-mirror"
Mar 10 18:30:17 mirror cnid_dbd[11282]: delete_db() failed: Read-only file system 
Mar 10 18:30:17 mirror cnid_dbd[11282]: reinit_db() failed: Read-only file system 
Mar 10 18:30:18 mirror cnid_dbd[11283]: Error opening lockfile: Read-only file system 
Mar 10 18:30:18 mirror cnid_dbd[11283]: main: fatal db lock error
Mar 10 18:30:18 mirror cnid_dbd[11283]: Failed to open CNID database for volume "Sharename-mirror"
Mar 10 18:30:18 mirror cnid_dbd[11283]: delete_db() failed: Read-only file system 
Mar 10 18:30:18 mirror cnid_dbd[11283]: reinit_db() failed: Read-only file system 
Mar 10 18:30:19 mirror cnid_metad[11285]: Multiple attempts to start CNID db daemon for "/mnt/path/Replication_Target/ShareRoot" failed, wiping the slate clean...
Mar 10 18:30:19 mirror cnid_dbd[11285]: Error opening lockfile: Read-only file system 
Mar 10 18:30:19 mirror cnid_dbd[11285]: main: fatal db lock error
Mar 10 18:30:19 mirror cnid_dbd[11285]: Failed to open CNID database for volume "Sharename-mirror"
Mar 10 18:30:19 mirror cnid_dbd[11285]: delete_db() failed: Read-only file system 
Mar 10 18:30:19 mirror cnid_dbd[11285]: reinit_db() failed: Read-only file system 
Mar 10 18:30:20 mirror cnid_dbd[11286]: Error opening lockfile: Read-only file system 
Mar 10 18:30:20 mirror cnid_dbd[11286]: main: fatal db lock error
Mar 10 18:30:20 mirror cnid_dbd[11286]: Failed to open CNID database for volume "Sharename-mirror"


I searched for other threads and found people in similar (but not equal) binds suggesting: zfs set readonly=off tank/dataset ... but in my case I really don't want users to be able to write to the files on the mirror. Can someone confirm if this is OK and will solve my issue without allowing users to be able to corrupt things on the mirror? Or if there is a better solution and I'm barking up the wrong tree please let me know. Thanks!
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Might I suggest you create a read-only SMB share instead, since AFP is being deprecated by Apple in the most recent versions of OS X.
 

FFF

Dabbler
Joined
Mar 10, 2017
Messages
28
Thanks for the suggestion m0nkey_ but I'm not quite ready to spin up a brand new protocol just to make this happen. I'm more interested if it is possible to do using AFP at this point.
 
Status
Not open for further replies.
Top