Notices


Reply
Thread Tools
Posts: 10 | Thanked: 1 time | Joined on Jan 2010
#71
well, thanks Qole and Nathan for the samba support. I tried winfs and kernel-module-cifs, and both work. but I hope you guys compile another module or component into it. I can't use the parameter, -o iocharset=utf8 . I usually do this to mount windows filesystem from my desktop linux because I got many different language filenames, like japanese, chinese, russian. It can make the files display correctly so that I will be able handle with these in command line.
 
Posts: 452 | Thanked: 522 times | Joined on Nov 2007
#72
Originally Posted by heretic View Post
well, thanks Qole and Nathan for the samba support. I tried winfs and kernel-module-cifs, and both work. but I hope you guys compile another module or component into it. I can't use the parameter, -o iocharset=utf8 . I usually do this to mount windows filesystem from my desktop linux because I got many different language filenames, like japanese, chinese, russian. It can make the files display correctly so that I will be able handle with these in command line.
The cifs component should support iocharset; the only thing that isn't compiled into cifs is the experimental dfs support. I didn't disable anything. Now, it is possible that something else in the Maemo Kernel is not support utf8. But iocharset as a command line should work when passed on to the mount command.

According to the cifs readme:

iocharset:
Codepage used to convert local path names to and from
Unicode. Unicode is used by default for network path
names if the server supports it. If iocharset is
not specified then the nls_default specified
during the local client kernel build will be used.
If server does not support Unicode, this parameter is
unused.

I looked through the source code and it showed that it could try and load a charset and fail. I'm not sure what would cause it to fail; other than maybe it not being compiled into the kernel?

Nathan
 
Posts: 452 | Thanked: 522 times | Joined on Nov 2007
#73
Originally Posted by qole View Post
I would argue that the best way to ensure that is to never keep any "important" (ie "secret") data on your mobile device.
Well that is true; not having the data on it would be the "Best" -- but I prefer to use it as a untethered computer; so I need the data on it. ;-)

Nathan.
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#74
Hey I've been working on that script, I'm almost finished, do you need root permissions in Fremantle to create a directory in /media or use the mount command? I don't know, I'm still waiting for my N900 to arrive

Last edited by GameboyRMH; 2010-01-14 at 15:30.
 
Posts: 452 | Thanked: 522 times | Joined on Nov 2007
#75
Originally Posted by GameboyRMH View Post
Hey I've been working on that script, I'm almost finished, do you need root permissions in Fremantle to create a directory in /media or use the mount command? I don't know, I'm still waiting for my N900 to arrive
1. You need sudo/root privs to run the mount/umount (or add it to your sudoers)

2. You need to create the initial directory as root; but if you chown the directory back to the user; then the user can create any sub-directories inside it for mounting points. ;-)

3. You could probably mark the script for elevated rights and bypass the root requirements of mount/umount.

Nathan
 
Posts: 279 | Thanked: 95 times | Joined on Sep 2009
#76
Originally Posted by qole View Post
winfs 0.2 now adds the /etc/event.d/cifs script and automatically adds the cifs module upon install. You still have to mount things manually, however, or use a front end that supports mount.cifs.
NOOB ALERT!

Guys i am totally lost. Could someone post command line to mount


\\server\multimedia to MyDocs as Server folder

after installing winfs from qole's repo?

Thanks
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#77
OK, probably best to run the script as root then. This script will chown the mountpoint automatically.

So here's my "easy cifs mounter" shellscript. First time I've written such a fancy one you can either pass arguments to it or run it in "wizard mode" by passing no arguments.
Code:
#! /bin/sh
#arguments: servername serverip share username password mountpoint
#username, password and mountpoint are optional arguments
args=("$@")
if [ "${args[0]}" == "" ]; then
    #Go into "wizard mode" if there are no arguments
    echo -e "No 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 [ "${args[0]}" != "" ]; then
    servername=${args[0]}
    serverip=${args[1]}
    sharename=${args[2]}
    username=${args[3]}
    username_orig=$username
    password=${args[4]}
    mountpoint=${args[5]}
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"


Noob instructions:
Copy contents, save it as something like say "cifsmount", then run "chmod u+x cifsmount." You need to run this script as root, so with rootsh installed run "sudo gainroot." You can then either run it in "wizard mode" by running "./cifsmount" or pass arguments to it like "./cifsmount myhomeserver 192.168.254.10 mysharedfolder myusername mypassword /mount/point" (arguments are all documented in the code comments)

Username, password and mountpoint are all optional. You must specify a username and password to use a custom mountpoint if you're doing it with arguments, but if you're connecting to an anonymous share you can put anything in those fields.

By default it uses the same mountpoints as Wizard Mounter: /media/Remote_Filesystems/servername@share. You have to unmount manually: "umount /media/Remote_Filesystems/whatever@whatever." The script will tell you exactly what at the end.

Last edited by GameboyRMH; 2010-01-15 at 12:25.
 

The Following 3 Users Say Thank You to GameboyRMH For This Useful Post:
Posts: 279 | Thanked: 95 times | Joined on Sep 2009
#78
i copied it under MyDocs and run "chmod u+x cifsmount." as root
when i run "./cifsmount" i get permission denied error saying permission denied
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#79
Edit: nm, SubCore got it.

Last edited by GameboyRMH; 2010-01-14 at 21:32.
 
SubCore's Avatar
Posts: 850 | Thanked: 626 times | Joined on Sep 2009 @ Vienna, Austria
#80
Originally Posted by asidana View Post
i copied it under MyDocs and run "chmod u+x cifsmount." as root
when i run "./cifsmount" i get permission denied error saying permission denied
the partition which is mounted on MyDocs is a VFAT partition, and as such doesn't support the executable flag.

you have to copy it somewhere else, for example /home/user instead of /home/user/MyDocs, and then rund chmod +x. (/home is the 2GB partition, and mounted as ext3)
__________________
"What we perceive is not nature itself, but nature exposed to our method of questioning."
-- Werner Karl Heisenberg
 
Reply

Tags
cifs, ntfs, samba, smb, truecrypt


 
Forum Jump


All times are GMT. The time now is 04:01.