Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] unmount, remount on one click?

13 Posts
2 Users
1 Reactions
81 Views
(@rebop)
Active Member
Joined: 6 days ago
Posts: 6
Topic starter  

Hi there,

Use Connect Me Now daily. Realized that my Synology NAS refreshed contents and folder sizes in real time on Windows, but not in Mac. Cannot find any solution other than ejecting then remounting the NAS. That works.

Anyway to make this a one button or keyboard shortcut command for this specific drive to eject then remount?

 

Thanks!

~Bob



   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

Hi Bob,

This would be a macOS related issue.
ConnectMeNow only executes the actual mount command.
Further file handling is all done by macOS.

 

The only workaround I could find was relaunching Finder (other filemanagers like ForkLift and PathFinder have a refresh button - I prefer ForkLift since its a one time payment versus subscription none-sense, and it less convoluted with features I do not need).

  Press "Option" key and keep it pressed, right click on the Finder icon, and choose "Relaunch" (same a using "Force Quit").

I'm sure there must be a more elegant way to do this.

 

This Apple Script (you can run it from Terminal) seems to trigger a refresh, but found it wanting my password or touchID for each open Finder window it seems.

osascript -e 'tell application "Finder" to tell front window to update every item'

 

Note: Just found this article on GitHub that may be helpful - but be very careful when tinkering with these suggestions and use them only if you understand the implications. The one at the bottom may be helpful (link), but again, be careful editing system files like nsmb.conf.

 

If you run into a Terminal command that does this in an elegant way, then please share it here, so I can actually implement een refresh option in ConnectMeNow 😊 



   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

Just a thought: it could be related to the SMB implementation on your NAS. Older NAS devices use something like SMB1 or SMB2 whereas modern NAS devices support SMB3 (which is what your Mac prefers). Not sure if it is a setting on your NAS or your NAS may be too old.



   
ReplyQuote
(@rebop)
Active Member
Joined: 6 days ago
Posts: 6
Topic starter  

Thanks Hans. I'll keep poking around.

I thought perhaps if I did a one click eject on the NAS that Connect Me Now might be able to be told to auto remount if I did that. Only for that NAS drive.

I'lllet you know if I find anything.



   
ReplyQuote
(@rebop)
Active Member
Joined: 6 days ago
Posts: 6
Topic starter  

I'll look.



   
ReplyQuote
(@rebop)
Active Member
Joined: 6 days ago
Posts: 6
Topic starter  

I'm set for SMB2-3. SMB1 has big warnings to Ransomware. Any chance encryption settings could be preventing the auto refresh?

 



   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

Posted by: @rebop

Thanks Hans. I'll keep poking around.

I thought perhaps if I did a one click eject on the NAS that Connect Me Now might be able to be told to auto remount if I did that. Only for that NAS drive.

I'lllet you know if I find anything.

Mount and unmount is sequence may trigger this, but not the most elegant way. 😉  
I'm open for finding another trick, just couldn't find one while searching just now.

SMB1 is pretty bad when it comes to security indeed. Depending on the age of your NAS this could have been the only option. But by the sound of it, your NAS does SMB2 and 3. Nice!

 



   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

Since I rarely see this happen, like super rarely, I don't know how to test this, a trick I found:

Press and hold the Command key, and then tap the Up key and after tap de the Down key.

Effectively going one directory level up and back to the directory where you were. Seen claims that this refreshes the Finder view, but like I said: am unable to test and confirm this.



   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

You may benefit from disabling the SMB cache.
Form this article to disable the SMB cache (testing i myself now to see what the negative impact will be):

Open nsmb.conf as root, then set the dir_cache_max_cnt value to zero by adding these lines to the file:

In Terminal:

sudo nano /etc/nsmb.conf

(you'll need to enter your password)

Add the following:

[default]
dir_cache_max_cnt=0

Save with CTRL+X and confirm the question "Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?" by pressing the Y key.

Next make sure all mounted SMB shares are UNmounted.
Once all are unmounted, mount the shares again.

Note: I even rebooted my Mac, and so far I do not see a negative effect yet - even very large directories popup pretty fast.


This post was modified 6 days ago by Hans

   
ReplyQuote
(@rebop)
Active Member
Joined: 6 days ago
Posts: 6
Topic starter  

@hans Please don't go to any trouble. I thought maybe CMN could do this and I wasn't seeing it.

CMD up and down was one of the first things I tried a week or so ago. Does not refresh. There was one other CMD xxx but cannot recall what. Did not work either :)

Did you make a noticeable change to the NAS from another computer and see the change in real time?

I can add a 25GB file to the NAS in windows and Mac will not see the folder size change until eject/remount.

 

But again, please do not spend time on this. I thought if easy, great, another benefit of CMN.

Trying to do as automator which ejects easily, but once ejected will not find the NAS to mount. But its only a few clicks to eject, remount and open the NAS.



   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

No worries - I find it an interesting feature to add to ConnectToMeNow indeed ... well, if I could have found something that I could implement 😉 

On that note: the way you're experiencing your NAS share is not the way it should work, right?
I mean, you should see a file when you add it.

The change in the /etc/nsmb.conf is something you can skip. I noticed this morning that it actually makes things worse.
Your milage may vary of course.

Did you check the Synology forums?
SMB3 supports the so called "Change Notification (CNF) protocol" which means that changes on your share can be reported by your Synology to your Mac. If this is not implemented on the Synology side of things, or not enabled (doubt you can find that setting in the user interface), then this may contribute to a poor update performance.

Not sure if this is an option on a Synology NAS: but maybe set it to only SMB 3 (versus SMB 2-3)?
Note that this may impact other clients connected to your NAS.



   
ReplyQuote
(@rebop)
Active Member
Joined: 6 days ago
Posts: 6
Topic starter  

Hi Hans,

I have tried a number of things s o unsure which worked, but I now see the changes in real time. Wish I could tell you what I did :)

Thanks.

~Bob



   
Hans reacted
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2984
 

Awesome!

I'll mark this topic as "solved" haha ... if you ever remember what happened by accident; then please share 😉 



   
ReplyQuote
Share: