Log in

Bekijk de volledige versie : Problem with WL-HDD and Samba...



dl9sec
22-06-2009, 18:09
Hi all,

some days ago i upgraded my WL-HDD from Olegs firmware 1.9.2.7-7c to 1.9.2.7-9. After reconfiguring the whole thing (and after tapping through all the pitfalls concerning the changes between the old and the latest firmware :)) all seems to be ok so far.
The NFS mounts are working well and the Samba share appears in my Windows-Workgroup.

But now i discovered a strange problem: I tried to copy a whole directory with some subdirectories an some files in each from my local HDD to a subdirectory on the WL-HDDs share.
The copy process starts, the network LED and the HDD-LEDs were blinking fast. After about 7 seconds the transfer stalls. The both LEDs doesn't flicker anymore instead they were static on. The Samba connection drops (after about a minute the Explorer says, that the drive doesn't exist anymore) and connecting the WL-HDD via SSH was impossible. The WL-HDD seems to hang (not crash, after a minute the HDD-LED starts to flash with a several seconds cycle, but also the webinterface doesn't work anymore).

My WL-HDD starts with the following post-boot script:


#!/bin/sh

# Activate swap
swapon /dev/discs/disc0/part1

# Set Standby of internal HDD to 10 minutes
/usr/local/sbin/hdparm -S 120 /dev/discs/disc0/disc

# Start dropbear SSH server
/usr/sbin/dropbear

mkdir /tmp/harddisk
# Mount /tmp/harddisk for Samba
mount /dev/discs/disc0/part2 /tmp/harddisk

# wait for /opt to mount
mount /dev/discs/disc0/part2 /opt
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

# Start Samba and NMBD
/usr/sbin/nmbd -D -l /opt/var/log/nmbd.log -s /opt/etc/smb.conf
/usr/sbin/smbd -D -l /opt/var/log/smbd.log -s /opt/etc/smb.conf


After boot ps shows the following:


PID Uid VmSize Stat Command
1 admin 580 S /sbin/init
2 admin SW [keventd]
3 admin SWN [ksoftirqd_CPU0]
4 admin SW [kswapd]
5 admin SW [bdflush]
6 admin SW [kupdated]
7 admin SW [mtdblockd]
51 admin 380 S httpd
54 admin 408 S syslogd -m 0 -O /tmp/syslog.log -S -l 7
56 admin 364 S klogd
57 admin SW [khubd]
72 1 364 S [portmap]
74 admin 504 S /usr/sbin/statd
76 admin SW [nfsd]
78 admin SW [lockd]
79 admin SW [rpciod]
80 admin 484 S /usr/sbin/mountd
83 admin 468 S watchdog
85 admin 344 S ntp
96 admin 480 S /usr/sbin/dropbear
98 admin SW [kjournald]
113 admin 728 S /usr/sbin/dropbear
114 admin 576 S -sh
122 admin 980 S /usr/sbin/nmbd -D -l /opt/var/log/nmbd.log -s /opt/et
124 admin 996 S /usr/sbin/smbd -D -l /opt/var/log/smbd.log -s /opt/et
126 admin 396 R ps


The smb.conf is straight forward:


[global]
workgroup = WORKGROUP
guest account = nobody
security = share
browseable = yes
guest ok = yes
guest only = no
log level = 1
max log size = 100
server string = WLHDD-Share

[share]
path = /tmp/harddisk

[share$]
path = /tmp/harddisk
writable = yes
browseable = yes
force user = admin


Unfortunately the log smbd.log is empty.
After googling I did already some tries (e.g. with ading oplocks = no, level2 oplocks = no, locking = yes to my smb.conf) but with no success.
With the firmware 1.9.2.7-7c huge filetransfer worked very well.
Now it seems, that the WL-HDD is flodded with data from the network (100Mb/s) and at a specific point HDD transfer is collapsing :confused:

Addendum:
I also tried to slow down the Ethernet interface with


et -i eth1 speed 10half

in my post-boot script, but with no success. It seems that the behaviour depends on the amount of data (the copy process stalles at about the same amount of data transceered)...

Any ideas?

Thanks in advance...

Regards, Thorsten

wengi
23-06-2009, 08:28
Hi,

mounting is done with fstab since -9 firmware.
Have a look in my howto.

Are you using the intzegrated or the ipkg (Version?) samba?

wengi

dl9sec
23-06-2009, 12:46
Hi Wengi,



mounting is done with fstab since -9 firmware.
Have a look in my howto.


The "manual" mount is a relict from the migration from -7c to -9. I have two WL-HDDs and i first modified the one and see if it works before having a non-working NAS... :)
Will switch over to fstab soon...



