[Sussex] Mounting remote disks

Brendan Whelan b_whelan at mistral.co.uk
Mon Oct 14 10:04:27 UTC 2013


Jan, Many thanks for your detailed response. I had started looking at 
the autofs method then hit problems so asked about fstab.
Below are copies of the files that I am using for autofs and the results 
of trying to mount the remote drive. ( I can mount the remote drive from 
a shell script using "mount" which confirms the address, username, 
password, etc. ) As can be seen the problem that I have hit relates to 
"nisplus" and "nis+ tables". Searching on the Internet gives some 
confusing information. Any suggestions as to what I need to set/change? 
Thanks, Brendan

cat /etc/auto.master
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc    /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#    "nosuid" and "nodev" options unless the "suid" and "dev"
#    options are explicitly given.
#
/net    -hosts
#
# 10 Sep 13 BW Added mount for shared area
/mnt/bu_server /etc/auto.bu_server
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

----------------------------------------------------------
cat /etc/auto.bu_server
bu_server -fstype=cifs,rw,user=my_user,pass=my_password 
://10.1.101.104/bloodbm

----------------------------------------------------------
chmod 755 /etc/auto.bu_server

----------------------------------------------------------
service autofs restart

---------------------------------------------------------
ls -ls /mnt/bu_server     - no files listed

---------------------------------------------------------
/var/log/messages contains:
automount[25594]: lookup_read_master: lookup(nisplus): couldn't locate 
nis+ table auto.master

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

On 13/10/2013 22:03, Jan Henkins wrote:
> 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!
>




More information about the Sussex mailing list