LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2008, 08:55 AM   #1
shishirkotkar
Member
 
Registered: Sep 2007
Posts: 83

Rep: Reputation: 15
problem with samba...




i have a LTSP server running with /home partition mounted from another machine using nfs

samba is running on LTSP server.

I also have a windows server that provides windows login to all the samba users.

i have added LTSP users as samba users so that same user can get both windows and linux session.

also i provide LTSP users home directory as a samba share during windows session.so i can access users /home during windows session.

problem is


when i am using windows session i cannot write into users /home using the mounted share...

plz help...its very urgent
 
Old 06-19-2008, 09:03 AM   #2
yawe_frek
Member
 
Registered: Sep 2005
Distribution: feather 0.72-usb, DSL,CentOS,Ubuntu, Redhat 9
Posts: 144

Rep: Reputation: 15
hi there, check if ur /home has a write permission

ls -l /home

if not then chomod u+w /home
 
Old 06-19-2008, 09:17 AM   #3
shishirkotkar
Member
 
Registered: Sep 2007
Posts: 83

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by yawe_frek View Post
hi there, check if ur /home has a write permission

ls -l /home

if not then chomod u+w /home
yes it does have read/write permission.

actually when i an using windows session i can create files in the /home share but i cannot write into those files. if i try to i says "some other file is locking the file" something like that ..

also if i try to create a wordpad file and write into it, it encodes the text in some other unreadable format and saves it


i have a feelin that it is because of the machine running nfs....but dont know what exactly is the problem
 
Old 06-19-2008, 09:47 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Do you use a [Profile] share to give users access to their home directories form Windows? Could you post the [General] and the service section of your smb.conf file?

The Samba 3 HOWTO & Reference Guide ( samba-doc package or their website ) has a chapter ( ch. 17) on File & Record Locking. When sharing files for both samba & nfs users, they recommend turning oplocks off. However it is possible that there could be changes. As I understand it, this is one area being addressed in Samba4 and improvements may be backported to recent samba versions. They may be writing this with NFS 2 in mind as well. (Just my guess)

You might want to ssh into the server before accessing it form windows (i.e. using putty) and then run the "lsof" command to see which programs have a file open. Find out which services have the file open.

Is the samba server running on the LTSP server or the client. Running the Samba on the client could be a problem. However I don't think there would be a problem if you have /home offered as an NFS service and use a [Profile] share which would have a path of %H which would evaluate to the server's /home/<username> directory. ( The path may be different on your system to accommodate the home partition being mounted somewhere else, of course )

Also check the samba logs. The Samba 3 boot may help you understand the logs as well.

Quote:
17.2.1.3 UNIX or NFS Client-Accessed Files
Local UNIX and NFS clients access files without a mandatory file-locking
mechanism. Thus, these client platforms are incapable of initiating an oplock
break request from the server to a Windows client that has a file cached.
Local UNIX or NFS file access can therefore write to a file that has been
cached by a Windows client, which exposes the file to likely data corruption.
If files are shared between Windows clients and either local UNIX or NFS
users, turn oplocks off.
In Linux (and Solaris 9) you can enforce manditory locking on a per file system bases by using the "-o mand" option to the mount command. This isn't available before the 2.4.22 kernel or when using FreeBSD 5.2.1 and Mac OS X 10.3. Ref: Advanced Programming in the Unix Environment.

Quote:
Originally Posted by man 2 fcntl
Mandatory locking
(Non-POSIX.) The above record locks may be either advisory or manda‐
tory, and are advisory by default.

Advisory locks are not enforced and are useful only between cooperating
processes.

Mandatory locks are enforced for all processes. If a process tries to
perform an incompatible access (e.g., read(2) or write(2)) on a file
region that has an incompatible mandatory lock, then the result depends
upon whether the O_NONBLOCK flag is enabled for its open file descrip‐
tion. If the O_NONBLOCK flag is not enabled, then system call is
blocked until the lock is removed or converted to a mode that is com‐
patible with the access. If the O_NONBLOCK flag is enabled, then the
system call fails with the error EAGAIN or EWOULDBLOCK.

To make use of mandatory locks, mandatory locking must be enabled both
on the file system that contains the file to be locked, and on the file
itself. Mandatory locking is enabled on a file system using the "-o
mand" option to mount(8), or the MS_MANDLOCK flag for mount(2). Manda‐
tory locking is enabled on a file by disabling group execute permission
on the file and enabling the set-group-ID permission bit (see chmod(1)
and chmod(2)).
If you mount the filesystem with the -o mand option, and if Samba understands this, it may provide proper manditory locking on a file opened by a Windows client to prevent any other Linux process from access the file.

When you check for processes accessing user files just after they are created, check if the beagle daemon is accessing the file. When you create a new file, it receives an inotify message and then greps through the file. I would expect it to wait until the file is closed but this might be a possibility.

Look at a user's file with getfattr.

