Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm using Mac OS X Snow Leapord. My iMac's hard drive has been getting unexpectedly full, and I finally tracked the problem down to a huge file: private/var/log/samba/log.smbd.old, weighing in at 400GB.

I just ran tail -100 log.smbd.old to see the last 100 lines of that log file. What I see is a ton of "too many open files" errors.

This is a work machine. I do share files with other Mac users, and also access a shared Windows drive via Samba.

How can I troubleshoot these errors so the log file doesn't get filled with them?

share|improve this question
add comment

2 Answers

Now I'm no kernel expert, but I think that you might be running into the fact that the default value for the maxflies kernel parameter is 256. You can show your current value for this parameter like this:

[dwayne | ~] $ launchctl limit maxfiles
    maxfiles    256            unlimited 

I think if you put a line similar to this in a file /etc/launchd.conf (you might have to create the file if it doesn't already exist):

limit maxfiles 2048 unlimited

and reboot, you will see the new value, and hopefully avoid the situation you're running into.

Dwayne

share|improve this answer
add comment

Download an editor like TextWrangler or use PICO.

  1. Edit conf file: a. Copy the file below and save it somewhere else BEFORE editing it. Drop it back into the folder if you have any problems after doing this.

b. Open /private/etc/smb.conf in editor

c. Add the following line to the file (do man smb.conf to see max log size = (number in kb) so 5 MB would be 5000

max log size = 5000

d. save file (enter admin password) and exit editor.

  1. Delete old log files: Delete log files in /private/var/log/samba/ (back them up before deleting as with file above):

3. Reboot.

share|improve this answer
1  
That just helps with the size of the log files, it doesn't solve the fundamental problem that Samba is running out of file descriptors. –  jelmer Aug 3 '12 at 12:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.