Page 1 of 1

Samba/CIFS hangs during file transfer

Posted: 12 Oct 2015 13:42
by RobertoBenzi
Hello there

While setting up my Nas4Free Box 10.2 x86 latest rev atm (Asus P5SMX-SE Mobo, 1.g Ghz Celeron CPU, 2 GB Ram, Embedded install without swap on a 1GB USB Flash drive) the file transfer hangs while transfering a folder with a big number of little files from a 3.0 USB Hard Drive to a JBOD UFS composed of 2 drives.

Once the file transfert hangs it doesn't even work stopping the file transfer and usually if I try to stop it by killing the windows acitivity the next time I try to copy and rewrite the same file the transfer always stays at 0, then the number of file decreases untill it hangs again.

In the attachments there's the screenshot of my CIFS settings

Re: Samba/CIFS hangs during file transfer

Posted: 12 Oct 2015 15:58
by noclaf
Try turning off asynchronous I/O. It caused a huge transfer penalty on my system. There is no error in the log?

Re: Samba/CIFS hangs during file transfer

Posted: 13 Oct 2015 20:42
by RobertoBenzi
Seems like the problem was not related to Nas4Free, cause I've had the same issue while transferring from external hard drive to my computer hard drive. Btw I'm having issues connecting to the NAS while disabling guest open access, should I create a new thread or rename this and go on there?

Tnx by the way

Re: Samba/CIFS hangs during file transfer

Posted: 15 Oct 2015 08:23
by noclaf
We may try here. :-) If we can't solve you can start new thread.

Re: Samba/CIFS hangs during file transfer

Posted: 15 Oct 2015 17:01
by RobertoBenzi
While transferring different files the problem presented once more.

It seems like the file transfer hangs while it finds a file that just exists, the classic windows asking if I wanna merge the same folders still comes out, but then, when should pop out the window asking me if I wanna replace a file, keep the old one, or rename, it just hangs, like it's endlessly copying (I've been waiting for a good 20 mins for a jpg file), and it hangs as soon as I try to stop the file transfer, what could this be about?

I also suspect that it is having some kind of difficulties managing various kind of links created in windows, the most obvious were the .lnk, that I deleted and replaced with a .txt as a reminder that I'll have to recreate the link directly in the NAS, but what about hard link and junctions? Is there any known issue?

The share I'm trying to copy stuff on is a RAID1 composed of 2x500GB Sata HDD, attached to a PCI Raid Controller from Nilox (NM-G02), and while I try to work with the hard drive (even via WebGUI) I get the following errors in the display attached to the NAS:

Code: Select all

(ada5:ata5:0:0:0): READ_DMA48. ACB 25 00 f8 75 a0 40 32 00 00 00 08 00
(ada5:ata5:0:0:0): CAM status: ATA Status Error
(ada5:ata5:0:0:0): ATA status: 51 (DRDY SERV ERR), error: 04 (ABRT)
(ada5:ata5:0:0:0): RES: 51 04 ff 75 a0 32 32 00 00 00 00
(ada5:ata5:0:0:0): Retrying command
(ada5:ata5:0:0:0): READ_DMA48. ACB: 25 00 80 a6 e6 40 34 00 00 00 40 00
(ada5:ata5:0:0:0): CAM status: Command timeout
(ada5:ata5:0:0:0): Retying command 
What is this about? Is it somehow related? Should I worry about my data get uncorrectly transfered and/or corrupted?

Re: Samba/CIFS hangs during file transfer

Posted: 15 Oct 2015 18:31
by ChriZathens
Can timeouts may be due to bad cabling, bad disk or unsupported controller.
Post smart status of ada5

Re: Samba/CIFS hangs during file transfer

Posted: 16 Oct 2015 10:09
by RobertoBenzi
Here should be it.

Code: Select all

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever
					been run.
