[Sussex] Mounting remote disks

Jan Henkins jan at henkins.za.net
Sun Oct 13 21:03:23 UTC 2013


Hello Brendan,

On 13/10/13 16:40, Brendan Whelan wrote:
> I use cifs to mount a remote drive at a client's site. Currently, the 
> mount is part of a cron job and I would like to reduce the system 
> overhead of repeated unmount/mount commands. Could I simply add a line 
> in fstab? 

Yes, indeed you can.

> Periodically, the remote drive will probably become inaccessible 
> because of network glitches or reboots of that system. Will fstab take 
> care of the remount when the remote drive becomes accessible again? Do 
> I need to include "auto"? 

All the keyword "auto" means that it will automatically mount the volume 
during bootup. This unfortunately does not mean that the volume will be 
remounted automatically if there was a problem. So instead of using an 
entry in fstab, a possible alternative solution would be to use autofs. 
Here are two relevant sites with info:

http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs
https://help.ubuntu.com/community/Autofs

So instead of mounting things automatically during bootup, autofs only 
mounts the remote share as soon as it's accessed. That way if the 
mount-point disappears, it should connect properly the next time it's 
needed provided the remove share has been restored. This works well with 
NFS (which we use extensively at work), but since I haven't used autofs 
with CIFS I cannot vouch for it's suitability in practise. The 
documentation suggests that it's solid, so please test this properly 
before you trust it implicitly.

> If I don't get the new line right first time in fstab then presumable 
> the current lines will continue to work?

All the other entries in /etc/fstab will still work if one line is wrong.

Hope this helps!

-- 

Regards,
Jan Henkins




More information about the Sussex mailing list