Notices


Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Jan 2010
#171
This is FYI only
If you try mount share in windows domain and use following syntax:

mount -t cifs //<server>/<path> /<your>/<local>/<path> -o user=<domain>/<user>,pass=<pass>,ip=<ip of server>,direct

You get message: "Mounting the DFS root for domain not implemented yet"


This is without troubles:
mount.cifs //<server>/<path> /<your>/<local>/<path> -ouser=<domain>/<user>,pass=<pass>,ip=<ip of server>,direct

BTW tx Nathan
 
Posts: 83 | Thanked: 34 times | Joined on Feb 2010 @ Poole, UK
#172
Did anyone solve the printf %q problems??
 
Posts: 83 | Thanked: 34 times | Joined on Feb 2010 @ Poole, UK
#173
I have also just tried the script with the printf's commented out, copied to my /home/user as a file called cifsmount.sh

I tried to run it, but got an error to do with permissions, so ran the command: chmod u+x cifsmount.sh, this appears to run ok

Now when i try to run the script, i get cifsmount.sh: not found.
i have tried it with the variations of ./ or /home/user beofre running it

Any suggestions??
 
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#174
you probably already know this but my suggestions are

1) watch out, things are case sensetive so make sure you used cifsmount.sh and not Cifsmount.sh
2) to execute any script you must give the path of the script.

find the script first. do

ls

in the directory you're in to see the actual name of the script and to make sure it's there.

./cifsmount.sh

should work since the "." means current directory .

3) my final sugesstion is probably the more likely one since you seem to have found the script already but didn't have the privilages to run it. to me it sounds like you perhaps edited the script and added cifsmount.sh in it. did you?
 
Posts: 83 | Thanked: 34 times | Joined on Feb 2010 @ Poole, UK
#175
Ok, I am pretty certain that I had already checked those areas. So a full step-by-step of what I am doing.

On my Windows 7 (sorry for not being linux) laptop, I created a file in notepad (basically copied and pasted the previously quoted script), and then commented out the printf lines with a #, and added ,direct to the end of each of the mount lines. Saved this file in ANSI format as cifsmount.sh (definately no .txt at the end), plugged in the USB cable, selected Mass Storage Mode and copied the file to the root of the N900.

On the N900:
1. Take out USB Cable
2. Open xTerminal
c. Type the following:
Code:
~ $ sudo gainroot
/home/user # rm cifsmount.sh
/home/user # cd MyDocs/
/home/user/MyDocs # mv cifsmount.sh ../
(removing the previous version and then moving the newly copied one)

Code:
/home/user/MyDocs # cd ..
/home/user # ls
/home/user # chmod u+x ./cifsmount.sh
/home/user # ./cifsmount.sh
when is type ls i do get the file listed in the current directory, the chmod line, I have tried without the ./ at the beginning, it appears to work fine. When I type the last line (I am hapy about . meaning the current directory, but it helps with the TAB autocomplete), I get the following displayed on the screen:

/bin/sh: ./cifsmount.sh: not found

I also tried the command with the full path of /home/user/cifsmount.sh, exactly the same error showing (obviously giving a different path for cifsmount.sh)
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#176
Sounds like some of you are using older versions of the script. The printf %q issue has been solved. Here is the final, working version again:

Code:
#!/bin/sh
#arguments: servername serverip share username password mountpoint
#username, password and mountpoint are optional arguments
if [ $# -lt 3 ] ; then
    #Go into "wizard mode" if there are no arguments
    echo -e "Not enough arguments passed - running wizard"
    echo -e "Enter the server name:"
    read servername
    echo -e "Enter the server IP"
    read serverip
    echo -e "Enter the share name or path"
    read sharename
    echo -e "Enter a username, or leave blank for anonymous"
    read username
    username_orig=$username
    if [ "${username}" != "" ]; then
        echo -e "Enter a password"
        read password
    fi
    echo -e "Enter a mount point, or leave blank for automatic"
    read mountpoint
fi
#if arguments were passed from the command line, use them:
if [ $# -gt 2 ]; then
    servername=$1
    serverip=$2
    sharename=$3
    username=$4
    username_orig=$username
    password=$5
    mountpoint=$6
fi
#set default mountpoint if the user didn't enter one
if [ "${mountpoint}" = "" ]; then
    mountpoint="/media/Remote_Filesystems/$servername@$sharename"
    #make sure the Remote_Filesystems directory exists
    mountparentdir="/media/Remote_Filesystems"
    if [ -d $mountparentdir ]; then
        echo -e "$mountparentdir found."
    else 
        echo -e "Creating $mountparentdir"
        mkdir $mountparentdir
    fi
fi
#requote variables to escape special characters
#servername=$(printf '%q' "$servername")
#serverip=$(printf '%q' "$serverip")
#sharename=$(printf '%q' "$sharename")
#username=$(printf '%q' "$username")
#password=$(printf '%q' "$password")
#mountpoint=$(printf '%q' "$mountpoint")
#check for mountpoint and create it if it doesn't exist
if [ -d $mountpoint ]; then
    echo -e "Mount point already exists - will attempt to use."
else 
    echo -e "Creating mountpoint $mountpoint"
    mkdir $mountpoint
fi 
echo -e "Attempting to mount //$servername/$sharename at $mountpoint"
#Run the mount command
if [ "${username_orig}" != "" ]; then
mount -t cifs //$servername/$sharename $mountpoint -o user=$username,pass=$password,ip=$serverip
else
mount -t cifs //$servername/$sharename $mountpoint -o ip=$serverip
fi
#chown mountpoint to user
chown -R user $mountpoint
echo -e "To unmount this share, run umount $mountpoint as root"

Last edited by GameboyRMH; 2010-02-24 at 14:43.
 
Posts: 83 | Thanked: 34 times | Joined on Feb 2010 @ Poole, UK
#177
Originally Posted by GameboyRMH View Post
Sounds like some of you are using older versions of the script. The printf %q issue has been solved. Here is the final, working version again:
How has the printf issue been solved, those lines are just commented out aren't they?

I have tried this to, and get exactly the same error, I guess I am doing something very wrong, but have no idea what
 
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#178
I don't know which script you used but please try this and tell me what you get.

cat cifsmount.sh | grep cifsmount.sh

try creating the script on the N900 itself perhaps.
 
Posts: 83 | Thanked: 34 times | Joined on Feb 2010 @ Poole, UK
#179
Originally Posted by Cue View Post
I don't know which script you used but please try this and tell me what you get.

cat cifsmount.sh | grep cifsmount.sh

try creating the script on the N900 itself perhaps.
Ok, I have used the script that GameboyRMH has shown in the post above

I'm not sure what the above command should do, but I have tried a couple of things, typing it all in one go just appears to do nothing, just gives me the # prompt to enter a new command.

However, if I enter the cat command, i get the contents of the file shown.

If I do the grep one on its own, i get a blank line to type on (not sure what it does.

Added some images to try and show the results
Attached Images
   
 
Posts: 83 | Thanked: 34 times | Joined on Feb 2010 @ Poole, UK
#180
Surely it doesn't matter where I created the file if the result is teling me it isn't found......even when it is showing up in the directory????
 
Reply

Tags
cifs, ntfs, samba, smb, truecrypt


 
Forum Jump


All times are GMT. The time now is 00:55.