Eric on 6 Jul 2008 09:48:12 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Xubuntu auto mount


I struggled with the same thing and devised a script that runs when a user logs 
in.  It requires that sudo be configured to allow a user script to mount file 
systems.  Here is a copy of the script that I run today with a few identifying 
items removed:


cd ~/MOUNTS/

for dir in  user share music
    cd $dir >> /dev/null
    RES=`df -h . | gawk '/MOUNTS/ { print 1 } '`
    if  test "$RES" == '1' ; then
       echo $dir is mounted
       echo mounting $dir
       sudo /sbin/mount.cifs //MOUNTS/$dir /home/user/MOUNTS/$dir/ --verbose -o 
    cd ..

It's a hack but it works.  In the future I'd use the names of the existing 
directories in the "MOUNTS" directory an mapping to the server shares to be mounted.

I put a link to this file in the KDE directory that contains scripts to run on 
startup but you will, of course, have to choose a different course.

Hope this helps!


Adam J. Zion wrote:
> This should be an easy one, but it hasn't been.
> Let's say I have multiple users on a linux box. How can I configure it
> so that, if ilana logs on, she's automatically connected to her share on
> the linux server, and if adam logs in I'm automatically connected to my
> share. Note: all shares are SMB.
> Thx.
> --
> Adam Zion, MCSE+I, Registered Linux User #471910
> "If lawyers are disbarred and clergymen defrocked, doesn't it follow
> that electricians can be delighted, musicians denoted?" * George Carlin
> (RIP)

#  Eric Lucas
#                "Oh, I have slipped the surly bond of earth
#                 And danced the skies on laughter-silvered wings...
#                                        -- John Gillespie Magee Jr
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --