[Samba] Trouble samba sharing a read-only nfs mount
Greetings, I've been using samba for a few years now sharing files from the local filesystems without a hitch. Recently I have tried to throw into the mix read only samba shares of read only nfs mounts. I can browse these shares but any attempt to copy files from them seems to reset the connection. Windows says the resource is unavailable. On the Debian system that is sharing the file I see that these resets leave smb processes that don't exit for whatever user tried to copy from the share. I have dozens of them hanging around four hours after the last time I had tried to connect during which time the windows machine has been powered off. I see other smb processes that are days old from when other users have tried to copy from the same shares. What settings are required to make a read only samba share work on a read only nfs mount? I have tried faking or not using optlocks in the shares and of course writable=no. Does it matter that the nfs mounted share is a local nfs export? I was experimenting with rsync snapshot backups to provide 'support yourself' backups to users as described here: http://www.mikerubel.org/computers/rsync_snapshots/ I think this would have been covered/solved somewhere but it seems to be beyond my searching skills. I saw many posts talking about how samba sharing a nfs read only mount should work fine, but no details of the configuration or issues similar to mine. Thank you for your time and advice, -- Jacob Anawalt -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Re: Re: File changed as we read it.....
Well, the silence towards my issue with the mtime thing was starting to make me thing I was going about things all wrong or something, so I decided to try smbtar. It is a script that wraps the smbclient connection and tar command available within an smbclient session. The first thing I checked was the timestamp reported in an smbclient session, it was the 58 seconds timestamp that ls and a second or later stat reports for the file via an smbfs mount instead of the 57 seconds timestamp that windows, tar's first scan, and the first stat of a day report. The smbclient tar command ran on the file without any complaints. Using this tar does give me the ability to do 'windows style' incremental backups, based on the state of the archive bit (set/checked = back me up, I've been changed) bit. I dont see a verify option for the smbclient tar (v2.2.7) which I will miss. I was also trying to work with the GNU tar listed incremental option, but again perhapse I should just use the archive bit. When in Rome... Still, if someone knowledgeable with and working on the smbfs code (or wherever the mtime code is) would look into the mtime drift, I'd appreciate it. I have more details in my post from 5 Dec 2002: Re: SMBFS files receiving incorrect timestamps Jacob [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Fri, Dec 06, 2002 at 10:11:37AM -0700, Jacob Anawalt wrote: (I have sent this to [EMAIL PROTECTED] as well) David, I'm dealing with the same thing. I just posted yesterday asking about it. I'll put the contents of my post here, but a quick summary of what I found is that sometimes the mtime reports itself as one value and sometimes as another value for a few of the files I access. For whatever reason tar is getting the right value when it starts making the archive, but as it reads the file it sees that smbfs is reporting a new time (in my case the new mtime was one second later than the correct mtime.) Hopefully someone will have an answer for one of our posts. The error isn't critical, which is why tar finishes the archive and gives an exit delayed message, but it is frustrating because I don't know without investigating if it is a file that hasn't been modified for months, or if some program realy did change the contents of the file as I was tarring it. Even if a program did though, I believe you get the copy of the file as it was before the mtime changed. I am having this exact same problem, doing the exact same thing: backups. I simply assumed that it was just quirky, but it would be nice to be able to fix this. Very interested in hearing what you find out... --David Ps. I access the newsgroup using gmane.org (news.gmane.org : gmane.network.samba.general). It's a nice way to read the posts you want without getting tons of email all day like you do with a mailing list. David Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, This is probably a newbie question, but here goes. I am using samba to mount some windows box's hard drives to a linux box for the purpose of doing backups on the windows boxes. This is done late at night and I am SURE that no one is using the windows boxes While backing up I often see tar complain as follows: tar: IssRating/C4dll.dll: file changed as we read it or tar: MPLUTIL/AUTO/TXOLD/AUTOMENU.EXE: file changed as we read it What is causing these files to change??? Why would an executable or a dll change??? Please reply via e-mail as I am not a list subscriber. Tia. Dave -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba My Post: Re: SMBFS files receiving incorrect timestamps (Dec 5 2002) Hi, My tar (GNU tar) 1.13.25 on a RedHat 7.3 Linux system has been giving me non fatal, but discouraging messages for some time now as I try to archive files across smb mounts to a Windows 2000 Server system. it doesn't happen with all files, fortunatly, but it does happen with a few files per archive. tar: filename: file changed as we read it The strange thing was when I would look at the files the mtime (on either system) was several months old. Today I dug deeper because I am increasing the number of files that I am backing up across the smb mounts. What I found was that without fail, tar would get one mtime value when it started reading the file, but that time must have drifted while reading the file, hence the message. mtime tar puts into the archive: (no matter how many times I run tar) 2002-01-30 13:41:57 This is the same value reported by the file properties on the Windows 2k server. mtime ls -l --full-time reports Wed Jan 30 13:41:58 2002 The first time I ran stat (after tarring the file a few times) it reported: Wed Jan 30 13:41
[Samba] Re: Re: File changed as we read it.....
So, I try playing with smbtar from the RedHat 7.3 samba-client-2.2.7-1.7.3 rpm and it decides to ignore the incremental command, yet when I connect with the smbclient interactive session and use the tar command, incremental (g) works. smbtar -i -v -a -s post -p password -x qbooks -t test-arc-inc_qbooks_smbtar.tar serveris post share is qbooks\\ tar args is ga tape is test-arc-inc_qbooks_smbtar.tar blocksize is added interface ip=192.168.0.9 bcast=192.168.0.255 nmask=255.255.255.0 Domain=[OFFICE] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] tarmode is now full, system, hidden, reset, verbose vs: smbclient //post/qbooks added interface ip=192.168.0.9 bcast=192.168.0.255 nmask=255.255.255.0 Password: Domain=[OFFICE] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] smb: \ tar cga test-arc-inc-maybe_qbooks_smbtar.tar directory \bkups gecko\ directory \INET\ directory \old Gecko\ directory \qbooks\ directory \qbooks\INET\ tar: dumped 5 files and directories Total bytes written: 0 It seems smbtar passes -c 'tarmode full' even if you use the -i(incremental) option. So, I've modified my smbtar script to change clientargs to -c 'tarmode inc' when the [i]ncremental option is given. I don't know how this is different than just removing the clientargs command completely, other than with the command in verbose mode it echos the nice 'tarmode is now bla, bla, bla' string. I'm posting the smbtar script fix info in a new message so it is easier to find. I've checked the CVSweb and the file has the bug and hasn't been modified for almost three years. Jacob Anawalt Jacob Anawalt [EMAIL PROTECTED] wrote in message at5apv$4gu$[EMAIL PROTECTED]">news:at5apv$4gu$[EMAIL PROTECTED]... Well, the silence towards my issue with the mtime thing was starting to make me thing I was going about things all wrong or something, so I decided to try smbtar. It is a script that wraps the smbclient connection and tar command available within an smbclient session. The first thing I checked was the timestamp reported in an smbclient session, it was the 58 seconds timestamp that ls and a second or later stat reports for the file via an smbfs mount instead of the 57 seconds timestamp that windows, tar's first scan, and the first stat of a day report. The smbclient tar command ran on the file without any complaints. Using this tar does give me the ability to do 'windows style' incremental backups, based on the state of the archive bit (set/checked = back me up, I've been changed) bit. I dont see a verify option for the smbclient tar (v2.2.7) which I will miss. I was also trying to work with the GNU tar listed incremental option, but again perhapse I should just use the archive bit. When in Rome... Still, if someone knowledgeable with and working on the smbfs code (or wherever the mtime code is) would look into the mtime drift, I'd appreciate it. I have more details in my post from 5 Dec 2002: Re: SMBFS files receiving incorrect timestamps Jacob [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Fri, Dec 06, 2002 at 10:11:37AM -0700, Jacob Anawalt wrote: (I have sent this to [EMAIL PROTECTED] as well) David, I'm dealing with the same thing. I just posted yesterday asking about it. I'll put the contents of my post here, but a quick summary of what I found is that sometimes the mtime reports itself as one value and sometimes as another value for a few of the files I access. For whatever reason tar is getting the right value when it starts making the archive, but as it reads the file it sees that smbfs is reporting a new time (in my case the new mtime was one second later than the correct mtime.) Hopefully someone will have an answer for one of our posts. The error isn't critical, which is why tar finishes the archive and gives an exit delayed message, but it is frustrating because I don't know without investigating if it is a file that hasn't been modified for months, or if some program realy did change the contents of the file as I was tarring it. Even if a program did though, I believe you get the copy of the file as it was before the mtime changed. I am having this exact same problem, doing the exact same thing: backups. I simply assumed that it was just quirky, but it would be nice to be able to fix this. Very interested in hearing what you find out... --David Ps. I access the newsgroup using gmane.org (news.gmane.org : gmane.network.samba.general). It's a nice way to read the posts you want without getting tons of email all day like you do with a mailing list. David Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, This is probably a newbie question, but here goes. I am using samba to mount some windows box'
[Samba] bug: smbtar and incremental backup
Program: smbtar Package: RH7.3 samba-client-2.2.7-1.7.3 Code is the same in branch SAMBA-TNG revision 1.8.2.1 and branch Main revision 1.9, and hasn't been modified for almost three years. The line numbers listed below are in referance to brance Main revision 1.9 as listed here: http://cvs.samba.org/cgi-bin/cvsweb/samba/source/script/smbtar?annotate=1.9 Problem: When calling smbtar with the [i]ncremental option, it still performs a full dump. Solutions for smbtar: Either change the smbtar script from: 82:i) # [i]ncremental 83: tarargs=${tarargs}g 84: ;; 82:i) # [i]ncremental 83: tarargs=${tarargs}g 84: clientargs=-c 'tarmode inc' 85: ;; Or: remove ${clientargs} from the script. I don't know enough about the differance between the solutions to suggest one over the other. I just know that either solution seems to work, and the first one makes it still print the nice little tarmode is now bla, bla, bla line in verbose mode. Another option would be to allow -T[args] options to override the tarmode [option] settings the way that it seems to be documented that tar [args] from in a smbclient session does. Maybe that should be done anyway. Again I don't know enough about the affects to say if this is a good idea. Hopefully someone has a minute to commit this to CVS before the next release, and in the mean time I hope I've made this clear enough for people who would like the incremental option to work using smbtar to fix their own scripts. Jacob Anawalt -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Re: smbtar and incremental backup
I forgot, there is a comment about the tarmode needing to be set to fix a fix that changed the default to not archive system and hidden files. I didn't test to see if this was still the case, but it sounds like changing the tarmode to inc is the better option, unless the -T[args] are allowed to override the tarmode and -T flags are added for system and hidden files, or if just calling tarmode without specifying an option still grabs those files (it says it is going to). Ie: -c 'tarmode' Maybe the tar system and hidden files flags should be added for tarmode and tar/-T anyway to avoid any misunderstanding of whether an archive is going to contain those files or not. Jacob Anawalt I don't know enough about the differance between the solutions to suggest one over the other. I just know that either solution seems to work, and the first one makes it still print the nice little tarmode is now bla, bla, bla line in verbose mode. Another option would be to allow -T[args] options to override the tarmode [option] settings the way that it seems to be documented that tar [args] from in a smbclient session does. Maybe that should be done anyway. Again I don't know enough about the affects to say if this is a good idea. Hopefully someone has a minute to commit this to CVS before the next release, and in the mean time I hope I've made this clear enough for people who would like the incremental option to work using smbtar to fix their own scripts. Jacob Anawalt -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Re: nt-samba backup suggestions
Dale, The RH-Linux 7.3 samba-client rpm installed a script file called smbtar in /usr/bin. It wraps the smbclient command specificaly for running the smbclient tar program. I don't know where it is installed on your system, if at all. It is most likely in /usr/bin or /usr/local/bin if you've installed the full samba package. You could use that script in your own scripts, or just borrow from it to understand how to call smbclient in non-interactive mode to tar a share. You could probably even use smbclient in interactive mode with an expect script. It supports exclude/include patterns (including regexp file name matching), full and incremental backups, and changing to a starting directory, as well as resetting or not resetting the windows archive flag on files so you could do incremental or differential backups. It doesn't seem to support the verify option or compression. It's documented to write directly to a tape device, but I've only used it to write to a file on the linux box. You could also just use GNU tar across a smbfs, but you may run into problems with errors about the file being modified while reading the archive when you know it wasn't. I tried that way at first, since I knew GNU tar better, and it has a much larger range of options, including the ability to give shell pattern matching for include files as well as an exclude shell pattern, rather than just one or the other. You may want to see these posts for more info: bug: smbtar and incremental backups smbclient returns incorrect file size for large files File changed as we read it Re: SMBFS files receiving incorrect timestamps If you are following the mailing list, but just joined you can find these at news.gmane.org. Jacob Anawalt Sykora, Dale [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. .. Hello, I am building a linux/samba server to backup some nt servers and would appreciate some suggestions/pointers/criticisms etc... I googled for samba backup but could not find many similar solutions. need... Full/incremental network backups for 2=nt and 1=win2k servers. Ability to choose which folders/files get included/excluded. No software costs. motivation... Full drive backups exceed 1 dds3 tape but some files do not need backup. NT backup makes include/exclude difficult. win2k backup difficult to script. Will move from NT to linux/samba eventually. Tape drive failures cause main server downtime. gameplan... Build Linux-samba box with 3 dds3 drives and 4 100Mb nics. Add another nic to each nt/win2k server. Build 3 crossover ethernet cables. Configure nics with private ip addresses. Mount nt shares with smbfs or use smbclient. Linux script backsup/compresses specific nt files to a local tar file and then copy file to tape. I had some problems connecting via the crossover cable, but did connect via primary nics. If anyone has attempted something similar, let me know. Thanks, Dale -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Re: Samba with Mysql as backend and VIRTUAL users.
Alex, It sounds like you are trying to do w/ the mysql database what some organizations have done with NIS/YP or are doing with LDAP or MS Directory Services. If you are using a system that includes PAM, you can reconfigure your system to look to sources other than the password file for username lookups. I looked into this, toying with the idea of using LDAP to sync all my server accounts and samba logins. There were modules to do this, but it seemed a bit daunting for the few user accounts I was worried about. Perhaps it wont be much longer before this process becomes more polished and the documentation is refined. Anyway, I've seen smb.config files that talk about syncing unix and samba username/passwords. I've also read about the difference between unix passwords and windows passwords and why in the LDAP structure there is a space for the unix password and for the samba password, but I dont remember the details now. So, my suggestion is to look into samba with LDAP (lightweight directory access protocol) and PAM (pluggable authentication module), or at least samba with PAM and authenticating to a mysql db (google had a few hits w/ samba pam mysql). You may also want to look into stunnel or some ssh setup so the mysql transactions for password lookups aren't in the clear. The LDAP client is able to be configured to verify against SSL certificates to know that the LDAP server is valid. Alex Pita [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello samba experts, I want to configure samba with mysql as backend. I searched on google and i found some info about this subject but it seems to be not really what i nedd. I said this because i found few howtos about how to configure samba to read password from mysql database to authenticate users. Is good but not enough. I don't want shell users with different password for samba!!! I want ONLY VIRTUAL USERS (no one shell account) and al of them MUST resides in mysql database with all attributes (home directory, UID, GID, password, domain, etc). Google said that my problem is not well documented and in the past was some tryes about this subject. I found also some info about samba and pam_mysql plugin. I've configured few weeks ago this plugin to authenticate users for postfix smtp, and everithing was ok. Actually, i want to do the same work with samba, but i don't know if samba-2.2.7 support it. Can anybody point me to the right way? Some success stories about this subject will be appreciated. Thanks in advance, Alex Pita -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Re: Need a cron script written
Well -f (force) has been mentioned, but since you specificaly said you'd like to answer yes, use yes. yes | cp -a (or whatever flags you want for cp) It's a funny little program (but usefull, I'm not knocking it). Run it by itself just for fun. Remember ctrl-c to break... Jacob Brent Torrenga [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Kevin, I use the same technique, and only use cp -R, it does it fine on my Mandrake 8.2 machine. Is there also a way to tell cp to answer yes to any questions? --Brent From: Kevin Brown [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Thu, 28 Nov 2002 21:33:06 -0800 Reply-To: [EMAIL PROTECTED] Subject: [Samba] Need a cron script written I do this manually: smbmount //Beverley/C /home/data pwd: insert pwd cp -ruv /home/samba/public /home/data smbumount /home/data This lets me do the following: make a copy of all my samba shares on the server to a client named Beverley C drive. ruv does the following recursive (all subdirectories and subfolders) unchanged (only write over when newer) verbose pwd: insert pwd would be my password for that share (secret!!) the only problem is I can not get cp to do this quietly or without input, even dropping the v makes me confirm each write. I need to unmount the share at end of backup. Any ideas of doing it another way much appreciated. I currently run a cron job, tar -cvfpP /dev/st0 /home/samba/public weekly to save all my samba server shares to tape. best, kevin brown -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Re: File changed as we read it.....
(I have sent this to [EMAIL PROTECTED] as well) David, I'm dealing with the same thing. I just posted yesterday asking about it. I'll put the contents of my post here, but a quick summary of what I found is that sometimes the mtime reports itself as one value and sometimes as another value for a few of the files I access. For whatever reason tar is getting the right value when it starts making the archive, but as it reads the file it sees that smbfs is reporting a new time (in my case the new mtime was one second later than the correct mtime.) Hopefully someone will have an answer for one of our posts. The error isn't critical, which is why tar finishes the archive and gives an exit delayed message, but it is frustrating because I don't know without investigating if it is a file that hasn't been modified for months, or if some program realy did change the contents of the file as I was tarring it. Even if a program did though, I believe you get the copy of the file as it was before the mtime changed. Ps. I access the newsgroup using gmane.org (news.gmane.org : gmane.network.samba.general). It's a nice way to read the posts you want without getting tons of email all day like you do with a mailing list. David Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, This is probably a newbie question, but here goes. I am using samba to mount some windows box's hard drives to a linux box for the purpose of doing backups on the windows boxes. This is done late at night and I am SURE that no one is using the windows boxes While backing up I often see tar complain as follows: tar: IssRating/C4dll.dll: file changed as we read it or tar: MPLUTIL/AUTO/TXOLD/AUTOMENU.EXE: file changed as we read it What is causing these files to change??? Why would an executable or a dll change??? Please reply via e-mail as I am not a list subscriber. Tia. Dave -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba My Post: Re: SMBFS files receiving incorrect timestamps (Dec 5 2002) Hi, My tar (GNU tar) 1.13.25 on a RedHat 7.3 Linux system has been giving me non fatal, but discouraging messages for some time now as I try to archive files across smb mounts to a Windows 2000 Server system. it doesn't happen with all files, fortunatly, but it does happen with a few files per archive. tar: filename: file changed as we read it The strange thing was when I would look at the files the mtime (on either system) was several months old. Today I dug deeper because I am increasing the number of files that I am backing up across the smb mounts. What I found was that without fail, tar would get one mtime value when it started reading the file, but that time must have drifted while reading the file, hence the message. mtime tar puts into the archive: (no matter how many times I run tar) 2002-01-30 13:41:57 This is the same value reported by the file properties on the Windows 2k server. mtime ls -l --full-time reports Wed Jan 30 13:41:58 2002 The first time I ran stat (after tarring the file a few times) it reported: Wed Jan 30 13:41:57 2002 I ran it again, immediatly after that output, and it reported: Wed Jan 30 13:41:58 2002 stat continues to report this value no matter even after running tar again, which continues to put the (correct) Wed Jan 30 13:41:57 2002 value into the archive When I copied (cp -a) the file from the smb mount to the local ext3 fs, the mtime was Wed Jan 30 13:41:58 2002 (incorrect) Now, one second isn't any big deal except that tar sees it as a change and then I have to track down and see if tar realy got the right version of the file(s) (maybe the file wasn't months old). I have tried remounting, and that didn't help. Other program versions: kernel 2.4.18-3 samba 2.2.7-1.7.3 stat: 2.5-5 ls (GNU fileutils) 4.1 mount 2.11n-12.7.3 I found this thread in the archives in October 2002, and it seems slightly related. I gather from the reply that smbfs is actualy managing the mtime values instead of passing on what it reads from the remote file system? If so, is there one library call (the one tar uses for the archive headers) that returns the right mtime, and another (the one tar uses to see the file has changed and that ls -l uses) that returns the wrong mtime? More likely by some wierd twist tar always gets smbfs to report the right time at first but then as the file is accessed (read by tar, ls) smbfs is then reporting the wrong mtime? Any suggested work-arounds in configuration settings are appreciated. Maybe when someone is going over the timestamp code, they might use this information to fix the glitch (if it is in the smbfs/smb mount) Jacob Anawalt On Mon, 28 Oct 2002, Urban Widmark wrote: smbfs sets the mtimes itself. Not really sure why it was done like that, but some comments claim that NT4 doesn't set mtime properly otherwise. It would be better to