I originally posted this on the macrumors.com forum, so I’ll copy/paste the relevant parts over here.
I wonder if you could help me troubleshoot a problem I have with my shared network volume. I have my iMac and PC connected to each other through the ethernet. The iMac is set to read/write the shared network volumes on my PC. The Finder is used to set up the SMB connection. Everything works fine. Mac applications are able to read and write files to the PC.
However, after a day or so (during which the PC has been kept on, while the Mac has slept) problems occur.
Attempts to read/write to the directory results in the following error message:
Sorry, the operation could not be completed because unexpected
(Error code - 1407)
Attempts to eject the shared volume results in the following error message:
A disk on 'pcxp' is in use and could not be ejected.
Try quitting applications and try again.
In terminal, I attempt to identify the open files:
lsof | egrep 'pcxp'
and get the following result:
lsof: WARNING: can't stat() smbfs file system /Volumes/Share
Output information may be incomplete.
assuming "dev=2f00000a" from mount table
Dock 96534 user [...] 896612 /Users/user/Shortcuts/pcxp
I try to kill the dock’s connection to the open file:
kill -9 96534
The dock is relaunched but the problem remains, this time with a new process number 97642.
When I try to restart my iMac, the desktop will close, and only my wallpaper remains. There, it will remain hung until I do a cold boot.
Can anyone figure out what is wrong. It’s pretty annoying to have to reboot my Mac daily.
Thanks a lot for your help!
And here’s my reply:
LMAO, I was about to reply having the same issue. Then, while trying to reproduce the steps I took, I figured out the solution 😀
So I *had* exactly the same problem here between my Mac Pro and my XP PC. Same usage pattern (PC stays on, Mac sleeps every night). Fortunately, I only *had* this issue once in about two weeks, but it *was* annoying as hell!!
Some additional info I can provide on the issue’s behavior:
First off, I had 3 smb filesystems mounted when it happened. Let’s call them [smb1], [smb2] and [smb3] here. So I did the following:
- Next, running
sudo umount /Volumes/[smb1]
-> HANGS, yes it blocks the terminal, tried to kill -9 the umount process without any success!!
I was right about to give up, post this answer and hard reset the machine again when I tried the following:
sudo umount -f /Volumes/[smb2]
All of a sudden, the finder flashed a window (had no chance to see what it was) and the previously hanging ls and umount processes were gone! The finder GUI listed the smb shares on the remote server again and everything seems fine again!
So the steps to solve the issue would be:
- Run “lsof” in terminal
- See about what smb mounts it complaints
- sudo umount -f [any_failing_smb_mount]
Be aware though, that unmounting a filesystem using the force flag may produce unexpected results, but I guess it’s better than hard resetting the Mac and thus hitting the HDDs every day 😉