Are you using the intzegrated or the ipkg (Version?) samba?


The integrated one...

Thorsten

dl9sec
23-06-2009, 17:19
Me again...

further on i tried to follow Wengis translated How-To especially automount with fstab.
Automount of /tmp/harddisk will not work because /tmp/harddisk does not exist anymore in this firmware (therefore i did a mkdir /tmp/harddisk in my post-boot!).
As i follow the instructions exactly (ch. 12a), after a boot there is definitely NO Samba (no smbd/nmbd daemon in process list) working and i can not find any smb.conf.

So i am very confused because the instructions will not work for me. Is there a difference in behaviour of a WL500g and a WL-HDD? Under which circumstances is Samba starting automatically?
Very strange...

Addendum:
Spending the whole evening trying and trying i found out, that -9 behaves a bit different from -7c:
- If Samba is enabled in -7c, /tmp/harddisk is automatically shared via "share" (ro)/"share$" (rw)
- In -9 the Samba that is configured via the webinterface is intended for connected USB devices only. In the moment a USB storage is plugged, the daemons smbd and nmbd are loaded automatically with some kind of default config.

So if someone is starting Samba itself (via rc... or in one of the startup scripts) for sharing the internal HDD the Samba support should be disabled in the webinterface otherwise there will be a conflict and the share doesn't work propperly anymore.

Anyhow, the "startup-sripts/fstab/usb"-stuff is just a side show...the actual problem with the dropping samba at heavy file transfer still exists. The next step will be to install samba2 from the Optware repository and see if it is working better...

Regards, Thorsten

wengi
24-06-2009, 10:43
Hmm.. this is strange.

i am using the integrated samba of my WL-HDD 1.9.2.7-9 and it works fine. (I copy a lot of big files)

My setup is as in the HowTo and smb is starting at boot without pre/post entries.
The smb.conf generated by smb:
[admin@blechbuechse root]$ cat /tmp/etc/smb.conf
[global]
interfaces = br0
bind interfaces only = yes
workgroup = WEN
server string = WLHDD
guest account = nobody
security = share
browseable = yes
guest ok = yes
guest only = yes
log level = 1
max log size = 100
encrypt passwords = no
preserve case = yes
short preserve case = yes
client code page = 850

[disc0_3]
path = /tmp/mnt/disc0_3
writable = yes
force user = admin


wengi

dl9sec
24-06-2009, 17:09
Hi Wengi,

thanks for the reply.
As announced i just installed xinetd and samba2 as described in your how-to. Installation works fine without any problems. Configuration was too easy via SWAT :D and what should i say....
...Samba works excellent, perfect, brilliant! I did the same filetransfer as with the integrated Samba daemons running and it was really fast and runs like clockwork.

So i am happy so far and will do all the stuff with my second WL-HDD again :cool:

Regards, Thorsten

dl9sec
28-09-2009, 19:47
Hi,

me again with some Samba trouble.

After thinking all is ok now with my Samba installation/configuration, i discovered a similar problem like with the "old" Samba.

I have a rar-file (3 parts, with about 95MB/95MB/40MB) on my Samba-share. I started a uncompression via XP file explorer. All started normal. At the WL-HDD i can see the traffic-LED and HDD-LED blinking fast. Exactly after 146.791.575 bytes (139MB) the decompression stalles and the drive dissappears in the file explorer. 7zip reports, that the drive doesn't exist anymore or something with semaphore timeout.

