KristofG Posted August 23, 2022 Share Posted August 23, 2022 hi Unraid newbie here. I have all kinds of NAS's and haven't had this problem before, so i'm wondering what i need to do to allow a regular user to create files that start with underscores via the SMB protocol. A little background, i setup a basic unraid server using an Intel NIC and an IcyBox USB3.1 10 disc enclosure filled with 5 disks and an SSD as cache. i know the USB thing isn't a good idea, but i don't have my server yet plus i needed to create backups of a failing Drobo system that's hosts 100,000 of graphics files. i create 2 shares, a regular user, and started copying the files from my Mac to the server, using rsync. i know that rsync by default hides the files it's transferring on the destination by creating a '.' version of the file. So 'picture1.jpg' becomes '.picture1.jpg.#####' while in transfer (there is some extra character added in the end to make the file unique, i guess). once transfer completed it replaced the . file with the actual original file. this is the command i'm using : 'rsync --progress -av <srcfolder> <destfolder>. i'm doing this from the source Mac and push out the files to the unraid server, making the owner and permission match the user i cannot to the share with. this works great and even with good speed (because of the cache) but i started noticing errors like 'couldn't create ._picture1.jpg files. Incorrectly i thought they were leftovers from when i modified the files from another Mac over SMB, thinking it was a hidden backup copy of the original file... oh was i wrong, it turns out that i do have files that correctly start with an underscore and that this normal user through SMB on Unraid cannot create files with such names. when i copy a file on the unraid share and then rename it to _file1.txt it just disappears. i thought: it just disappears from view, but no, it's gone it's not there. even checked with CLI from the UI as root. nothing... so there must be some SMB config instruction that i need to add to allow a regular user create files with such filenames, other than what appears to be added by default on Synology and QNAP. any ideas? Quote Link to comment
Frank1940 Posted August 23, 2022 Share Posted August 23, 2022 Check the status of this setting: If that is not the issue. Then try to do it without using rsync. I just tested using a Windows 10 computer. I, first, created a folder and a file beginning with an underscrore. Then I created a folder beginning with a '._' and generated a file in it with a '._' prefix. No problems in either case. Quote Link to comment
KristofG Posted August 23, 2022 Author Share Posted August 23, 2022 Thanks Frank1940, i checked those settings and hide 'dot' files is set to No on my end as well. the only difference is 'enhanced macOS interoperability' is set to Yes - was a default because i'm sure i didn't temper with it. i'll try the same form a Windows 10 PC as well. from a Mac however, copying the file in any other way succeeds but then gets hidden and then removed completely. same as when through Finder on the SMB-unraid share i would rename an existing file to '_file1.txt', it just disappears. however when i do the same as root via the CLI i can see the file with '_' prefix just fine and open it without issues in Finder on the SMB share. i know i could copy the whole tree from the unraid CLI as well using rsync but then all files are owned by root and unless someone tells me that's not a problem becuase SMB doesn't care about the underlying OS user, but i'd rather do it the other way round. Quote Link to comment
KristofG Posted August 23, 2022 Author Share Posted August 23, 2022 just to confirm: copy pasting the same files from Windows does work... i'll try regular copy from Macos next. though i need to in way to use rsync as the same folder structure of YYYY/MM/DD/<subfolder>/<files> exist at the destination already. i need to 'merge' folder and i think only rsync can do that. i just found an --inplace rsync option.. perhaps that's what i need. Quote Link to comment
Frank1940 Posted August 23, 2022 Share Posted August 23, 2022 (edited) 37 minutes ago, KristofG said: the only difference is 'enhanced macOS interoperability' is set to Yes - was a default because i'm sure i didn't temper with it. I believe it is not the default BUT is often required for the macOS to function (If you point you cursor at the 'Enhance macOS...', you will see the help for that function listed....) MacOs and SMB seem to have a love-hate relationship. Why, I don't know. Apple is generally known for attempting to make things easy to use. SMB can be very simple (on windows) to setup a working system... but that setup can/(probably) have a lot of security holes. Plugging those holes is what makes SMB difficult. Thinking about it a bit more. Unix, Linux and macOS allows one to 'hide' files/directories by beginning them with a period. Windows is the odd one out here. Edited August 23, 2022 by Frank1940 Quote Link to comment
KristofG Posted August 23, 2022 Author Share Posted August 23, 2022 thanks for pointing that out. in the meantime i've check the /etc/samba/smb-shares.conf and noticed the 'vfs objects = catia fruit streams_xattr' directive - probably necessary for Time Machine backups as you say. also i now appear to have working what i wanted using the extra --inplace rsync parameter as it now no longer create the temporary '._xxx.xxx' files, even from my macs. thanks for the help anyway. Quote Link to comment
Recommended Posts
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.