automatically mount network drive - 10.04 LTS

Arnaud G lepelerin2002 at yahoo.com
Tue Feb 15 01:58:45 UTC 2011


Hi All,

I am back to the drawing board. Below is what I need to accomplish. I have been 
looking around, trying different solutions, experimenting but so far I am not 
satisfied with the result I got.

We are migrating people, in my university, to Ubuntu 10.04 LTS. On the "desktop" 
side (approx 500 users) LTSP will be used. It works. So far so good.
By default everything is saved under their "Documents" folder.

My problem is about the laptop users. They will have 10.04 LTS installed on 
their machine.  When they use their laptop their work is saved by default in 
their "Documents" folder. So far everything is good.
I would like to synchronize their laptop "Documents" folder to their network 
drive "Documents" folder. I can use rsync for that once their network drive is 
"mounted". I could use something similar to that in their .bashrc or write a 
little script

if [ ! -f ~/homework/.lock ]; then
        /usr/bin/smbmount //ldap/username ./homework -o noperm
fi

That would be fine but one thing is they should not have to open a bash, type 
anything or double click something. The reason is that they will never 
synchronize their folder if they have to do something. I know, I know, they are 
academics :)
Then we would be held responsible for any loss or whatever went wrong.

If I put in fstab the mount instruction and they are not connected to the 
network, it will "freeze" until it times out. Can be a pain and a source of 
complaints. XP was better :(

Basically what I am looking for as a solution is this:

a) When the machine gets an ip from the network at work, their network drive 
should be automatically mounted. A mount point will be created on their default 
install.

b) When the laptop gets an ip that is not from work, the "mount instruction" 
should immediately be ignored.

c) If the machine is already up and running, but was not connected to the 
network, and they connect it to the network, the drive should be mounted 
automatically. At this point I would be able to sync both directories (local and 
network "Documents"). I will use a cron job for that. Maybe not the best 
solution but I have limited knowledge, so I use what I know.

I am thinking there might be a possibility to accomplish what I described above 
with pam_auth. If there are authenticated to the network, the drive is mounted, 
if not it is not mounted. I am not sure though if it can be done that way. I 
still have some reading to do, but before I continue, I would like to know if 


1) it's make sense to do it the way I described it

2) if there is a better solution

3) what people do in that situation.

Maybe I am totally missing something here.

Your input and idea would be more than welcome. I am ready to experiment more.

Thank you in advance for your time.

Regards,

Arnaud


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110214/e2cb94d6/attachment.html>


More information about the ubuntu-users mailing list