samba client improperly shows the wrong files in directories
Noah
admin2 at enabled.com
Thu Dec 18 23:16:11 UTC 2008
Hi Samba List,
I am finding a strange problem between a mount samba directory. Any
clues why this is happening? I have two servers. The samba server is a
Western Digital World Edition II (2) server. The samba client (server)
is running Ubuntu-kernel linux-2.6.24-22-generic
The samba server is exporting the directory: /shares/internal/Music/
The client is mounting the exported directory to /mnt/mybook-music
Now here is the issue.
Samba Client Drive Mount:
On the samba client side I see that the same files 2241 files that
appear in /mnt/mybook (or on the samba server side
/shares/internal/Music) also appear in /mnt/mybook-music/Madonna/Music
(or on the samba server side /shares/internal/Music/Madonna/Music)
Samba Server:
On the samba server side I see 2241 files in /shares/internal/Music (or
/mnt/mybook on the client side) and only 4 files in the
/shares/internal/Music/Madonna/Music directory (or
/mnt/mybook-music/Madonna/Music on the client side). Be advised the
data from the ‘wc –l’ counts an extra line so when the total is 2242
there is in fact only 2241 files.
Why is that happening? Why aren’t only 4 files seen on the samba client
directory since that is only what exists on the samba server side. And
why on the client side there appears to be the same files that same 2241
files that exist in /mnt/mybook-music/ appear in the directory
/mnt/mybook-music/Madonna/Music as well when only 3 files show be
contained in /mnt/mybook-music/Madonna/Music.
What is even more peculiar is that when I use smbclient to log into the
samba server from the samba client machine I see that there are only 3
files in /mnt/mybook-music/Madonna/Music instead of the claimed 2241
files as seen in the mount on the samba client (of the samba server
/mnt/mybook-music/Madonna/Music directory).
Here is the smbclient output details. smbclient properly discovers 3
files in the directory
~$ smbclient //192.168.1.20/Music -Unoah
Password:
Domain=[MYBOOKMUSIC] OS=[Unix] Server=[Samba 3.0.23c]
smb: \>
smb: \> cd Madonna/Music
smb: \Madonna\Music\> ls
. D 0 Sun Sep 12 20:03:15 2004
.. D 0 Tue Apr 26 10:14:22 2005
Gone.mp3 AH 3345473 Tue Apr 11 09:06:03 2006
Impressive Instant.mp3 AH 3483214 Tue May 3 12:35:22 2005
Nobody's Perfect.mp3 AH 4814848 Tue May 3 12:35:22 2005
58437 blocks of size 16777216. 42128 blocks available
So lets get some more relevant output here:
From the samba client:
From the client side I do an 'ls -l /mnt/mybook-music/Madonna/Music |
wc -l' see that the output equals the line could of 'mnt/mybook-music'
$ ls -l /mnt/mybook-music/Madonna/Music | wc -l
2242
$ ls -l /mnt/mybook-music | wc -l
2242
From the samba server side:
# ls -l /shares/internal/Music/Madonna/Music | wc -l
4
[root at MyBookMusic Madonna]# ls -l /shares/internal/Music | wc -l
2242
The client sees all the files that are displayed from 'ls
/mnt/mybook-music' command and also displayed from an 'ls
/mnt/mybook-music/Madonna/Music' command.
where on the server side 'ls -l /shares/internal/Music/Madonna/Music'
does not show the contents of '/shares/internal/Music' and only show 3
files.
# ls -l /shares/internal/Music/Madonna/Music
total 11396
-rwxr-xr-x 1 noah noah 3345473 Apr 11 2006 Gone.mp3
-rwxr-xr-x 1 noah noah 3483214 May 3 2005 Impressive Instant.mp3
-rwxr-xr-x 1 noah noah 4814848 May 3 2005 Nobody's Perfect.mp3
server side version details:
[root at MyBookMusic Madonna]# ipkg list_installed | grep samba
samba - 3.2.4-1 - Samba suite provides file and print services to
SMB/CIFS clients.
client version details:
$ dpkg --list | grep samba
ii samba 3.0.28a-1ubuntu4.7
a LanManager-like file and printer server
for Unix
ii samba-common 3.0.28a-1ubuntu4.7
Samba common files used by both the server
and the client
the client mounted //192.168.1.20/Music from the fstab.
noah at tsunami:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/hdb1
UUID=e0b6f66b-b3f6-44f4-b5b6-e2cfb6e32048 / ext3
defaults,errors=remount-ro 0 1
# /dev/hdb5
UUID=e1d2239f-b911-4ee2-848e-6bcb3672104d none swap sw
0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto,exec 0
0
/dev/hdc /media/cdrom1 udf,iso9660 user,noauto,exec 0
0
#//192.168.1.20/Music /mnt/mybook-music smbfs
userid=noah,passwd=<password>,rw 0 0
//192.168.1.20/Music /mnt/mybook-music cifs
userid=noah,passwd=<password>,rw 0 0
Client system details with mount information
$ uname -a
Linux tsunami 2.6.24-22-generic #1 SMP Mon Nov 24 18:32:42 UTC 2008 i686
GNU/Linux
noah at tsunami:~$ mount
/dev/sdb1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-22-generic/volatile type tmpfs (rw)
//192.168.1.20/Music on /mnt/mybook-music type cifs (rw,mand)
securityfs on /sys/kernel/security type securityfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc
(rw,noexec,nosuid,nodev)
samba server configuration files:
# cat /etc/smb.conf
[global]
server string=MyBookMusic
workgroup=workgroup
interfaces=192.168.1.20/24 127.0.0.1/8
security=user
smb passwd file=/var/private/smbpasswd
private dir=/var/private
guest account=www-data
dns proxy=No
lock directory=/var/locks
pid directory=/var/locks
use sendfile=Yes
map to guest = Bad User
create mask = 755
map hidden = Yes
veto files = /shares/internal/.senvidData/ /shares/internal/lost+found/
max log size = 1
[dummy-2]
include=/var/oxsemi/shares.inc
# cat /var/oxsemi/shares.inc
[PUBLIC]
path=/shares/internal/PUBLIC
force user=www-data
valid users=www-data noah
write list=www-data noah
guest ok=yes
[Music]
path=/shares/internal/Music
force user=noah
valid users=www-data BACKUP noah
write list=www-data BACKUP noah
guest ok=yes
browseable=yes
writable=yes
read only = no
security mask=0755
create mask=0755
Cheers,
Noah
More information about the ubuntu-users
mailing list