This happens every time exactly at the same time. No more access via SSH is possible anymore, no webinterface acessible. Only the HDD-LED flashes cyclically with some seconds between. The only thing that helps is to unplug from the power source.

The samba log doesn't show anything about that problem. Maybe it has to do with file access. I tried to play with parameters like e.g. "strict sync" but nothing helps.

I think there is a relation between samba, file access and the amount of data that is transferred. There is no problem e.g. streaming GBs of data via NFS with a data rate of several MB/s.

Any ideas?

Regards, Thorsten

wengi
29-09-2009, 07:51
Hi,

try to

- copy the files to your pc and extract them loacally
- e2fsck the data partition of the asus
- check the log files
- monitor the 'top' of asus during extraction of the files.

wengi

dl9sec
03-10-2009, 11:33
Hi wengi,

thanks for the reply.



- copy the files to your pc and extract them loacally


Done. Works great. The files doesn't seem to be the problem.



- e2fsck the data partition of the asus


Done. No data corruption, HDD is clean (e2fsck -p -f and e2fsck -f).



- check the log files


Done. It is hard to find an entry that has a direct relation with the stall. But around the timestamp of the stall i sometimes can see the folowing entry as an example:


[2009/09/29 21:11:55, 0] source/lib/util_sock.c:read_data(436)
read_data: read failure for 4. Error = No route to host


and sometimes:


[2009/09/30 19:06:01, 0] source/lib/util_sock.c:read_data(436)
read_data: read failure for 4. Error = Connection timed out


In the nmbd log i often can find the folowing entry:


[2009/09/30 20:55:48, 0] source/nmbd/nmbd_responserecordsdb.c:find_response_record(235)
find_response_record: response packet id 16212 received with no matching record.


I don't know if this is "normal" or maybe a hint to the problem i have.



- monitor the 'top' of asus during extraction of the files.


Done. Whenever the WL-HDD freezes, the top output freezes too:


Mem: 29556K used, 616K free, 0K shrd, 1696K buff, 21536K cached
Load average: 1.45, 0.77, 0.31 (State: S=sleeping R=running, W=waiting)

PID USER STATUS RSS PPID %CPU %MEM COMMAND
130 admin R 364 127 1.3 1.2 top
126 admin S 392 93 1.1 1.2 dropbear
131 admin D 1604 123 0.0 5.3 smbd
114 admin S 500 1 0.0 1.6 xinetd
73 admin S 476 1 0.0 1.5 statd
125 admin S 464 1 0.0 1.5 nmbd
50 admin S 356 1 0.0 1.1 httpd
123 admin S 356 1 0.0 1.1 smbd


Again and again i forced a check of the HDD with e2fsck. But it says, that all is ok. But i have found the following:

I decompressed the rar. The HDD freezes, i powered off and started the WL-HDD again. Then i renamed the uncompressed fragment and tried to decompress the rar again. And the it works.
For me it seems, that i have something like a bad sector on my HDD and whenever i cross this bad sector, the whole thing freezes. But i don't know how to solve...

Regards, Thorsten

wengi
04-10-2009, 12:38
Hmmm... strange :(
No idea atm.

Does it work if you extract the files directly on the router?


ipkg install unrar
screen
unrar e filenamewengi

dl9sec
25-10-2009, 16:15
Hi Wengi,

thanks a million for the hints.

The problem is solved: my HDD is defective. It seems that the BLDC is heating up and something on the controller board of the HDD is then operated outside its temperature range. So i get I/O errors on extensive usage.

I managed to rescue most of my data and put it on a brand new state of the art HDD. One day after rescuing the data the HDD died completely. R.I.P. :)

So with the new HDD all is working fine and as expected.
All the tips and hints had one good thing. I completely stripped down my Linux on the WL-HDD to the asblolute nescessary and have now a fast and slim OS running with no overhead...

Regards, Thorsten