Problem Renaming or Moving Folders on SMB Share

ndudley
Contributor

We recently moved our main server from an XServe running AFP to Windows 2008r2 using the SMB protocol. We are experiencing an problem with our users being unable to move and/or rename folders and files on the server when connected via SMB from a Mac.

It seems to be that when a folder is open or in use by another user, the file is locked and asks for Admin credentials to move or change the folder. We haven't been able to figure out a fix for the problem. I was wondering if anyone else has stumbled across this problem or has a solution?

57 REPLIES 57

uurazzle
Contributor II

FYI:

We posted about this in our blog:

Mac Bug Connecting To Non-Apple SMB Shares

We filed a bug with Microsoft & Apple enterprise support and it was found to be a Apple bug and is rumored to be fixed in macOS High Sierra. I would recommend testing the macOS High Sierra beta/GM or wait until the official release on Sept 25th and test again.

Note, we do not see the issue with Apple Server SMB shares.

tnielsen
Valued Contributor

God Bless you @uurazzle

razzle dazzle!

For the record, we've been having this issue for years. Definitely an OS X/Apple root cause/problem.

ebrowning
New Contributor II

My two cents here. I've been using Univention Corporate Server which uses Samba 4.6.x for it's shares and as an AD server. I've found that on the Linux side of things I needed the VFS objects of Catia and Fruit. You have to enable extended attributes for each share too. It for the most part works on our Yosemite through High Sierra machines. Since enabling these options I've noticed server load go WAY down. I also disabled ACLs so that it's just simple UNIX permissions since we are an all Mac shop. Now if I can just keep the browsers from periodically crashing.

d0_0b
New Contributor

Hey everyone,

I solved this issue by following various instructions.

First, on the macOS client, issue the commands found in Adjust SMB browsing behavior in macOS High Sierra 10.13.

Then, on the Samba server, use the configuration https://gist.github.com/raspi/9986175. Note that I only used the...

[global]

...section from that config. And obviously tailor the config to your own environment.

The Samba server I use is a FreeBSD 11.1 machine with Samba installed via the pkg(7) command. The package is samba47-4.7.4_1. But any OS should work as long as Samba is properly configured. I use user type Samba security and created the Samba user via this command:

sudo pdbedit -a username

Ideally use the same username / password as the one from which the macOS client is going to access the Samba share.

Note that I did have to reboot the macOS client to make sure it worked properly. Otherwise, the Finder would refuse to unmount the SMB volume or would throw an exception saying that the file(s) were already in use. Which was pure BS.

HTH,

David

WillyMac65
New Contributor

ndudley, did you ever find a solution to your problem? I work in an environment that uses iMac computers running OS 10.9.5 and they are connecting to a Microsoft 2016 Server via SMB. The issue we are exhibiting is similar to what you were experiencing in that the Mac creates multiple files on the server side and then fails to release them once the customer on the Mac side closes the files thus prompting the customer with a file in use error window. Any help is greatly appreciated

rgerman
Contributor

I am having a lot of problems with Excel and SMB shares on our Windows 2012 R2 Shares server.

I am ready to either switch the effected users to PC's or put ExtremeZ-IP on the server.

Problems include...
• Open Files - Files locked because they show as open on the files server until the user un-mounts the volume
• .smbdelete file - appearing and causing issue when users try to save xlsx files
• Errors - users cant save xlsx files but can save xls files
• Ghost folders mutiplying every time a user saves certain excel files. Example "every time a user saves an excel file called test... a folder is created test.xls.sb-141gbdb4949-zxlu8w" The next save will create another folder but the charaters after xls.sb- are different.

I have to say... Mac SMB and Windows SMB do not play well at all. I have tried multiple fixes to no avail. Has anyone found 100% success fixing these issues. All my Macs are on High Sierra.

Thanks,
Ray

rkovelman
New Contributor III

@rgerman I use Acronis Files Connect and have so for years, which allows you to share out shares as AFP. No issues. I have not tested this part out, but supposedly 10.13's SMB config is better than all previous versions. Might want to play with that.

yadin
Contributor

Apple doesn't play well with others period, they play by their own think different rules.
That said, have not seen the issue you're reporting @rgerman outside of one caveat. If people on Mac use cover view, having a file selected or previewed in any way is the same as having it open. We found this a couple years back and had to advise all users never to use cover flow because of that issue.

kerouak
Valued Contributor

Extreme z - ip resolves the issues, however , if you grant read/write access to the . Temporary items hidden folder at the root of the share, that shld resolve it also.
Its down to the cached fkle excel creates. You wouldnt have issues saving it as an non xlxs file..
Gluck!!

rgerman
Contributor

7a93b87fd1574d4e865b3bafb2fab98e

I still get errors, even when read/write is granted to the invisible .Temporary Items folder. The issue seems to be tied to .xlsx format. Oncve the error comes up, the user is unable to save the file to the server or even locally. The only way to save the file is to change the save format to .xls

rgerman
Contributor

I loaded Acronis Files Connect; formerly ExtremeZ-IP on our server and connected the users via AFP. Since, then... I have not had any reports of the xlsx issue. Seems to be the only solution until Apple fixes the SMB issues.

eWhizz
New Contributor II

Often due to incompatible folder/filenames.

