Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running into a very odd situation where if I access a Samba share from another Linux box, edit an existing file and attempt to save the changes, that file is truncated to 0 bytes.
However, if I save into that same directory as a NEW file, the file is saved properly. If I make updates to the file I just successfully saved, and then try to save the changes, that new file is truncated to 0 bytes.
I do not seem to encounter this on any shares on any other computers.
This is very odd and I have not encountered this before. I applied the latest updates to Samba and still encounter this issue.
Sharing machine:
Code:
crm:~ # uname -a
Linux crm 2.6.5-7.111.19-default #1 Fri Dec 10 15:10:58 UTC 2004 i686 i686 i386GNU/Linux
crm:~ # smbstatus
Samba version 3.0.9-2.1.5-SUSE
PID Username Group Machine
-------------------------------------------------------------------
Service pid machine Connected at
-------------------------------------------------------
intranet 3580 172.16.1.2 Fri Jan 7 14:54:24 2005
No locked files
crm:~ # cat /etc/samba/smb.conf
(global)
workgroup = mydomain
server string = CRM Server
local master = no
ldap suffix = dc=example,dc=com
restrict anonymous = no
domain master = no
preferred master = no
max protocol = NT
ldap ssl = No
server signing = Auto
map to guest = Bad User
username map = /etc/samba/smbusers
#socket options = TCP_NODELAY SO_SNDBUF=1460
socket options = TCP_NODELAY SO_SNDBUF=2929
(jerry)
comment = Jerry's Test PHP Server
path = /srv/www/jerry/
msdfs proxy = no
read only = no
guest ok = yes
(intranet)
comment = Intranet
path = /srv/www/htdocs/
msdfs proxy = no
read only = no
wide links = no
admin users = root,kim,nobody
guest ok = yes
create mode = 0664
directory mode = 0775
And the client side:
Code:
kim2p3lin:/home/kim # uname -a
Linux kim2p3lin 2.6.5-7.111.19-smp #1 SMP Fri Dec 10 15:10:58 UTC 2004 i686 i686 i386 GNU/Linux
kim2p3lin:/home/kim # smbstatus
Samba version 3.0.9-2.1.5-SUSE
PID Username Group Machine
-------------------------------------------------------------------
Service pid machine Connected at
-------------------------------------------------------
No locked files
kim2p3lin:/home/kim # mount
(snip)
//CRM/intranet on /home/kim/smb4k/CRM/intranet type smbfs (0)
(snip)
kim2p3lin:/home/kim # cat /etc/samba/smb.conf
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2004-12-17
(global)
workgroup = mydomain
printcap name = cups
printcap cache time = 750
cups options = raw
printer admin = @ntadmin, root, administrator
username map = /etc/samba/smbusers
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
server string = kim2p3
domain master = false
local master = no
ldap suffix = dc=example,dc=com
#socket options = TCP_NODELAY SO_SNDBUF=1460
socket options = TCP_NODELAY SO_SNDBUF=2929
(homes)
comment = Home Directories
valid users = %S
browseable = no
read only = No
inherit acls = Yes
(profiles)
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
(users)
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
(groups)
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
(printers)
comment = All Printers
path = /var/tmp
printable = yes
create mask = 0600
browseable = no
(print$)
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775
(SHARE)
path = /windows/Share
admin users = kim,root,nobody
case sensitive = no
msdfs proxy = no
read only = no
guest ok = yes
wide links = no
(BACKUPS)
path = /windows/backups
read only = no
guest ok = yes
admin users = root,kim,nobody
case sensitive = no
msdfs proxy = no
wide links = no
kim2p3lin:/home/kim # ps ax | grep -i smb
(snip)
5951 ? Ss 0:00 smbmount //CRM/intranet /home/kim/smb4k/CRM/intranet -o workgroup mydomain ip 172.16.1.155 uid 1000 gid 100 fmask 755 dmask 755 rw username mydomainKim password XXXXXX
(snip)
kim2p3lin:/home/kim #
I am using smb4k as a Samba front end to avoid frustration with Konqueror bugs and it works fine in all cases except when mounting this one particular server's (CRM's) shares. I do not see this when accessing any Windows boxes or any other Linux boxes.
If you do that and then try editing a file in /local_dir does it have the same behaviour?
It could also be to do with mapping UNIX stuff to Windows - if you run
Code:
testparm -v
on the server it should list all your settings including the defaults so you can
have a trawl through the Samba docs to see what's necessary.
It looks as though you are running Samba servers on both machines - have you tried turning the server off on the client
temporarily to see if that affects anything?
Quote:
I am using smb4k as a Samba front end to avoid frustration with Konqueror bugs
I've had issues with Konqueror and the Network Browsing icon in SuSE since 9.1. However, it only affects browsing
and although that can be a pain you can still get to where you want to with an explicit Location entry like:
Code:
smb://server/share
which on my system prompts for a Samba username and password.
The other thing I would auggest is looking on the samba.org site - there are very good How-to's and example
documents that cover pretty much all the issues.
Distribution: Mandrake 10, IPCOP 1.4, SME Server 6, EvilEntity
Posts: 106
Rep:
I am not sure if my experience is useful or a red herring, but here we go...
using a Linksys nslu2, which is an ARM based samba NAS, I can't move/transfer files greater than about 30k without getting a "path too deep" error (umm, er, ???!?!!? what?)
Some checking around on the net, it looks like the most likely cause is the hub (again, ?!!!!?!?! hub!??!!! ), and checking low level network may be worth a try. Admittedly, your problem with overwrite versus new file sounds different, but don't discount basic hardware problems....Anyway, it sounds like SMB has some issues with hardware, and admittedly mine was cheap stuff five years ago.
It's not a hardware issue - I don't run hasbro hubs or switches (I use buffered switches) and a file I experienced the problem with is /srv/www/htdocs/index.html and the local samba mount was /home/kim/smb4k/crm so the path was hardly long enough to encounter that problem even if the network layer were an issue.
andrewdodsworth,
Thanks, I'll look into that this afternoon and report back either way.
I finally got a chance to revisit this. Both Windows and Linux users connect as nobody by default. To ensure permissions is not the issue, I removed the umask which should open it all up.
Upon looking at the samba logfile, I verify that both Windows and Linux users connect as nobody, but Windows users can modify and save files. Linux users can open the files but upon saving the files are truncated to 0 bytes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.