Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Filesystem Timeouts (a mini HOW-TO)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Filesystem Timeouts (a mini HOW-TO)
Authored by: patjensen on Jan 22, '03 03:20:01PM

Back in the day, if you used NFS and mounted your volumes off of a file server, you had the choice to use what were called soft mounts and hard mounts. Hard mounts let the kernel and the file system buffer every file operation (reads and writes). If the file server went off line, any file operations would "hang" and wait for it to come back up before the operation was completed. This includes things like listing the directory even. This was good if you wanted to prevent data loss at the cost of waiting for the server to come back online.

Soft mounts would let the file system driver gracefully release the connection, and give an error to any user applications but not preserve the file operation (reads and writes). The SMB filesystem driver is capable of doing this, for more information type "man mount_smbfs" in your Terminal window. Something along these lines may do the trick:

mount_smbfs -R2 -T5 //PATJ@JUDY/MUSIC /Volumes/judy

This would mount a share called MUSIC on JUDY with the username PATJ to /Volumes/judy. The trick here is the -T5 which means timeout after 5 seconds of no response, and -R2 which means retry the file operation twice before giving up. To close the share, you can either drag it to the Trash from the Finder, or enter in umount /Volumes/judy at a Terminal prompt. If you are mounting a volume over a dial-up or slow WAN link, you may want to adjust these timeouts to what works for you.

This should alleviate your problem with having your processes hang awaiting a response. I'm unsure of what the default timeout is without looking at the source. Try this out by mounting your shares from the Terminal and see if it helps you.

Hope this helps. Cheers.


[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: phc on Jan 23, '03 02:49:27AM

I'll have to keep this tip in mind next time I mount shares remotely as I just happened to run into this exact problem the other day.

In the event that you use mount_smbfs without any options...

umount ./theShare

also works; but as I discovered everything had locked up, I had to login from a different computer and issue "umount". And then a restart fixed everything.

[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: bax on Jan 23, '03 06:42:29AM
An option to enable these settings on all mounted shares would be to rename /sbin/mount_smbfs to e.g. /sbin/mount_smbfs.bin and writing a script named /sbin/mount_smbfs with the following contents:
#!/bin/sh /sbin/mount_smbfs.bin -R2 -T5 $@
Don't forget "chmod +x /sbin/mount_smbfs".

[ Reply to This | # ]
Filesystem Timeouts (a mini HOW-TO)
Authored by: xApple on Nov 12, '06 08:47:42AM

Very intresting !
I've been searching the net for some time now on how to change the default timeout time before disconencting... The Finder has a much too long one !
Was hoping it would just be a parameter to change in some obscure file with the proprety editor... but whatever solution it is...

So could you be a bit more precise on how to do such a thing ?

Thanks a lot ! Your help is greatly appreciacted

[ Reply to This | # ]