There's a long list of incompatible characters that are allowed on the Mac, but not Windows that may be the cause here.

One of the most insidious, is a space at the end of the filename or folder name. Some users just get into a habit of typing a space after everything they type, including when naming a file.

The Mac lets this happen, Windows just has real issues with it.

Characters to avoid —

pound/hash

% percent
& ampersand
{ left curly bracket
} right curly bracket
back slash
[ left square bracket
] right square bracket
< left angle bracket
> right angle bracket
* asterisk
• bullets
? question mark
/ forward slash blank spaces
$ dollar sign
! exclamation point
' single quotes
" double quotes
‘ ” curly quotes
: colon
@ at sign
| pipe vertical line
= equals
~ tilde
` tick
+ plus

The following file names are also reserved under Windows:
com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, lpt9, con, nul, aux and prn
(in upper or lowercase)

Don't use underscores _ at the very start or end of your filename
Don't place a period right at the end of the name
Don't place a period at the start (this hides the file on a Mac)
Don’t start or end your filename with a space, period, hyphen, or underline.
Keep your filenames and folders to a reasonable length and be sure they are under 31 characters.
Some operating systems are case sensitive; always use lowercase to avoid confusion.
Don't change the files extension ie .jpg, unless you know what you are doing.

Please let me know if you have found any other examples or characters to avoid, or weird situations where normally legal characters cause issues.

ballard75
New Contributor

We've been struggling with this since we migrated to our RHEL server back in August.

Has anyone had any luck with running these commands on clients?

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

defaults write com.apple.finder AppleShowAllFiles -bool TRUE
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
reboot

Has this solved the issue?

dewever
New Contributor

I had this problem the last 2 years and it is now solved!!!
My configuration :
- synology nas with smb, afp disabled
- problem : sometimes i cannot drag and drop files and folders around from 2 of my mac's, sometimes I cannot delete files or folders
- setup of the macs : latest version of Mojave (10.14.5)
- no special configurations (terminal commands) on the mac clients
This has been driving me crazy for the last 2 years

So I made a test setup with a new synology share with a few folders, subfolders and files and tried to repeat the problem.
This share is on a newly installed synology nas, so there is no problem to be expected from that side.
Trying to drag around files and folders I discover that I have the drag and drop problem on 2 macs but not on a third mac.
The mac where everything works flawlessly is configured exactly like the other 2 : Mojave (10.14.5). On this third mac I can drag and drop files and folders on an SMB share without any problem.

The only difference I can think off between these macs is the following : - the 2 macs that have the problem were installed/migrated from previous mac backups from a time capsule backup 3 years ago...
- that third mac was a clean install

So I thought : maybe the user profile is corrupt :
I created a new user : same problem

So I thought : maybe I should reinstall the mac and I reinstalled but the hard disk was not formatted so my user and files were still present.
same problem

So I formatted the whole hard disk and did a clean install on a newly formatted disk :
PROBLEM SOLVED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Dragging and dropping files is working perfectly now.

I hope this helps a few people that have had the problem for as long as I did...

I will now let this newly installed mac run for a week and if no problems surface, I will also reformat and reinstall the other bad mac

mssaffan
New Contributor II

Hi All,

Sorry to reopen an old thread, but my company is still having this issue.
SMB Shares, Windows Server 2012R2. It occurs on MacOS 10.14.6 or 10.15.*. Binding to AD
I've been doing some research and it seems this might've been fixed for a lot of people in El Capitan or Sierra, but it still continues to be an issue for us!
This forum has a great video of the issue:
https://www.synology.com/en-global/dsm

Any solutions that don't involve getting new software or hardware?
Otherwise - any recommendations on software?

Thanks,

Mike

rgerman
Contributor

Hi Mike,
I don't know if this will work for you with SMB but I switched to Acronis Files Connect and AFP after beating my head against the Windows SMB issues. Acronis started having some issues after a while and it turns out that the SYSTEM, ADMINISTRATORS and CREATER OWNER needed permissions on the shared folder for the system to be able to effectively allow writing of Mac Office temp files, etc... Now the article I am posting is talking about NFS, but once I added the SYSTEM and CREATOR OWNER all the AFP permission issues went away. I was really curious, if having the same permissions on an SMB folder would fix. Its worth a try https://kb.acronis.com/content/47135

The only other issue I ran into with SMB was the slow directory redraws but was able to fix that by running defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE as the logged in user.

Good luck!
Ray

llitz123
Contributor III

We use Acronis and it doesnt solve any of the issues. I have also done all of the troubleshooting here at various times and it hasnt fixed anything.
Our two main issues:
We have users unable to move folders because of open files - which are open for no apparent reason under the logged in user on server (monitored by Acronis Files Connect Admin).
We have temp folders that appear and disappear and some that stay shown which confuse staff.

In limited testing it looks like the Apple SMB solution helps so I'd like to roll it out to staff via JAMF yet need help sending the command to clients.
How do I efficiently run the following command for logged in users so it edits their plist instead of the system's:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

Any help is greatly appreciated.

rwinfie
Contributor

@llitz123 you should be able to add the domain com.apple.desktopservices to your application settings in the config profile and deploy to all ![optional image ALT text](
6eac0b43c25e4fe49353bc6ebed1f9b6
)