Re: [Hampshire] Where's the best place to mount NAS?

Top Page

Reply to this message
Author: Stephen Rowles
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Where's the best place to mount NAS?
Rob Malpass wrote:
>
>> Hi,
>>
>>
>>> If I want to mount a NAS a bootup - where should I put this (on Ubuntu
>>> but I
>>> assume something as fundamental as this applies to all distros)?
>>>
>> /etc/fstab?
>>
>>
>>> I've put it in /etc/init.d/rc.local
>>>
>> What, exactly?
>>
>
> sudo mount -t smbfs //sharename /mnt/wherever
>

If this is a laptop then you might want to use autofs the problem with
fstab etc. is that typically the network isn't available at the point
any of the drives are mounted as part of init. If using NetworkManager
(no sure if ubuntu does or not, I'm a fedora person) then the network
only gets brought up when you log in!

If you have autofs (again, no idea of ubuntu has by default) then there
will be various auto.SOMETHING. I have the following config:

in auto.master I have the following, -ghost means that directories are
always there, even if they are not mounted, this is very useful for some
programs where you needs to specify a directory and it will be mounted
the first time it is accessed. The timeout value means that the mount
will timeout after 60seconds, keep this small or shutdown will take ages!

/mnt    /etc/auto.mnt --ghost   --timeout=60


then in auto.mnt I have which defines a directory called photos, cifs is
a windows fileshare (which yours will probably be) and then the server
location.

photos          -fstype=cifs            ://miner/data/Photos


All of this means that my photo browsing program (picasa on linux)
points at /mnt/photos, and when it first loads up the auto mounter
mounts the directory and it all works beautifully (well for read-only
anyway! I have issues with read/write but that might be the server).

Autofs will create the directories for you and "just work"