SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2009-03-06 12:04:32

olliraa
Member
Registered: 2009-02-28
Posts: 16

autostart.sh and mounting a samba share?

I can mount my cifs/samba share from terminal like this:

sudo mount -t cifs -o username=blaablaa,password=blaablaa //192.168.1.1/Media /media/MEDIA/server

So why doesn't it work as a command in autostart.sh like this?

sudo mount -t cifs -o username=blaablaa,password=blaablaa //192.168.1.1/Media /media/MEDIA/server &

Any clues? I'd rather not touch my fstab wink

Offline

Help fund CrunchBang, donate to the project!

#2 2009-03-07 10:50:34

olliraa
Member
Registered: 2009-02-28
Posts: 16

Re: autostart.sh and mounting a samba share?

Ok, it seems that the problem is kinda very simple:

In the syslog my mount-command is executed before the Network manager "starts" the wired connection, so no wonder mounting a network share won't work smile

The problem is, that I don't know how to make my mount command to be run AFTER the network manager has started the connection. (or network manager to be run earlier) Any help?

My mount-command is the very last in the autostart.sh, so I'm kinda stuck here sad

Offline

#3 2009-03-07 11:13:40

pitje
#! Junkie
From: me to you
Registered: 2009-02-10
Posts: 437
Website

Re: autostart.sh and mounting a samba share?

you could try to 'sleep' for a few seconds before trying to connect to your samba shares:

(sleep 5s && sudo mount -t cifs -o username=blaablaa,password=blaablaa //192.168.1.1/Media /media/MEDIA/server) &


oh yeah? well, your momma dresses you funny and you need a mouse to delete files

Offline

#4 2009-03-07 17:00:33

fnordianslip
#! Member
Registered: 2009-03-02
Posts: 56

Re: autostart.sh and mounting a samba share?

On my cruncheee install,  there's a a mountnfs script in /etc/network/if-ip.d/

That might be a good place to look.

Offline

#5 2009-03-08 06:37:42

olliraa
Member
Registered: 2009-02-28
Posts: 16

Re: autostart.sh and mounting a samba share?

Thanks smile However, it seems that I actually got it working with no changes at all... I read something similar concerning samba shares and large number of files: it takes a while to "cache" them and show up in the mount directory. I'll test a bit further, but now it seems to work as I expected.

Offline

#6 2009-03-13 08:09:36

olliraa
Member
Registered: 2009-02-28
Posts: 16

Re: autostart.sh and mounting a samba share?

SUCCESS smile I put a 5 second delay in the mount command in the autostart.sh and it works. Hope this helps some other people too smile

Thank you pitje smile

(sleep 5s && sudo mount -t cifs -o username=blaablaa,password=blaablaa //192.168.1.1/Media /media/MEDIA/server) &

Offline

#7 2009-05-10 23:36:31

ZAP
#! Junkie
Registered: 2009-01-31
Posts: 350

Re: autostart.sh and mounting a samba share?

This method isn't working for me using #! Jaunty, and I'd like to use it rather than add mount info to /etc/fstab because that file is outside of my encrypted home directory. The shared directory isn't mounted, although if I paste the mount command into a terminal window it does work. I've tried increasing the wait time, but that doesn't seem to be the issue.

I also don't understand how a sudo command can be executed in autostart.sh without entering the password...?

Info on how to correct the neverending CIFS VFS shutdown error can be found here (I had to use K00 as a prefix on my laptop in order to avoid this error message):
http://blog.avirtualhome.com/2008/03/10 … s-related/

Offline

#8 2009-05-11 06:38:35

ZAP
#! Junkie
Registered: 2009-01-31
Posts: 350

Re: autostart.sh and mounting a samba share?

Hmm. If I add the command to my Openbox menu it works, although I have to enter my password into a terminal that opens up. Here's my menu entry:

        <item label="Mount Tooga">
            <action name="Execute">
                <execute>
                terminator --command="sudo mount -t cifs -o username=me,password=mypassword //192.168.0.120/archivos /mnt/tooga"
                </execute>
            </action>
        </item>

Offline

#9 2009-10-25 17:27:09

Zwopper
The GIMP Pimp
From: Deep in The Swedish Woods
Registered: 2008-11-28
Posts: 580
Website

Re: autostart.sh and mounting a samba share?

I simply put this in autostart.sh

# Mount Network Shares
(sleep 15s && smbnetfs -o nonempty ~/Network) &

My artwork at deviantART   |    My Tweet   | My upcoming web page
Crea diem!
Lenovo ThinkPad E320 | 8GB | 512GB Samsung 840 PRO SSD | Xubuntu 13.04 & #! Waldorf

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo