Archive

Archive for February, 2013

Samba share from a NFS mount file locking issue

February 28, 2013 2 comments

A recent problem that came up was accessing Samba from a Windows machine. Samba server was exporting an NFS mounted device to its users. The users would receive a “The process cannot access the file because another process has locked a portion of the file.” This created a big headache as files could be accessed, but writes failed. You could still create a new file and delete it, but modifying it would get this error.

After some research, the solution to this problem was to modify the global section of smb.conf and change or add:
[global]
strict locking = no

Samba works on NFS-Shares if you switch off strict locking.

Advertisements
Categories: Linux, Redhat

Changing the NIS master

February 27, 2013 Leave a comment

I’d like to acknowledge Scott Frost for this explanation back in 2002.

Here are the steps you need to take to make a NIS slave a master server:

1. Ensure the NIS slave (the soon-to-be master) server has the current
version of the NIS maps. This should happen automatically if the push is
working between your current master and the slave server.

Each map must be rebuilt to reflect the new master. Copy the source files
/var/yp/Source and the makefile from the old master to the new one. Then
rebuild both servers maps. For example:

newmaster# cd /var/yp/
newmaster# rm *.time
newmaster# make NOPUSH=1

Removing all of the timestamp files forces all of the maps to be rebuilt;
Passing NOPUSH=1 to “make” prevennts the new maps from being pushed to the
other NIS slaves. This will keep you in service while your trying to build
the new master.

2. Install copies of the new master server’s maps on the old master server
using ypxfr:

oldmaster# ypxfr -h newmaster -f passwd.byuid
oldmaster# ypxfr -h newmaster -f passwd.bynmae
oldmaster# ypxfr -h newmaster -f hosts.byname

**Every NIS map must be transferred in this manner. I know that the syntax
seems wrong..trust it…it’s right. The -h flag sets NIS straight.

3. On the old master server push copies of the new maps to ALL o the NIS
slave servers:

oldmaster# yppush passwd.byuid
oldmaster# yppush passwd.byname
oldmaster# yppush hosts.byname

4. Remove the “oldmaster” host from the ypservers map

Categories: Linux, Redhat

Moving samba from one Linux server to another

February 26, 2013 2 comments

Suppose you want to replace an existing samba server with a newer system. What steps are involved in this?

On the target system ensure samba is installed:
# yum install samba

Next, copy over the smb.conf and smbpasswd files:
# scp :/etc/samba/smb.conf /etc/samba/smb.conf
# scp :/etc/samba/smbpasswd /etc/samba/smbpasswd

Now, edit your smb.conf file and ensure you “netbios name” is correct for the new server.

Make sure smb service runs at startup:
# chkconfig smb on

Import the new smbpasswd file and verify there are no errors, if clean it will import all your users:
# pdbedit -i smbpasswd:smbpasswd

Lastly, start the smb service and test your client connections:
# service smb start

Categories: Linux, Redhat