A very important solution to problems with samba and other issues

I found a solution to those problems with my book live:

- live book after few hours dissapears from network and can’t be accessed from any application / computer (but may be visible via ftp) and u have to reset it manually

- live book is not waking up from sleep (but u can send pings)

-all other problems with samba network, i had all the problems above

The problem is:

i have found that the log in:

/var/log/:

contatins errors that include samba panic. it may look like this

[2013/08/14 17:46:56.536355, 0] lib/fault.c:48(fault_report)
INTERNAL ERROR: Signal 7 in pid 31499 (3.6.5)
Please read the Trouble-Shooting section of the Samba3-HOWTO
[2013/08/14 17:46:56.537915, 0] lib/fault.c:50(fault_report)

From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
[2013/08/14 17:46:56.538702, 0] lib/fault.c:51(fault_report):

and some other problems:

[2013/12/19 18:15:18.029862, 0] …/lib/util/tdb_wrap.c:65(tdb_wrap_log)
tdb(/var/run/samba/connections.tdb): expand_file write of 8192 bytes failed (No space left on device)
[2013/12/19 18:15:18.030831, 0] smbd/connection.c:164(claim_connection)
claim_connection: tdb_store failed with error NT_STATUS_UNSUCCESSFUL.
[2013/12/19 18:15:18.390960, 0] …/lib/util/tdb_wrap.c:65(tdb_wrap_log)
tdb(/var/run/samba/connections.tdb): expand_file write of 8192 bytes failed (No space left on device)
[2013/12/19 18:15:18.391486, 0] smbd/connection.c:164(claim_connection)
claim_connection: tdb_store failed with error NT_STATUS_UNSUCCESSFUL.

So apparently the problem is around libtdb (which is a lightweight database library used commonly in smbd). We are failing to write data properly and do not handle the issue gracefully resulting in a corruption that further leads to read issues, and this cascades to a segfault. But we have a very good hint as to why this happens: “No space left on device”.
MyBookLiveDuo:/var# ls -l run
lrwxrwxrwx 1 root root 4 Sep 16 21:52 run -> /tmp

MyBookLiveDuo:/tmp# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 1968336 615504 1252844 33% /
tmpfs 5120 0 5120 0% /lib/init/rw
udev 10240 1216 9024 12% /dev
tmpfs 5120 0 5120 0% /dev/shm
tmpfs 102400 102400 0 100% /tmp
ramlog-tmpfs 20480 8832 11648 44% /var/log
/dev/md3 5828537152 337732608 5490804544 6% /DataVolume

So samba is serialising the libtdb data in /tmp which is full. Upon further inspection, we can see that all the space in /tmp is taken by 3 files with a JPG prefix and a seemingly random suffix:
-rw------- 1 root root 31795968 Dec 19 18:49 JPG17Si53T
-rw------- 1 root root 33685504 Dec 19 18:49 JPG2irQTXD
-rw------- 1 root root 34979328 Dec 19 18:49 JPG3lv6tTn

If we delete these files, purge the /var/run/samba directory and restart smbd, we will no longer have any issues with smbd and file sharing will work properly.

SO THE SIMPLE SOLUTION:

Enable SSH, log in to my book live and clean up tmp folder from junk files (probably with filenames similar to those above) in my case there were 3 files around 60mb with filename like: JPG3lv6tTn)

 

The problem is that the tmp folder is too small (100mb), if anyone knows how to increase tmp size please help.

After cleaning up the tmp folder the shares were back, and everything is normal, no resetting, the drive is waking up without problems, i hope this helps.

It’s not my solution, the source is here: 

 

http://ilkos.github.io/2013/12/19/investigating-a-bug-in-wd-mybook-live/

1 Like

Hello,

Thank you for sharing this. Hope it helps other users.