Jump to content

Cannot access some files over SMB share


Recommended Posts

Posted (edited)

Hi all,

 

I have a freenas server running that I've mounted an SMB share from in unRaid. Generally it works fine, but occasionally unraid gets permission denied failures on some files that appear to go away with a reboot of unraid. Specifically if I try to head/cat one of these files I get a "cannot open file1.mkv for reading: Invalid argument" error. As far as I can tell from freenas and unraid the permissions are identical. I've included some stat output below, to show that. Anything I'm missing or any other ideas?

 

unraid can access file2 but not file1. Here is the unraid stats

stat file1.mkv 
  File: file1.mkv
  Size: 11130060980     Blocks: 21757248   IO Block: 16384  regular file
Device: 5ah/90d Inode: 6621        Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2020-07-19 07:22:54.530401500 -0600
Modify: 2020-07-19 07:22:54.530401500 -0600
Change: 2020-07-19 07:22:54.530401500 -0600
 Birth: 2020-07-04 07:04:52.809072600 -0600
 
 stat file2.mkv
  File: file2.mkv
  Size: 4690439998      Blocks: 9168505    IO Block: 16384  regular file
Device: 5ah/90d Inode: 4057        Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2020-07-19 07:21:08.948322200 -0600
Modify: 2020-04-20 11:28:15.504866200 -0600
Change: 2020-04-20 11:28:15.504866200 -0600
 Birth: 2020-04-20 11:27:04.251062300 -0600

 

And from the freenas side:

stat file1.mkv 
3780274052 6621 -rw-r--r-- 2 unraid wheel 4294967295 11130060980 "Jul 19 06:26:36 2020" "Jul 19 06:22:54 2020" "Jul 19 06:22:54 2020" "Jul  4 06:04:52 2020" 131072 21757248 0x800 file1.mkv

stat file2.mkv 
3780274052 4057 -rw-r--r-- 1 unraid wheel 4294967295 4690439998 "Jul 19 06:21:08 2020" "Apr 20 10:28:15 2020" "Apr 20 10:28:15 2020" "Apr 20 10:27:04 2020" 131072 9168505 0x800 file2.mkv

 

Edited by nerv
Posted

I'm not sure. I figured out how to make freenas format the same was as unraid. Included below.

 

My only theory is this has to do with the hard links. The flow this happens in is sonarr creates a hard link of the file after the download completes. Most of the time that works fine, but 10% or so of the time unraid loses access.

 

stat -x file1.mkv
  File: "file1.mkv"
  Size: 11130060980  FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: ( 1001/  unraid)  Gid: (    0/   wheel)
Device: 103,3780247684   Inode: 6621    Links: 2
Access: Sun Jul 19 06:26:36 2020
Modify: Sun Jul 19 06:22:54 2020
Change: Sun Jul 19 06:22:54 2020

stat -x file2.mkv
  File: "file2.mkv"
  Size: 4690439998   FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: ( 1001/  unraid)  Gid: (    0/   wheel)
Device: 103,3780247684   Inode: 4057    Links: 1
Access: Sun Jul 19 06:21:08 2020
Modify: Mon Apr 20 10:28:15 2020
Change: Mon Apr 20 10:28:15 2020

 

Posted

I don't follow. As far as I can tell both of the hard links are the same as stat returns the same data on each. Can you give some more background?

Posted

Fair enough.

 

A bit more data here. Unraid can actually access one of the two hard links.

 

I also verified that connecting to Freenas's SMB via MacOS can access both hard links, so this seems like an issue in unraid's ability to access hard linked files over SMB?

  • 3 weeks later...
Posted

for those stumbling upon this, I think I figured out a way to work around it. I created a separate SMB share that only had 1 hard link each in it and it solved the issue.

 

Basically I have SMB share1 structured share1/folder1 and share1/folder2 where folder1 and folder2 have hard links to the same file. I created a share2 that directly mounts folder1. share1 still can't access all the hard linked files in folder1 and folder2, but share1 works fine, and this is good enough for my use.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...