+ Post New Thread
Results 1 to 11 of 11
Mac Thread, mount_smbfs: mount error in Technical; I'm in the process of using launchd to launch a script at login which automounts students windows home shares to ...
  1. #1

    Join Date
    Jan 2010
    Location
    Northampton
    Posts
    13
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    mount_smbfs: mount error

    I'm in the process of using launchd to launch a script at login which automounts students windows home shares to the desktop.

    I am using the script which is available from the deploystudio wiki (deploystudio - OS X 10.5 Login Hooks), but I am consistently getting errors.

    the jist of the code i'm using is...

    ## Set the $usrname variable
    usrname=$(/usr/bin/id -P | awk -F: '{ print $1 }')
    if [ $usrname != "admin" ]
    then
    if [ $usrname != "root" ]
    then
    mkdir /Users/$usrname/Desktop/"School Home"
    mount_smbfs //$usrname@[server]/$usrname$ /Users/$usrname/Desktop/"School Home"

    I have given up trying to get it working in the script as I am consistently getting the following error in the log...

    mount_smbfs: mount error: /Users/[usrname]/Desktop/School Home: No such file or directory

    I have started trying to simply get this working in the terminal replacing the variables with ones i know are correct, but get the same error consistently saying that the path doesn't exist!! But it blatently does!!!

    Can anybody see what i'm doing wrong, or have had the same problem and solved it? I've spent the past 48 hours pulling my hair out!!

    thanks,

    Arron

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    I think it needs escaping:

    Code:
    mount_smbfs //$usrname@[server]/$usrname$ /Users/$usrname/Desktop/School\ Home
    Alternatively, just leave out the space altogether - it will make life easier (I wish I could just disable the space bar for file and folder names :-))

  3. #3

    Join Date
    Jan 2010
    Location
    Northampton
    Posts
    13
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I think i've just figured out what's wrong. The address to the share was incorrect, but the log file misled me into thinking something was wrong with the path.

    Damn log files!!

    Thanks for your help.

  4. #4
    Carter's Avatar
    Join Date
    Sep 2010
    Location
    Canada
    Posts
    269
    Thank Post
    10
    Thanked 64 Times in 41 Posts
    Rep Power
    18
    I'm having some trouble understanding this script ... rather how to fill it out correctly if not doing it right below.

    This is what I see from above:
    Code:
    ## Set the $usrname variable
    usrname=$(/usr/bin/id -P | awk -F: '{ print $1 }')
        if [ $usrname != "admin" ]
         then
            if [ $usrname != "root" ]
              then
                mkdir /Users/$usrname/Desktop/"H Drive"
                mount_smbfs //$usrname@Server_Name/$usrname$ /Users/$usrname/Desktop/"H Drive"
           fi
         fi
    killall Terminal
    Here is what I've get out of it for our site:
    Code:
    Set the $usrname variable
    usrname=$(/usr/bin/id -P | awk -F: '{ print $1 }')
        if [ $usrname != "admin" ]
         then
            if [ $usrname != "root" ]
              then
                mkdir /Users/$usrname/Desktop/"H Drive"
                mount_smbfs //$usrname@SERVER/share$/$usrname$ /Users/$usrname/Desktop/"H Drive"
           fi
         fi
    killall Terminal
    where the following is the server & share path
    Code:
    SERVER/share$/
    For testing I'm running "su /script path
    I get prompted for a password, then get this error - "username" is not in the sudoers file.


  5. #5
    AntonioRocco's Avatar
    Join Date
    Oct 2008
    Location
    South Yorkshire
    Posts
    262
    Thank Post
    9
    Thanked 112 Times in 95 Posts
    Rep Power
    39
    @salinpoo

    If I've understood you correctly why don't you use WorkGroup Manager to achieve this? You can specify a policy to auto-mount shares at a login time by installing WorkGroup Manager on a client workstation. Use Connect to Server from the Go Menu and try to use the IP Address of the Samba share as it tends to be more reliable. There are threads that have covered this already.

    @Carter

    If you need to issue a command or login to a shell using root you really should be using any one of these:

    sudo -s
    sudo su
    sudo su -

    My personal preference is "sudo -s" however it's your choice. You could refer to the relevant manual pages if you wish:

    Loading…
    Loading…
    Loading…

    All of Apple's Manual Pages for Server and Client OS are listed here:

    Loading…

    If you want a paper copy this command will create a pdf of a desired manual and save it to your desktop:

    man -t binaryofyourchoice | pstopdf -i -o ~/Desktop/dscl.pdf

    Where binaryofyourchoice could be sudo, su, dscl and so-on. If you want to see all the binaries (commands) installed simply launch Terminal and hold down the escape (esc) key. After a few seconds you should see "Display all xxxx possibilities? (y or n)." Simply type y and you'll see all the binaries listed. Depending on which OS you have the figure listed will be either more or less. Ironic that I end the previous sentence with more and less as these are two commands that are often used.

    Antonio Rocco (ACSA)
    Last edited by AntonioRocco; 1st October 2010 at 05:04 PM.

  6. #6
    Carter's Avatar
    Join Date
    Sep 2010
    Location
    Canada
    Posts
    269
    Thank Post
    10
    Thanked 64 Times in 41 Posts
    Rep Power
    18
    Even running sudo this does not fix why i get the message error that it will not work. Am I not filling in the server info correctly.


  7. #7
    AntonioRocco's Avatar
    Join Date
    Oct 2008
    Location
    South Yorkshire
    Posts
    262
    Thank Post
    9
    Thanked 112 Times in 95 Posts
    Rep Power
    39
    @Carter

    Unless it's a typo it does not look like you've commented out the first line in your script.

    Antonio Rocco (ACSA)

  8. #8
    Carter's Avatar
    Join Date
    Sep 2010
    Location
    Canada
    Posts
    269
    Thank Post
    10
    Thanked 64 Times in 41 Posts
    Rep Power
    18
    Now just to confirm if I can get the share to mount I'm running the following

    Code:
    sudo -s mount_smbfs //$usrname@servername/home$/$usrname$
    and I should be able to mount this from here should i not by hand by running in terminal?

    I still get the error "username" is not in the sudoers file

    Yet I can run from the "connect to server" option by putting in smb://servername/home$/username and it mounts without an issue


  9. #9
    AntonioRocco's Avatar
    Join Date
    Oct 2008
    Location
    South Yorkshire
    Posts
    262
    Thank Post
    9
    Thanked 112 Times in 95 Posts
    Rep Power
    39
    Hi

    Try: sudo mount_smbfs //$usrname@servername/home$/$usrname$

    Antonio Rocco (ACSA)

  10. #10

    Join Date
    May 2006
    Location
    West Bromwich
    Posts
    2,190
    Thank Post
    299
    Thanked 215 Times in 185 Posts
    Rep Power
    56
    It sounds like the user you are running the command under is not allowed to run the sudo command. IE a standard AD networked account is not listed in the sudoers file.

    I don't know how to remedy this as i never bothered looking. But have seen this several times myself, unless or course you know the user should be able to use sudo in which case I'm not sure. Running the command as a local admin should give the correct results.

  11. #11

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,726
    Thank Post
    3,248
    Thanked 1,049 Times in 971 Posts
    Rep Power
    364
    Trying to look for something else I stumbled across this

    Mac OS X v10.5, 10.6: Network home directory may not mount if bound to Active Directory

    I was looking for the tickbox under directory services on 10.5 / 10.6 as you can check a box that will auto-magically mount the relevant users home area to the desktop although am not 100% sure if this is the same as what was suggested with ref to using workgroup manager on a client etc

    The first link / article below has what I am reffering to ref this section

    Exploring the “User Experience” Advanced Options Pane



    http://www.peachpit.com/articles/article.aspx?p=1431816

    http://www.peachpit.com/articles/art...31816&seqNum=2
    Last edited by mac_shinobi; 4th October 2010 at 08:07 AM.

SHARE:
+ Post New Thread

Similar Threads

  1. Quote for Projector and mount
    By bladedanny in forum Our Advertisers
    Replies: 2
    Last Post: 15th October 2009, 10:55 AM
  2. mount drives
    By shafia2009 in forum Windows Server 2000/2003
    Replies: 9
    Last Post: 28th March 2009, 08:00 PM
  3. Desktop PC Mount ??
    By pooley in forum Hardware
    Replies: 2
    Last Post: 12th September 2008, 11:31 AM
  4. Projector Mount
    By Simcfc73 in forum Hardware
    Replies: 12
    Last Post: 12th June 2008, 08:05 AM
  5. VESA mount help.
    By boomam in forum How do you do....it?
    Replies: 6
    Last Post: 23rd April 2008, 11:02 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •