ubermix Forums

Technical => Development and Scripting => Topic started by: Cytochromec on April 03, 2012, 04:01:08 PM

Title: Network File Storage
Post by: Cytochromec on April 03, 2012, 04:01:08 PM
We have a fairly solid use of network file servers in our district. We can create bookmarks so that students can access the drive quickly, but I wanted to see if we could have the same convenience of our windows mapped network folders. I have added a couple of scripts to automount a public student folder. This also means that there is no need to do any Libre Office work around, as LibreOffice can directly save into the server with this setup.

First I booted with -generic instead of -aufs to make the changes permanent. Then I made sure samba and smbfs was installed:
sudo apt-get install samba
sudo apt-get install smbfs

Then I created a folder to mount the network folder
sudo mkdir /media/server

Then in the file:
/etc/network/if-up.d/mynetstart

I added:
mount -t smbfs //our-server/folder /media/server -o uid=1000,gid=1000,umask=0022,username="generic-student-account",password=""

This means that when a network connection is established the server will be mounted. This works fine, but it wasn't shutting down due to the fact that the wireless was turning off before the folder was unmounted.

So I created a file called S15umount in /etc/rc0.d:

sudo gedit /etc/rc0.d/S15umount
 
with this text:
#!/bin/sh
sudo umount /media/server

and then made the file executable:
sudo chmod a+x S15umount

This works more times but not all the time, so it still hangs on shutdown. Any ideas or suggestions on how to fine tune this auto-mount process would be great. Once it is working perfectly I will post to the wiki.
Title: Re: Network File Storage
Post by: jnetman1 on April 04, 2012, 09:07:35 AM
A couple thoughts: It seems the easiest way to make this work would be to create a bookmark in the file manager (nautilus). To do that:
Then every time they click the bookmark, it will automatically handle the attach, and disconnect properly.

If you want to stay on your path, then there are a few other possibilities (one of which should work):

Hope this helps!