AFP-OS X Mavericks-FreeNAS9.2- Phantom files/folders and errors

Status
Not open for further replies.

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
So I'm a newb to the forum and recently built myself a nice fresh box with some pretty beefy parts. One goal was to be able to setup PLEX for a few users including myself at home. Things started off a bit difficult at first as I got the hang of the learning curve with permissions and such to get my file system setup. I think I've got a pretty good handle on it now and have tried getting my content over to my FreeNAS box now. Herein lies the problem:

When I first copied my Movies directory, it took awhile (~200GB) to copy, but was successful. A few other small transfers (~500MB) to some other directories, all good. Now I've tried copying my music, pictures, and a recent set of "TV" episodes over, but I keep running into issues with errors such as:
  • The operation could not be completed because one or more required items can't be found. (Error code -43)
  • Could not copy the items an unknown error occurred (approximately the message)
Since this started happening, I've also been noticing some really wacky things appear in the folders that already exist, such as:
  • Folder structure is /media/movies, pictures, videos, workouts, tv, etc
  • In movies I have my movies, opening my videos folder, and a subfolder in it, I find 1 of the video files is missing, and in it's place I'm seeing a Movie which resides in the movies folder.
  • If I SSH into the FreeNAS box, and find this location, the files look to be intact and movie file is not there the original video file is.
  • Something else funky I've found upon SSH in, is there are some odd .1as083545324ljhsgf-0-spotlight named files/folders. If I dive in, they appear to have content in them as well, and that content resides in a different folder somewhere else.
I know there is something wacky going on, but I'm not sure where to start to get this narrowed down to what is causing the issue. I've provided a screenshot below, along with some further detail on my config. Please let me know what else can be useful in understanding the issue and I can work to provide it.

FreeNAS 9.2 - Release - recently updated to ensure it wasn't a lingering bug
Hardware - Intel Xeon E3-1230 3.3 Quad Core, 16GB RAM, 4 x 2TB drives as a single ZFS filesystem
Mac's for testing - OS X 10.9.1
Only sharing service running right now is AFP
 

Attachments

  • FreeNAS issue.jpg
    FreeNAS issue.jpg
    123.9 KB · Views: 283

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
So I've grabbed some more info regarding this as I've fought with this all day and gotten nowhere. I did however get a good screen grab including documentation of all the issues seen/noted in this thread. I'm hoping this will allow someone to see a bigger issue that needs to be solved. I can't imagine I'm the only one with this kind of problem with AFP sharing.
 

Attachments

  • More FreeNAS issues.jpg
    More FreeNAS issues.jpg
    484.3 KB · Views: 298

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
Ok a little further information. I decided to try and take the route of testing out CIFS sharing to see if the same funky results appeared. CIFS works perfectly fine with no issues, and copying new content over did not result in the errors seen before. This lends it to be most likely an issue with the AFP (netatalk) implementation vs some other unknown factor in my environment. I will file a bug report for this, but if anyone else has similar issues it would be helpful to be able to try and work through the underlying issues.
 
J

jkh

Guest
This is really bizarre, especially given that I've copied my entire iTunes Media folder from an iMac running 10.9.1 to my FreeNAS 9.2 box several times (it's one of the tests I run to verify things are working with AFP) and that's over 2Tb of movies, TV shows, music, apps, you name it - it's in there. I do make sure that permissions are permissive enough when I do this, since using Unix file permissions rather than Mac / Windows as the ACL, or not having the target dataset owned by me, has caused me issues in the past. Are you sure your permissions are correct and that you have appropriate ownership of everything on the target volume?
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
jkh,

I had seen many folks talking about no problems when doing this either, but it seems I'm not having such luck. I believe my permissions are set permissive enough, but then again it's possible I'm restricting something too much. I work in Security, so I tend to err on the side of more secure than less. :)

I've attached a shot of what my permissions look like on the volume/dataset. At the top level, I've set it with the same permission on the volume, and then set the same permissions down to the individual shares on the media share (movies, tv, music, etc). Instead of setting myself as the owner, I've set my group (home users) as the owner (group) setting since there are 2 of us who may be read/write files to the share. Realistically this is probably more open than some folks will do since I'm not specifically giving my user permission as the owner directly. I've then setup AFP sharing on the media share instead of each individual subdirectory, and set the @homeusers in allow and read/write fields. For default permissions on files/directories, I've enabled all 6 for Owner/Group, and left R-X on files, R on directory for Other.

I attempted briefly trying to switch over to Windows/Mac as the permission configuration, but was unsuccessful at getting this to work either. When I did it this way, I wasn't able to write to the shares anymore. Additionally, I was still seeing these funky issues appearing in the folders too.

