Mounting a shared folder in everyone's home directory

Simón Ruiz simon.a.ruiz at gmail.com
Tue Apr 27 15:51:44 BST 2010


Whoops; I'm just seriously used to "reply" replying to the list. :-)

On Mon, Apr 26, 2010 at 4:56 PM, David Groos <djgroos at gmail.com> wrote:
> Hi Simon and All,
>
> Thanks for your directions -- I spent a couple (few) hours on this this
> morning under a deadline and finally got it with some back-and-forth with
> alkisig on #edubuntu--Where would I be without it?
>
> My goal was to have a folder on my desktop where I could drop 30 or so small
> images, and then when students logged in they would see this same folder,
> could browse it and find the images they needed and drag them to their own
> desktop.  This was the functionality I was looking for.  Here is the
> solution I ended up doing
> 1.  Made a folder on my desktop, DogTraits
> 2.  Right clicked on it, selected Sharing Options, selected, 'share this
> folder' and gave it the name, Dog, then clicked, 'create share'.
> 3.  Then I used this command which didn't actually make any changes but
> showed what would happen:  "for f in /home/*/Desktop; do echo sudo ln -s
> /home/dgross/Desktop/DogTraits $f/Dogs; done"
> 4.  And since it worked, I removed the "echo" from the command, re-ran it
> and a symlink to the DogTraits folder was created on everyone's Desktop.
> 5.  On caveat--sometimes the 'Dogs' folder appeared under an exisiting
> folder so a student had to move aside one of the folders on their desktop to
> find this symlink.
>
> I'd like to make a wiki page on this process on Edubuntu's wiki--anyone give
> me a link to a new page or a good name for a page?  Thanks again for
> everyone's help and suggestions,
>
> David


David,

I'm beginning to believe you're using LTSP?

What you are doing in step 2 is only necessary if you want to share it
over the network using Samba/CIFS (a.k.a. "Windows" Networking). This
creates a share so that a Windows computer browsing over to
"\\YourComputer\Dog" will see the contents of that folder. The
symlinks are actually manipulating the filesystem rather than actively
"sharing" anything in the sense of that dialog box.

On the other hand, it's a lot of work to manage Symlinks, especially
if your list of users changes over time (e.g., if you ever need to add
or drop students, you'll need to remember to make sure this symlink is
there).

Also, if you ever want to do this same sort of thing with different folders,
It'd be a pain to write your script and manually do that every time...

Here's my idea/suggestion, leaving in step 2, forgetting about
Symlinks, and moving forward from there (I'm also checking the "Guest
access" checkbox when I create the share on my Desktop.):

3. "sudo mkdir /media/Dogs" - Create a folder to use as a mountpoint
in the /media directory
4. "sudo mount -t cifs -o guest //localhost/Dogs /media/shared" -
Mounts the Samba share (using your loopback device; this won't slow
down networking at all) to the folder "/media/Dogs"
 * When an external filesystem (i.e. not just mount --binding a
folder) is mounted in /media it shows up in your "Places" list and, if
you haven't changed the default settings, Gnome will place an icon for
it on the Desktop for everyone who logs in while it's mounted; if you
ever want to get rid of the icon for everyone, just unmount it.
5. In order to set it to mount this share on boot, edit /etc/fstab
("sudo gedit /etc/fstab") and add a line for
"//localhost/Dogs       /media/Dogs     cifs    guest   0       0"

The same caveat about the icon maybe showing up behind an already
existing icon applies.

Simón



More information about the ubuntu-education mailing list