Code:
getfattr twim.xml
# file: twim.xml
user.Beagle.AttrTime
user.Beagle.Fingerprint
user.Beagle.MTime
user.Beagle.Uid

jschiwal@hpamd64:~> getfattr -n user.Beagle.AttrTime twim.xml
# file: twim.xml
user.Beagle.AttrTime="20080619144621"
I think that the AttrTime is when beagled indexed the file. If so, that would allow you to compare this time with when you opened the file from a Windows client.

Also, double check a file created from the windows client. Do the owner/group/permissions match one created locally by that user?

Last edited by jschiwal; 06-19-2008 at 10:15 AM.
 
Old 06-19-2008, 09:51 AM   #5
shishirkotkar
Member
 
Registered: Sep 2007
Posts: 83

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
Do you use a [Profile] share to give users access to their home directories form Windows? Could you post the [General] and the service section of your smb.conf file?

The Samba 3 HOWTO & Reference Guide ( samba-doc package or their website ) has a chapter ( ch. 17) on File & Record Locking. When sharing files for both samba & nfs users, they recommend turning oplocks off. However it is possible that there could be changes. As I understand it, this is one area being addressed in Samba4 and improvements may be backported to recent samba versions. They may be writing this with NFS 2 being possibly used. (Just my guess)

You might want to ssh into the server before accessing it form windows (i.e. using putty) and then run the "lsof" command to see which programs have a file open. Find out which services have the file open.

Is the samba server running on the LTSP server or the client. Running the Samba on the client could be a problem. However I don't think there would be a problem if you have /home offered as an NFS service and use a [Profile] share which would have a path of %H which would evaluate to the server's /home/<username> directory. ( The path may be different on your system to accommodate the home partition being mounted somewhere else, of course )

Also check the samba logs. The Samba 3 boot may help you understand the logs as well.
this is my smb.conf file...

[global]
wins support = yes
dns proxy = yes
workgroup = EXAMPLE
netbios name = K12LTSP
domain logons = yes
domain master = yes
os level = 99
preferred master = yes
add machine script = /usr/sbin/useradd -d /dev/null -g winmachines -s /bin/false -M %u
logon drive = H:

[homes]
create mask = 0600
directory mask = 0700
path = %H
read only = no
valid users = %S

[netlogon]
path = /home/netlogon
guest ok = yes
writable = no
share modes = no
 
Old 06-19-2008, 11:21 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at how the home directory is provided for an LTSP user.

I think the problem is how %H is expanded. I'm guessing that a directory like /srv/nfsroot is exported by the nfs/samba server and mounted by the clients as the root directory. Then from the client, their home directory is at /home/username. However for the samba server, it should share /srv/nfsroot/home/username instead.

I think that your path should be defined as either
/srv/nfsroot/home/%u

or

/srv/nfsroot/home/%U

Note that I've made a guess where the nfsroot directory is located.

Last edited by jschiwal; 06-19-2008 at 11:24 PM.
 
Old 06-23-2008, 10:24 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I was reading the "man exports" page today to look at nfs4, and noticed the "unhide" option which may be needed if you have a mount point in a share. I don't know if this works for mounts of non nfs shares.
 
Old 06-24-2008, 09:26 AM   #8
shishirkotkar
Member
 
Registered: Sep 2007
Posts: 83

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
I was reading the "man exports" page today to look at nfs4, and noticed the "unhide" option which may be needed if you have a mount point in a share. I don't know if this works for mounts of non nfs shares.

i am using k12ltsp...

i can easily copy files from samba directory to windows...but i cannot copy files from windows to samba share...
 
Old 06-27-2008, 09:14 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Could you post information how shares are mounted on the server and the directory structure of the server. Where is the nfs root directory? Also post your revised smb.conf file as well as the /etc/exports file.

Have you tried an absolute path to the directory containing the users home directories instead of %H? Or would they evaluate the same. They might not be. I'm thinking that %H will evaluate to /home instead of <NFS_ROOT>/home. The /etc/password file may indicate /etc/home because the nfs root share is mounted on / at the users machine. Since the samba server is running on the NFS server that contains the users home directories, I think you want to share the users home directories using an absolute path to the home directory or an expression that evaluates to the home directory or the user's own home directory.

Since k12ltsp is based on CentOS Linux, also check if there are seLinux security policies causing problems.

Check the documentation for k12ltsp:
http://k12ltsp.org/mediawiki/index.php/Main_Page

Good Luck!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba - Windows XP Problem (//Samba is not accessible) Covenent Linux - Networking 20 08-11-2011 04:07 PM
Samba sharing problem (user permission problem) beikokutn Linux - Software 4 03-11-2008 05:55 AM
Problem with Samba + AD aspenbr Linux - Software 2 12-27-2007 09:32 AM
samba 3 problem - samba PDC can not join to the domain ananthak Linux - Networking 1 05-21-2006 10:39 AM
when i restart SAMBA,it says:stop samba failed,start SAMBA OK! whepin Linux - Networking 3 12-26-2001 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration