For some reason we want to disable fnctl lock for NFS mounted partition. We can achieve this by the following command: mount_nfs -T -L server:/home /mnt However after several time of failure tests, we still can not make it work in /etc/fstab. server:/home /mnt nfs rw,tcp 0 0 It seems there is no coresponding options in /etc/fstab so that I can disable fnctl lock for NFS. If we can not set it right in /etc/fstab, every time the machine reboot requires human intervention to mount the partition manually. It is very annoying and inconvenient. Please give us some suggestion and hint to solve this situation. By the way, since the machine is running as a mail server which install postfix,courier-imap, will it happen any kind of data corruption due to NFS fnctl lock disabled? Best regards, Tim
> For some reason we want to disable fnctl lock for NFS > mounted partition. We can achieve this by the following > command: mount_nfs -T -L server:/home /mnt > However after several time of failure tests, we still > can not make it work in /etc/fstab. >According to man mount_nfs: -L Do not forward fcntl(2) locks over the wire. All locks will be local and not seen by the server and likewise not seen by other NFS clients. This removes the need to run the rpcbind(8) service and the rpc.statd(8) and rpc.lockd(8) servers on the client. Note that this option will only be honored when performing the initial mount, it will be silently ignored if used while updating the mount options. ... Historic -o Options Use of these options is deprecated, they are only mentioned here for compatibility with historic versions of mount_nfs. bg Same as -b. ... lockd Same as not specifying -L. If you do not specify lockd on the client and don't run rpcbind on the server it may run as you require. But I haven't tried myself. If my assumption is correct you only need to make shure that rpcbind is not running on the server. -- regards Claus When lenity and cruelty play for a kingdom, the gentler gamester is the soonest winner. Shakespeare
Tim Chen wrote:> For some reason we want to disable fnctl lock for NFS > mounted partition. We can achieve this by the following > command: mount_nfs -T -L server:/home /mnt > However after several time of failure tests, we still > can not make it work in /etc/fstab. > > server:/home /mnt nfs rw,tcp 0 0 > > It seems there is no coresponding options in /etc/fstab > so that I can disable fnctl lock for NFS. If we can not > set it right in /etc/fstab, every time the machine reboot > requires human intervention to mount the partition manually. > It is very annoying and inconvenient. > > Please give us some suggestion and hint to solve this situation.I see some references to 'nolock' here and there, but YMMV.
Tim Chen wrote:> For some reason we want to disable fnctl lock for NFS > mounted partition. We can achieve this by the following > command: mount_nfs -T -L server:/home /mnt > However after several time of failure tests, we still > can not make it work in /etc/fstab. > > server:/home /mnt nfs rw,tcp 0 0 > > It seems there is no coresponding options in /etc/fstab > so that I can disable fnctl lock for NFS. If we can not > set it right in /etc/fstab, every time the machine reboot > requires human intervention to mount the partition manually. > It is very annoying and inconvenient. > > Please give us some suggestion and hint to solve this situation.I see some references to 'nolock' here and there, but YMMV.
On Fri, Sep 05, 2008 at 12:11:20AM +0800, Tim Chen wrote:> By the way, since the machine is running as a mail server which > install postfix,courier-imap, will it happen any kind of data > corruption due to NFS fnctl lock disabled?Regarding postfix, you will probably need dotlocking enabled during mailbox delivery. http://www.postfix.org/NFS_README.html Regarding courier-imap (have you considered dovecot?), you might want to see commit revision 1.4.3 to the Makefile, indicating fcntl is required to build the port on an NFS mount, so fcntl is forced: http://www.freebsd.org/cgi/cvsweb.cgi/ports/mail/courier-imap/Makefile Be sure to look at line 65 of the Makefile. Regarding courier-imap itself, I believe it can be configured to use dotlocks, but I can't find any documentation on this (I'm searching Google though). Finally, this seems relevant (arguing "do not disable fcntl over NFS!"), as something I happened to be reading earlier today; see "Why is NFS so slow?": http://www.fefe.de/muttfaq/faq.html#common-problems Personally, I think you're asking for trouble disabling fcntl on NFS; the fact you're having to (more or less) reverse-engineer all this software to find out if it's compatible with that scenario is added proof. The fact you're doing this on a mail server running an MDA is even more scary. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
Tim Chen wrote: > For some reason we want to disable fnctl lock for NFS > mounted partition. We can achieve this by the following > command: mount_nfs -T -L server:/home /mnt > However after several time of failure tests, we still > can not make it work in /etc/fstab. > > server:/home /mnt nfs rw,tcp 0 0 server:/home /mnt nfs rw,tcp,-L 0 0 > By the way, since the machine is running as a mail server which > install postfix,courier-imap, will it happen any kind of data > corruption due to NFS fnctl lock disabled? In general, all programs that access mail files must use locking for concurrent access. Without proper locking you'll get data corruption. I strongly advise against running mail software on NFS mounts without locking (i.e. with the -L option). Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Gesch?ftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M?n- chen, HRB 125758, Gesch?ftsf?hrer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor, and when was the last time you needed one?" -- Tom Cargil, C++ Journal