SOLVED Windows is hiding files in a folder stored in SMB share on Freenas

johns007

Dabbler
Joined
Mar 21, 2019
Messages
17
Hi,

I need a little bit of help.

I currently have a freenas setup, with my own hardware running one of this years version of freenas.

I currently have a share called Media and in that share i have a Video directory and within that directory i have folders such as testfolder. When i click to view the contents of the folder with windows 10, it shows that the folder is empty. But when i browse the/mnt/Pool/Media/Video/Testfolder and list it's contents, the files show up in there.

I then thought, perhaps its the permissions. So i went in and viewed the getfacl information to see what permissions it has. It has working permissions like all other adjacent folder which i can still view all the files within them. No difference in any permissions or users group etc.

So after ruling out the permission and user groups, i am stuck trying to find a solution to access the files which i can see via command line when logged directly on the server, but when i view from the windows 10 machine, there is nothing with 0 bytes in the folder being shown in windows gui.

Any ideas how i can view my media files stored in that folder which seem to be hidden to windows, but not to freebsd command line in freenas?

Any help is very appreciated.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Please show ls -l /mnt/Pool/Media/Video, and also reveal which account you use to access the share. Usually, this sort of thing is due to the problem folder being owned by another account.
 

johns007

Dabbler
Joined
Mar 21, 2019
Messages
17
Hi, Ok i will place some images here to explain my situation.

This first image shows the problem. I can't see any of the video files i have stored there via windows.


windows.jpg

This next image shows the video files residing there after browsing to the mounted share via shell and showing the files that are in there:

freebsdshell.jpg

The following images shows the configuration settings of freenas.
pools permissions.jpg and
smb services.jpg

I am confused as to why, Windows won't let me see the files which are clearly there.

Appreciate any help in advance.
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
Samuel had a reason to ask for a ls -l of the folder. Yes, the files are there, but with a ls -l we could also have seen ther permissions and the owner of that files.

If the directory listing also shows a "+" behind the permissions please also post the getfacl output for the files.

Please don't post a picture, copy the text and put it in [code][/code] tags.
 

johns007

Dabbler
Joined
Mar 21, 2019
Messages
17
Hi, Thank you Samuel for your reply. I could not initially get the ls -1 to work, since i was mistaking it for a 1, instead of an l.

The output is a revelation:

Code:
--w--w----+ 1 nobody  plex  115932 Mar 5 2013 Video0006.mp4


Apologies in advance, i had to attach an image file to show the getfacl output as well. Could not copy and paste in the webgui shell, don't have ssh set up.

This discovery means that the files seem to have explicit permissions which will not change, no matter what i do with the acl controls via windows. Even if i disable inheritance or set explicit permissions to all child objects in that folder....still can't view the files in windows.

Any ideas how i can reset all the files acl information recursively to resolve the issue?
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    168.6 KB · Views: 493

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
  1. To remove the ACL from a file, use setfacl -b <name of file>. To remove the ACL from a directory recursively, run find . -exec setfacl -b {} \; while inside that directory.
  2. Run chown john:plex -R <directory> to recursively take ownership of a directory. This has to be done from the directory one level up.
  3. Run chmod -R u+rwx,g+rwx,o+rx <directory> to recursively set a sane permissions set for the same directory. This has to be done from the directory one level up.
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
Apologies in advance, i had to attach an image file to show the getfacl output as well. Could not copy and paste in the webgui shell, don't have ssh set up.
This really seems to have changed recently, ctrl-c does not work anymore here, too. What still works is selecting the text with the mouse and then use the browser's menu Edit->Copy.
Any ideas how i can reset all the files acl information recursively to resolve the issue?
There is a button in the share configuration [ ] Default Permissions
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Once you've defaulted the permissions and removed the ACL, you can re-attempt applying the correct ACL recursively.
 

johns007

Dabbler
Joined
Mar 21, 2019
Messages
17
  1. To remove the ACL from a file, use setfacl -b <name of file>. To remove the ACL from a directory recursively, run find . -exec setfacl -b {} \; while inside that directory.
  2. Run chown john:plex -R <directory> to recursively take ownership of a directory. This has to be done from the directory one level up.
  3. Run chmod -R u+rwx,g+rwx,o+rx <directory> to recursively set a sane permissions set for the same directory. This has to be done from the directory one level up.

ok, seems that now i can access the files within that folder via windows. But the new issue is the recursive modifications of acl with windows. It seems that the individual files have explicit acl's set and even if i try to take ownership, it refuses to allow me to do anything, except to view, copy etc. Since i have quite a few other files like these, i need an optimised way to replace acl's with inherited acl's from their parent folder. Since all acl's right up to the containing folder is working perfectly. It appears to be a problem where the files themselves have their own explicit acl's set and they are stubborn to do anything within windows. I can't take ownership, can't add or modify them, nothing that works within windows gui.

I haven't tried the other bits you provided above, because all the folders have correctly set acl's. It's just the individual files themselves? Should i be copying the items into a new folder to change it, or is there an easier way?

It seems, new files written in the folder are working correctly, ever since i changed the storage pool's permissions correctly, working like a treat now and will eliminate this from ever happening again.

Thank you again in advance for your assistance, it's a time saver.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You're welcome. Note, @anodos informed us in this thread of a regression in 11.3-U4, which prevents recursive application of ACLs. U4.1 should soon be released to address this bug.
 

johns007

Dabbler
Joined
Mar 21, 2019
Messages
17
Currently running 11.2 U8. Should i wait for that update to do the update? I need to read over the implications of the update to see if my pools will handle it without a problem. It seems the Freenas software stopped alerting me to updated at 11.3 U8. My machine specs are all good for the update, but i don't understand why it stopped alerting. I guess it's because of having implications with the update process.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
The 11.2->11.3 upgrade is pretty major, and you shouldn't upgrade until you understand the complete implications for your system. Read the release notes for all the interim versions of 11.3.
 
Top