Page 2 of 3

Re: Downloading and Greyhole

Posted: Fri Dec 24, 2010 5:13 pm
by gboudreau
Make sure you have no spaces in the credential file.
The file you should be editing is: /home/your_username/.smb_credentials
And you need to make sure the /etc/init.d/mount_shares_locally file uses your_username on line 12:
username="your_username"

Re: Downloading and Greyhole

Posted: Mon Dec 27, 2010 8:18 am
by eldano
Ok I checked the files, can't find anything that could be wrong,

/home/your_username/.smb_credentials
username=<eldano>
password=<*my'eldano' password (not root password)*>
domain=HOME

/etc/init.d/mount_shares_locally file uses your_username on line 12
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: mount_shares_locally
# Required-Start: $network $local_fs $remote_fs smb mysqld
# Required-Stop: $network $local_fs $remote_fs smb
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mount Samba shares locally
### END INIT INFO

username="eldano"

if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi

start () {
uid=`id -u $username`
gid=`id -g $username`

echo -n $"Mounting Samba shares locally: "
mkdir -p /mnt/samba/
cd /mnt/samba/
mysql -u root -phda -e "select comment from shares" hda_production | grep -v "^comment$" | xargs -d "\n" mk$
ls -1 | while read d; do
/sbin/mount.cifs "//127.0.0.1/$d" "$d" -o credentials=/home/${username}/.smb_credentials,uid=${uid}$
done
touch /var/lock/subsys/mount_shares_locally
success $"$base startup"
echo
return 0
}

stop () {
echo -n $"Unmounting locally mounted Samba shares: "
/bin/umount -l /mnt/samba/*
rm -f /var/lock/subsys/mount_shares_locally
success $"$base shutdown"
echo
return 0
}

restart () {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
;;
esac

exit $?

Re: Downloading and Greyhole

Posted: Mon Dec 27, 2010 8:33 am
by eldano
I tried running the service again today, and I gave me a different error... I was not root while doing this;
[eldano@localhost ~]$ service mount_shares_locally start
Mounting Samba shares locally: mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
touch: cannot touch `/var/lock/subsys/mount_shares_locally': Permission denied
[ OK ]
And when I am root it gives the error like before:
[root@localhost ~]# service mount_shares_locally start
Mounting Samba shares locally: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[ OK ]
Maybe this will help.

Re: Downloading and Greyhole

Posted: Tue Dec 28, 2010 11:07 am
by gboudreau
Drop the < and >:

Code: Select all

username=eldano password=some_password domain=HOME

Re: Downloading and Greyhole

Posted: Tue Dec 28, 2010 1:50 pm
by eldano
Solved!
Ha, so simple! Thanks Gboudreau!

Re: Downloading and Greyhole

Posted: Tue Dec 28, 2010 2:03 pm
by gboudreau
Fixed the wiki article to prevent other users from interpreting those as you did.
Should be clearer now.

Re: Downloading and Greyhole

Posted: Tue Dec 28, 2010 2:38 pm
by eldano
Good thinking, amahi targets also linux newbees like me, so the clearer the better. Thanks again.

Re: Downloading and Greyhole

Posted: Wed Dec 29, 2010 3:27 am
by eldano
Question about the following
Example of using Terminal to move files from one share to another, when shares are mounted locally on the HDA:
- From client computer: ssh hda
- In SSH on HDA: mv /mnt/samba/torrents/SomeThing /mnt/samba/Movies/HD/
That's it.
What I did:
[eldano@localhost samba]$ mv /mnt/samba/Torrents/SomeDirectory/ /mnt/samba/Movies/
mv: cannot remove `/mnt/samba/Torrents/SomeDirectory/Sample.mkv': Permission denied
mv: cannot remove `/mnt/samba/Torrents/SomeDirectory/file.mkv': Permission denied
mv: cannot remove `/mnt/samba/Torrents/SomeDirectory/file.nfo': Permission denied
But the directory is copied to the new location. But not removed from the torrents share. Why? I don't know.

The torrent was deleted from transmission, so was not in use
The File/directory I am copying is 13GB.
Took about 16minutes ~13MB/s

My question is: is this normal, or is something wrong on my system? My guess is that it is still going over the 100mbit router? (My router status lights were going nuts).. or can I do something to speed it up?

Thanks

Re: Downloading and Greyhole

Posted: Wed Dec 29, 2010 3:35 am
by gboudreau
No, that is not going through the router.

The files created by Transmission in /mnt/samba/Torrents are not writable (& deletable) by your user.
For those files, you'll need to copy them from the terminal, then delete them using Transmission (delete, not just remove, which wouldn't delete the files on disk, just the torrent seeding).

To copy:

Code: Select all

cp -r /mnt/samba/Torrents/SomeDirectory /mnt/samba/Movies/

Re: Downloading and Greyhole

Posted: Wed Dec 29, 2010 3:54 am
by eldano
Thanks for the fast answer, man you're quick.

So that this goes so slow is normal? If I copy a file on my desktop locally of 10GB it does not even take one second.

On the server between shares an 10GB file it takes about 12 minutes. Do you have that to then on your server?? Harddrive are faster that 13mb/s right?
The whole idea of mounting shares locally is fast moving/coping of files right, and that greyhole 'sees what changes'?

Thanks again for your wisdom