Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-22-2014, 02:44 PM
|
#1
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
Automatically unmount samba shares when they dissappear?
I have a separate fileserver box that provides a Samba share of some generic stuff I mount to my local box as /public. If that fileserver box goes down (it doens't crash, it is cleanly shutdown when not needed for long periods), then the Samba share remains mounted on my local system and if I bring up Thunar to browse files, it hangs because of the missing Samba share. I'm not trying to look for files on that missing share, only on my local system, but Thunar still hangs. The fix is to kill Thunar, manually unmount the Samba share, and try Thunar again.
It seems like there should be an fstab entry that could handle this automatically. Something like "errors=unmount", but I don't see that documented (but I haven't tried it to see if that syntax actually works anyway). Is there an approved way for doing this?
Here is my current fstab entry:
Code:
//192.168.0.4/public /public smbfs credentials=/root/.smbcredentials,errors=remount-ro 0 1
|
|
|
10-23-2014, 03:41 AM
|
#2
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by haertig
I have a separate fileserver box that provides a Samba share of some generic stuff I mount to my local box as /public. If that fileserver box goes down (it doens't crash, it is cleanly shutdown when not needed for long periods), then the Samba share remains mounted on my local system and if I bring up Thunar to browse files, it hangs because of the missing Samba share. I'm not trying to look for files on that missing share, only on my local system, but Thunar still hangs. The fix is to kill Thunar, manually unmount the Samba share, and try Thunar again.
It seems like there should be an fstab entry that could handle this automatically. Something like "errors=unmount", but I don't see that documented (but I haven't tried it to see if that syntax actually works anyway). Is there an approved way for doing this?
Here is my current fstab entry:
Code:
//192.168.0.4/public /public smbfs credentials=/root/.smbcredentials,errors=remount-ro 0 1
|
well, you're listing your share in the global /etc/fstab, which means it is supposed to be there. Always. Period. For all I know, there is no way to mount file systems "only if" when they're in fstab.
On the other hand, what you describe is a misbehavior of Thunar for me. Once you display the root directory / in Thunar, it tries to scan all top-level directories to display the number of items in them in the "size" column. IIRC, this can be disabled (haven't used Thunar/xfce for years, so I'm not sure), which might be a workaround for you. However, Thunar shouldn't hang permanently in that case; instead, it's supposed to stall for a moment and then continue gracefully after a timeout of a few seconds, ignoring the directory that made trouble.
You might also consider using autofs instead of static mounting. Then autofs could make sure that the share is always displayed, but mounted only if you access it (and, optionally, unmounted automatically after some time when you don't). I'm doing it like that across all my machines, most of which aren't permanently on.
[X] Doc CPU
Last edited by Doc CPU; 10-23-2014 at 03:54 AM.
Reason: Typo
|
|
|
All times are GMT -5. The time now is 07:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|