As a side note, since CIFS/SMB seems to work fine, I'm working on getting it setup to function this way. I've found recent documentation illustrating that Apple has actually switched to SMB2 as their new default method for transfers with newer Mac OS'. It appears they see better performance than with AFP. AFP still being left in for compatibility with older Mac and for TM backups (which mind you seem to work perfectly for me!). So it may be in the best interest to just look forward at CIFS/SMB sharing instead.
 

Attachments

  • Screen Shot 2013-12-31 at 9.51.57 AM.png
    Screen Shot 2013-12-31 at 9.51.57 AM.png
    36.4 KB · Views: 312
J

jkh

Guest
I attempted briefly trying to switch over to Windows/Mac as the permission configuration, but was unsuccessful at getting this to work either. When I did it this way, I wasn't able to write to the shares anymore. Additionally, I was still seeing these funky issues appearing in the folders too.

Something is definitely whacked with your setup then since that should absolutely work. In fact, using the Windows/Mac ACLs is the proper way of doing permission control for AFP now. I think your desire for security settings may have led you down a blind alley or something since using straight-forward ownerships and ACLs works very well (or my own Mac wouldn't be able to talk to any of its shares or back up over Time Machine to the FreeNAS).

Try to simplify your setup until it works. For example, create a single dataset for sharing owned as you. Don't think in terms of folders, think in terms of zfs datasets and make sure to apply your permissions recursively. Don't try anything fancy with sharing, either. One share point per dataset, no subfolders or anything other than the base directory of the dataset.
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
Is it possible that is where my difficulty is lying in that I have one dataset (media) with multiple sub-datasets (music, pictures, movies, etc)? In the AFP sharing, I've only enabled Media to make it easier to just map one share, which has multiple sub-folders. Those sub-folders though are actually datasets that are below my media dataset. Realistically I could potentially get away from this since I'm not really breaking things out too much. I did something similar for my users folder, though I've managed to successfully separate out user permissions for those sub-folders (also sub-datasets), and done the same for my Time Machine configuration.
 
J

jkh

Guest
That's almost certainly it, or a significant contributor to the weirdness, anyway.

I don't know how well sharing interacts with "sub-datasets" at all, TBH, since I've never done that (nor have I ever seen a FreeNAS system configured that way - I didn't even know it was possible until you made me go try it! :) ). We always just create all datasets as peers in the same pool and, as I noted before, have a 1:1 correspondence between share points and datasets.
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
Gotcha, sounds like solid advice. One other question then I have that you might be able to let me know if I just need to Google around (which I've been trying to do to understand this behavior). As I played with the CIFS sharing option, I'm noticing that the permissions on the files I copy off the FreeNAS shares are coming out with permissions of 700, vs the usual 755 (directories) or 644 (files) that I would expect based on the permission configurations on the datasets. Interestingly I'm seeing an odd translation as well going through the box:

From my machine the bunch of files are going in with 611 (seems to be default on my Mac system for most files), on the server when placed, they are translating to permissions of 666 (default mask of 0666 I see in CIFS config), and when copying back down from the server, they come down with 700. Not looking to try and troubleshoot necessarily why they aren't coming down with the permissions expected (per the dataset - unix permissions configured OR the same as stored on server 666) but wondering if you can point me in a direction to understand where the setting would be to indicate what permissions the file should come down with? And/or if I plan to use Mac devices with CIFS should I contemplate modifying the default mask for CIFS to 611 to match Mac defaults?

And obviously if this warrants a separate thread I'd be happy to open a new thread regarding this. Thanks for the help so far.
 
J

jkh

Guest
I've always been told that when you use the Windows / Mac ACL type, which you're supposed to do especially for CIFS, the standard Unix permissions are basically ignored in favor of Windows ACLs and what you see for Unix perms are some contrived baked-in defaults since they're essentially meaningless to Windows. The same is true when you copy back off the CIFS share since, of course, Windows (or Samba pretending to be Windows in this case) didn't even try to preserve the Unix perms on the way in so they're obviously not going to be restored on the way out. You're supposed to use the Windows file explorer to whap whatever ACLs you want on them, and then when you copy them back to the Mac you'll see the ACLs preserved in EAs, presumably with full fidelity for the next time you copy them back to Windows.

Basically, with CIFS you've left the Unix rabbit hole and are now going down a Windows one. :) IIRC, Mac OS X was also designed to interoperate with Windows in such heterogenous corporate environments and will do "the Windows thing" rather than "the Unix thing" in such cases.

If you want to stick with pure Unix semantics while crossing network filesystem boundaries, I think NFS is more likely to be your oyster. AFP should work too, but not as assuredly as NFS will.
 
Status
Not open for further replies.
Top