Total time to complete Offline
data collection: 		(13200) seconds.
Offline data collection
capabilities: 			 (0x51) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					No Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 154) minutes.
SCT capabilities: 	       (0x303f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1512
  3 Spin_Up_Time            0x0027   186   180   021    Pre-fail  Always       -       1700
  4 Start_Stop_Count        0x0032   094   094   000    Old_age   Always       -       6384
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002f   200   200   051    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   090   090   000    Old_age   Always       -       7880
 10 Spin_Retry_Count        0x0033   100   100   051    Pre-fail  Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   094   094   000    Old_age   Always       -       6259
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0033   100   100   097    Pre-fail  Always       -       0
187 Reported_Uncorrect      0x0032   100   072   000    Old_age   Always       -       28
188 Command_Timeout         0x0032   087   001   000    Old_age   Always       -       780
190 Airflow_Temperature_Cel 0x0022   077   039   040    Old_age   Always   In_the_past 23
191 G-Sense_Error_Rate      0x0032   083   083   000    Old_age   Always       -       17
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       425
193 Load_Cycle_Count        0x0032   195   195   000    Old_age   Always       -       16730
194 Temperature_Celsius     0x0022   124   086   000    Old_age   Always       -       23
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       14
200 Multi_Zone_Error_Rate   0x0009   100   253   051    Pre-fail  Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay
By the way before adding this (and every) disk to the NAS I checked it with Crystal Disk Info (it's easy to use and read, and I'm not a big espert) on another computer and it told me it was ok, in case that could be of some help troubleshooting

Re: Samba/CIFS hangs during file transfer

Posted: 16 Oct 2015 10:30
by ChriZathens
I am not a S.M.A.R.T. expert, but the above are not great...

Code: Select all

187 Reported_Uncorrect      0x0032   100   072   000    Old_age   Always       -       28
188 Command_Timeout         0x0032   087   001   000    Old_age   Always       -       780
Also take a look at this:

Code: Select all

UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       14
This is an indication of bad cable. Change the cable and check if things improved. In fact all your problems may be caused by a bad cable.

Re: Samba/CIFS hangs during file transfer

Posted: 17 Oct 2015 12:48
by RobertoBenzi
I've tried swapping cable between ata5 and ata4 and that's ATA5 SMART (Do I need to refresh somehow the SMART log or it does automatically?)

Code: Select all

== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever
					been run.
Total time to complete Offline
data collection: 		(13200) seconds.
Offline data collection
capabilities: 			 (0x51) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					No Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 154) minutes.
SCT capabilities: 	       (0x303f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1512
  3 Spin_Up_Time            0x0027   184   180   021    Pre-fail  Always       -       1758
  4 Start_Stop_Count        0x0032   094   094   000    Old_age   Always       -       6386
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002f   200   200   051    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   090   090   000    Old_age   Always       -       7885
 10 Spin_Retry_Count        0x0033   100   100   051    Pre-fail  Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   094   094   000    Old_age   Always       -       6261
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0033   100   100   097    Pre-fail  Always       -       0
187 Reported_Uncorrect      0x0032   100   072   000    Old_age   Always       -       28
188 Command_Timeout         0x0032   087   001   000    Old_age   Always       -       780
190 Airflow_Temperature_Cel 0x0022   075   039   040    Old_age   Always   In_the_past 25
191 G-Sense_Error_Rate      0x0032   083   083   000    Old_age   Always       -       17
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       426
193 Load_Cycle_Count        0x0032   195   195   000    Old_age   Always       -       16737
194 Temperature_Celsius     0x0022   122   086   000    Old_age   Always       -       25
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       14
200 Multi_Zone_Error_Rate   0x0009   100   253   051    Pre-fail  Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
By the way How can I troubleshoot between cable, disk and controller issues?
To make sure the problem is not the BSD controller support I was thinking about installing windows on a different HDD and check all the disk with CrystalDiskInfo, but it seems to me quite a radical solution, isn't there a less convoluted and time consuming way?
May this be related to AHCI being turned on, or with APIC/ACPI?

Re: Samba/CIFS hangs during file transfer

Posted: 17 Oct 2015 13:42
by b0ssman
no the count will not reset.

also your drive at some stage in the past got way to hot and failed the Airflow_Temperature_Cel

please read
https://www.backblaze.com/blog/hard-drive-smart-stats/

From experience, we have found the following 5 SMART metrics indicate impending disk drive failure:

SMART 5 – Reallocated_Sector_Count.
SMART 187 – Reported_Uncorrectable_Errors.
SMART 188 – Command_Timeout.
SMART 197 – Current_Pending_Sector_Count.
SMART 198 – Offline_Uncorrectable.

Re: Samba/CIFS hangs during file transfer

Posted: 17 Oct 2015 14:12
by RobertoBenzi
So, if I'm getting it right, aside from Command_Timeout and Reported Uncorrectable Errors others parameters sounds fine.
Also, Command Timeout and Reported Uncorrectable errors are about past events (how did you get from it that the cause was getting hot? It sound real cool to be able to understand how it happened!), so now I should keep an eye and see if those counters go higher or stay stable, and if it increase, start thinking about replacing it, am I gettin' it right?

What about the AHCI and ACPI stuff, may those be the one causing the high UDMA_CRC_Error_Count? May that be a FreeBSD unsupported controller to cause that or is that definitely a bad cable?

May that be some wrong setting in the RAID setup the cause?

Lastly, in order to understand if a cable is bad and troubleshoot which one are good and which one are not
199 UDMA_CRC_Error_Count is dinamyc or additive? I mean, if I switch cable to state that the cable is good I should check for the value not to increase or to come back to 0 (or lessen btw)?

Re: Samba/CIFS hangs during file transfer

Posted: 17 Oct 2015 17:56
by ChriZathens
The easier thing to do is change the cable and notice how things go after that.
If the cable was the problem, numbers should not increase.

Re: Samba/CIFS hangs during file transfer

Posted: 17 Oct 2015 19:43
by RobertoBenzi
Well, I used another cable, cause I swapped ata4 and ata5 cables, ata 5 still gave me the error the first time I start an operation with the drive (both from CIFS/SMB and the file manager integrated in WEBGui

Code: Select all

(ada5:ata5:0:0:0): READ_DMA48. ACB 25 00 80 67 ed 40 32 00 00 00 40 00
(ada5:ata5:0:0:0): CAM status: command timeout
(ada5:ata5:0:0:0): Retrying command
Would be a safe guess that is not the cable?
Is there a chance it's a misconfigured RAID or some other kind of software error or is definetly the disk going to graveyard?
Lastly, is there a chance this is related to the CIFS/SMB problem I'm having even if this disk is in a RAID1?

Re: Samba/CIFS hangs during file transfer

Posted: 17 Oct 2015 21:35
by ChriZathens
We cannot be 100% sure it is the drive ( in any case, with 28 uncorrectable sectors it is not at its best....)
You can also try a different power connection to the drive to eliminate the possibility of bad power and also a smart long test to see the results.
The final test would be to insert the drive to a different port. If it still throws errors, then it must be the drive.
Unfortunately it is not exact science.. We must follow the process of elimination.

Re: Samba/CIFS hangs during file transfer

Posted: 18 Oct 2015 00:02
by b0ssman
Another cable will not fix the drive.
The temperature failure was in the past and exceeded the allowed temperature for the drive. This could have caused permanent damage to the drive and might be the cause of the command timeouts.
At this point I would claysify the drive as unusable.

Gesendet von meinem D5803 mit Tapatalk

Re: Samba/CIFS hangs during file transfer

Posted: 18 Oct 2015 11:52
by RobertoBenzi
A line during the boot process, from both the RAID1 disks, caught my attention.

Code: Select all

The secondary GTP header is not in the last LBA
May this be related to the problem?

By the way I tested switching ATA4 and ATA5 Power Cable, it doesn't seems to affect the problem. Maybe making it even worst cause after I did that, while I was accessing the disk I had a system crash and it doesn't seem able to reboot properly

Then I'm gonna format both drive and try not building the RAID, do the smart test and see if the initial problem (hanging during file transferts) still affect both, in order to know if ata5 is the source of the problem or just a coincident one.

Re: Samba/CIFS hangs during file transfer

Posted: 18 Oct 2015 12:12
by daoyama
RobertoBenzi wrote:A line during the boot process, from both the RAID1 disks, caught my attention.

Code: Select all

The secondary GTP header is not in the last LBA
May this be related to the problem?
No, this is chicken-and-egg problem. You cannot solve it.
All users get this message both shutdown and boot anyway.

Each physical disk before loading RAID driver:
|GPT|data|GPT secondary|RAID info|

After loading, create logical volume:
|GPT|data|GPT secondary|

Re: Samba/CIFS hangs during file transfer

Posted: 18 Oct 2015 16:08
by ChriZathens
If you perform a format, make sure that you connect this disk to a different sata port this time.
The number will most probably change if you do that, (e.g. it will be ada6 now) so if on a different sata port the same disk keeps causing problem, then get rid of it.

Re: Samba/CIFS hangs during file transfer

Posted: 19 Oct 2015 12:42
by RobertoBenzi
I reworked the disposal and composition of the RAID and now it seems to work, although performances weren't atonishing during upload (about 19MB/s with a direct Gigabit connection). While above HDD failure seems related to the problem also Windows difficulties in handling the copy of broken symlinks were involved.
I am trying to make sure that every file got loaded, is there a cleaner way to do that other then double check source and destination with folder proprieties within windows? (this process for sata shares seems very slow, doing on the hard drive side takes seconds, collecting file and folder number and dimensions is taking several minutes, although slowly progressing, is that normal?)

Re: Samba/CIFS hangs during file transfer

Posted: 19 Oct 2015 14:19
by noclaf
Have you played a bit with SAMBA settings? Juggling with few number and checkboxes get me from ~25MB/s to ~70MB/s

Re: Samba/CIFS hangs during file transfer

Posted: 19 Oct 2015 15:01
by RobertoBenzi
Well I haven't checked yet any guide/tutorial about tuning samba performances, at the moment my concern is more about the drives and shares being functional and not having any hidden misfunction.

Re: Samba/CIFS hangs during file transfer

Posted: 19 Oct 2015 18:03
by ChriZathens
RobertoBenzi wrote: I am trying to make sure that every file got loaded, is there a cleaner way to do that other then double check source and destination with folder proprieties within windows? (this process for sata shares seems very slow, doing on the hard drive side takes seconds, collecting file and folder number and dimensions is taking several minutes, although slowly progressing, is that normal?)
Disable Store Dos Attributes in samba settings.

Re: Samba/CIFS hangs during file transfer

Posted: 24 Oct 2015 19:27
by Faucon_2001
I got a similar issue while upgrading from 9.2 to 10.2
It appears that NAS4free configuration file from 9.2 that I reuse didn't get on well with 10.2. Quite strange as I have not read about any incompatibility.
I had to reset NAS4Free 10.2 to factory configuration and reddo my setup manually.
Now it no longer hangs up during file transfer, nor with the GUI browser nor with CIFS