[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem setting user and group on mounting a cifs share - Please help



On Mon, Apr 28, 2008 at 09:05:37PM +0200, Chris wrote:
> The server is a Buffalo Link-Stateion (Firmware 1.06).  I don't think
> it has logging that is normally accesible.

from what I understand by reading

 Linkname: Buffalo network-attached storage series - Wikipedia, the free encyclopedia
    URL: http://en.wikipedia.org/wiki/Buffalo_network-attached_storage_series

it is Linux based, so it should have a syslog, so it is quite possible
that its syslog can be configured for remote logging (in combination
with a configuration of your local syslog on debian to accept logs from
that server)

However, that link also says that the device supports NFS, so I would
use NFS insted of cifs

If you still want to use cifs, 

   Linkname: mount.cifs(8) - Linux man page
        URL: http://linux.die.net/man/8/mount.cifs

says (with an example) that there is a --verbose option; this might be
useful to obtain debug information.
 
> but why does the same /etc/fstab entry
> 
> //192.168.178.27/candj  /mnt/candj      cifs    user,noauto,credentials=/etc/cred,uid=1000,gid=1000     0       0
> 
> give completely different results on different machines?

quite probably there is a difference between the two machines (something
in /etc/ ? the cifs kernel module ? some other package ? the way that
the "server" treats the two machines and their users ?)

In any case this is the reason I asked for debugging info in the logs.

>  Especially when I explicitly give the uid and gid, these seem to be
> is ignored when mounting.

the man page I cited above explains that uid "is ignored when the
target server supports the CIFS Unix extensions." (the same for gid)

> thus after mounting the mount point has 
> 
> drwxrwxrwx  9 root    root       0 2008-04-28 20:30 share
> 
> and all the sudirectories inlcuding of the examples of rsync usage I give below have
> 
> drwxrwxrwx   3 identd users    0 2008-04-28 20:23 TEST
> drwxrwxrwx   3 identd users    0 2008-04-28 20:30 TEST1
> 
> where uid=1000 is not "identd" and gid=1000 is not "users"

Supposing that on your device the (samba) "target server supports the
CIFS Unix extensions" I expect that the owner/group/permissions are
determined by that (in the same way as when mounting a filesystem as /
in debian, the filesystem itself contains owner/group/permissions for,
say, / and /tmp)

Perhaps file_mode dir_mode noperm noacl or other options from the man
page might be more useful.
 
> ii  libsmbclient                         3.0.28a-1                        shared library that allows applications to t
> ii  libsmbiosxml1                        0.13.13-1                        Provide XML access to (SM)BIOS information -
> ii  smbclient                            3.0.28a-1                        a LanManager-like simple client for Unix
> ii  smbfs                                3.0.28a-1                        mount and umount commands for the smbfs (for

both clientes have these same packages (which seem not to be the current
ones for testing and unstable, which heve 1:3.0.28a-2, or for stable
which has 3.0.24-6etch9) and the same kernel?

The really important package should be only smbfs
<$>   zgrep bin/mount.cifs ~/ftp.it.debian.org/debian/dists/Debian4.0r3/Contents-i386.gz
sbin/mount.cifs            otherosfs/smbfs
 
> > which is the exact rsync command that you give?
> > On which host you give the rsync command, and as which user?
> > What is the error message which rsync gives?
> 
> On the share with
> 
> 	drwxrwxrwx  8 user user    0 2008-04-28 20:23 share
> 
> rsync works fine:
> 
> rsync -avz /mnt/hdb1/Music/OnFidelio/Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno /mnt/share/TEST
> 
> sending incremental file list
> created directory /mnt/share/TEST
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/01.Per_averti.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/02.Apri_il_cuore.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/03.Lago_rosso.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/04.Quello_che_non_ti_ho_detto_mai.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/05.Ti_prendero.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/06.Tir.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/07.Se_tu_mi_tenti.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/08.Africa.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/09.Io_sono_un_uomo_libero.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/10.Le_stesse_cose.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/11.Il_figlio_del_dolore.mp3
> Adriano_Celentano-Esco_di_rado_e_parlo_ancora_meno/12.Index.mp3
> 
> sent 72755233 bytes  received 244 bytes  4693901.74 bytes/sec
> total size is 72729880  speedup is 1.00

If I understand correctly you are coping files from your debian machine
to the (remotely mounted) directory

drwxrwxrwx   3 identd users    0 2008-04-28 20:23 TEST

where you (or anyone, for that matter) surely have the permissions to write.

> On the machine with
> 
> 	drwxrwxrwx  9 root    root       0 2008-04-28 20:30 share
> 
> I get errors:
> 
> rsync -avz /home/user/music/Adriano\ Celentano/Esco\ di\ rado\ e\ parlo\ ancora\ meno /mnt/share/TEST1
> 

what is 

ls -lad /mnt/share/TEST1

before attampting the copy on this machine?
 
> sending incremental file list
> created directory /mnt/share/TEST

I do not understand this: why does it cerate a directory /mnt/share/TEST
*outside* the destination directory /mnt/share/TEST1 ?

Perhaps, try this:

rsync -avz /home/user/music/Adriano*/Esco* /mnt/share/TEST1

Perhaps, you could try with filenames with only "ordinary"
alphanumerical characters in them (are the spaces really spaces, or some
other nonprintable character which might have problems with iocharset
mapchars options of man mount.cifs ?)

> Esco di rado e parlo ancora meno/
> rsync: failed to set times on "/mnt/share/TEST1/Esco di rado e parlo ancora meno": Operation not permitted (1)

"failed to set times" is a quite strange error.

Google finds something:

   Linkname: rsync: failed to set times - Google Search
        URL: http://www.google.com/search?q=rsync%3A+failed+to+set+times&num=100
   Linkname: [Jfs-discussion] rsync: failed to set times on symbolic links
        URL: http://www.mail-archive.com/jfs-discussion@lists.sourceforge.net/msg00995.html
   Linkname: Rsync error: failed to set times - Nitix Knowledgebase
        URL: http://kb.nitix.com/4071
   Linkname: Fileserver Questions [Archive] - Ubuntu Forums
        URL: http://ubuntuforums.org/archive/index.php/t-485933.html

and so on

> Esco di rado e parlo ancora meno/01 Per averti.mp3
> Esco di rado e parlo ancora meno/02 Apri il cuore.mp3
> Esco di rado e parlo ancora meno/03 Lago rosso.mp3
> Esco di rado e parlo ancora meno/04 Quello che non ti ho detto mai.mp3
> Esco di rado e parlo ancora meno/05 Ti prendero.mp3
> Esco di rado e parlo ancora meno/06 Tir.mp3
> Esco di rado e parlo ancora meno/07 Se tu mi tenti.mp3
> Esco di rado e parlo ancora meno/08 Africa.mp3
> Esco di rado e parlo ancora meno/09 Io sono un uomo libero.mp3
> Esco di rado e parlo ancora meno/10 Le stesse cose.mp3
> Esco di rado e parlo ancora meno/11 Il figlio del dolore.mp3
> Esco di rado e parlo ancora meno/12 Index.mp3
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.01 Per averti.mp3.nGMjkb" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.02 Apri il cuore.mp3.Bk8kaX" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.03 Lago rosso.mp3.rQLkUK" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.04 Quello che non ti ho detto mai.mp3.1Il6tA" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.05 Ti prendero.mp3.b7XPzr" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.06 Tir.mp3.dyGffk" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.07 Se tu mi tenti.mp3.dPRBte" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.08 Africa.mp3.VEHs79" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.09 Io sono un uomo libero.mp3.jyjUi7" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.10 Le stesse cose.mp3.jmPpv6" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.11 Il figlio del dolore.mp3.jU2Fn7" failed: Operation not permitted (1)
> rsync: mkstemp "/mnt/share/TEST1/Esco di rado e parlo ancora meno/.12 Index.mp3.pyfdma" failed: Operation not permitted (1)
> 
> sent 72751396 bytes  received 244 bytes  3932521.08 bytes/sec
> total size is 72726016  speedup is 1.00
> rsync error: some files could not be transferred (code 23) at main.c(1049) [sender=3.0.2]

it might be that you do not have write permissions on
"/mnt/share/TEST1/Esco di rado e parlo ancora meno"

What does it say

ls -lad "/mnt/share/TEST1/Esco di rado e parlo ancora meno" 
df -hT "/mnt/share/TEST1/Esco di rado e parlo ancora meno"
ls -lad "/mnt/share/TEST1" 
df -hT "/mnt/share/TEST1"

?

   Linkname: "rsync: mkstemp" "failed: Operation not permitted" - Google Search
        URL:
 http://www.google.com/search?num=100&hl=en&ie=ISO-8859-1&q=%22rsync%3A+mkstemp%22++%22failed%3A+Operation+not+permitted%22&btnG=Search

finds 14 results which might not be so useful except perhaps

   Linkname: sardonick / copious spare time
        URL: http://motespace.com/blog/category/copious-spare-time/

-- 
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


Reply to: