Monday, March 23, 2009

HowTo: Fix SATA DMA timeout issues on FreeBSD

Update: added instructions for those using FreeBSD 8.x.

I've experienced heavy problems with a recently purchased 1TB SATA drive from Samsung on ICH7 motherboard running a fresh FreeBSD 7.1 install. The system was issuing loads of SATA timeout errors that culminated in system crashes, drive disconnection and data loss.

Here's a snip of my /var/log/messages:
kernel: ad4: WARNING - WRITE_DMA UDMA ICRC error (retrying request) LBA=26003999
kernel: ad4: WARNING - WRITE_DMA UDMA ICRC error (retrying request) LBA=56856991
kernel: ad4: WARNING - WRITE_DMA UDMA ICRC error (retrying request) LBA=57609503
kernel: ad4: TIMEOUT - READ_DMA retrying (1 retry left) LBA=174249023
kernel: ad4: TIMEOUT - READ_DMA retrying (1 retry left) LBA=190428031
kernel: ad4: WARNING - WRITE_DMA48 UDMA ICRC error (retrying request) LBA=1351930207
kernel: ad4: TIMEOUT - WRITE_DMA48 retrying (0 retries left) LBA=1351930207
Upon searching for solutions I came across Jeremy Chadwick's page on wiki.freebsd.org. Jeremy has been registering issues that are commonly reported by FreeBSD users and also published troubleshooting methods for ATA/SATA issues.

Jeremy informs that Volker Theile of the FreeNAS project had solved most of the problems by increasing a hard-coded arbitrary timeout value of 5 (seconds) in the ATA code to 10 or 15, while simultaneously making the timeout value adjustable via sysctl.
So I thought to myself "Might as well try the patch out and hope for the best". And I'm glad that I went along and tried it out as it fixed all of my issues.

Bellow are the needed steps to fetch the patch, apply it and compile a patched kernel:

  1. % fetch http://freenas.svn.sourceforge.net/viewvc/freenas/trunk/build/kernel-patches/ata/files/patch-ata.diff
  2. % su
  3. # csup -h cvsup2.uk.freebsd.org -L 2 /usr/share/examples/cvsup/standard-supfile
  4. # cd /usr/src/sys/dev
  5. # patch < /path/to/patch
  6. # cd /usr/src
  7. # make kernel
  8. # cp -Rp /boot/kernel.old /boot/kernel.SATA-ISSUES
  9. # reboot
Start by fetching the patch (step 1), next change to root and fetch FreeBSD's source code as detailed in step3.

Note: if you are running FreeBSD 8.x fetch the patch file using this URL instead http://www.avenard.org/files/ata_timeout.patch. Replace the step 1 URL with this one.

Next, with steps 4 and 5 patch the source code with FreeNAS' patch and build a patched kernel. Do notice that I used csup pointing to /usr/share/examples/cvsup/standard-supfile as I'm running FreeBSD 7.1 (of simply use your own supfile). Further information on how to build a kernel can be found at http://www.freebsd.org/handbook/kernelconfig.html.

As a safety precaution back up the old kernel as described in step 9.

Finally reboot to the new kernel and monitor /var/log/messages for SATA timeout issues. After I've applied the patch my problems have stopped.

Props to:
Jeremy Chadwick and Volker Theile for the FreeBSD 7.x patch.
Jean-Yves Avenard for providing the URL a FreeBSD 8.x patch.

68 comments:

  1. This looks just like the issue I'm having. Is there a place where I could get a the kernel file with the patch applied. I don't have a FreeBSD system (virtual or otherwise), so it would save me some time.

    Thanks

    ReplyDelete
  2. No need, just follow steps 1 to 4 to pull FreeBSD source code, fetch the patch and apply it.

    No magic involved ;)

    Best regards.

    ReplyDelete
  3. Wooot ... thanks. This (probably) solved the issue I was having. Still stress testing the FreeBSD 7.2 box, but it's been running smoothly for 2 days under normal load, whereas it used to spill out these errors after 5 minutes of no load at all :-)

    ReplyDelete
  4. Using a 1TB drive on a freenas box (using the 0.7-RC2 release) and having these problems. However I can't find the patch anymore... Has this been fixed downstream?

    ReplyDelete
  5. Hi Christian!

    AFAIK the problem isn't fixed in FreeBSD 7.x. On FreeNAS I don't know how the situation stands.

    The link seems to be down or the file was moved. But I have the patch if you want I can mail it to you.

    For reference here's Jeremy Chadwick page: http://wiki.freebsd.org/JeremyChadwick/ATA_issues_and_troubleshooting.

    Regards.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Ok.

    I've just sent the pacth within a gzip archive. Extract it and you'll get the patch.

    ReplyDelete
  8. Deleted my comment with my e-mail for obvious reasons ;)

    ReplyDelete
  9. This works. I did this myself in about 30 minutes. Constant DMA TIMEOUTS disappeared forever after having done this. Thank you for the post. Why won't the developers take a look at this? Are they looking for a better solution first? I am a linux admin trying to move to FreeBSD. I like it very much so far, but stuff like this is bad. It almost turned me away for good. It's the second machine on which I've had this problem. Not sure about the negative affects of this solution, but it has proven successful. Thanks again! T

    ReplyDelete
  10. In case you're having trouble grabbing the patch, I'm going to try to attach it here. This is for 7.0 (I applied this patch manually).



    --- ata/ata-all.c.orig 2009-04-15 03:14:26.000000000 +0000
    +++ ata/ata-all.c 2009-05-07 18:17:12.000000000 +0000
    @@ -75,6 +75,7 @@
    uma_zone_t ata_request_zone;
    uma_zone_t ata_composite_zone;
    int ata_wc = 1;
    +int ata_to = 5;
    int ata_dma_check_80pin = 1;

    /* local vars */
    @@ -96,6 +97,9 @@
    TUNABLE_INT("hw.ata.wc", &ata_wc);
    SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLAG_RDTUN, &ata_wc, 0,
    "ATA disk write caching");
    +TUNABLE_INT("hw.ata.to", &ata_to);
    +SYSCTL_INT(_hw_ata, OID_AUTO, to, CTLFLAG_RW, &ata_to, 0,
    + "ATA disk timeout vis-a-vis power-saving");

    /*
    * newbus device interface related functions
    --- ata/ata-all.h.orig 2009-04-15 03:14:26.000000000 +0000
    +++ ata/ata-all.h 2009-05-07 18:17:12.000000000 +0000
    @@ -524,6 +524,7 @@
    extern struct intr_config_hook *ata_delayed_attach;
    extern devclass_t ata_devclass;
    extern int ata_wc;
    +extern int ata_to;
    extern int ata_dma_check_80pin;

    /* public prototypes */
    --- ata/ata-disk.c.orig 2009-04-15 03:14:26.000000000 +0000
    +++ ata/ata-disk.c 2009-05-07 18:17:12.000000000 +0000
    @@ -259,7 +259,7 @@
    }
    request->flags = ATA_R_CONTROL;
    request->dev = dev;
    - request->timeout = 5;
    + request->timeout = ata_to;
    request->retries = 1;
    request->callback = ad_power_callback;
    request->u.ata.command = ATA_STANDBY_IMMEDIATE;
    @@ -293,7 +293,7 @@
    atadev->spindown_state = 0;
    request->timeout = 31;
    } else {
    - request->timeout = 5;
    + request->timeout = ata_to;
    }
    request->retries = 2;
    request->data = bp->bio_data;
    --- ata/ata-chipset.c.orig 2009-05-14 18:41:10.000000000 +0000
    +++ ata/ata-chipset.c 2009-05-14 18:38:26.000000000 +0000
    @@ -5508,6 +5506,7 @@
    { ATA_VIA8237A, 0x00, VIA133, 0x00, ATA_UDMA6, "8237A" },
    { ATA_VIA8237S, 0x00, VIA133, 0x00, ATA_UDMA6, "8237S" },
    { ATA_VIA8251, 0x00, VIA133, 0x00, ATA_UDMA6, "8251" },
    + { ATA_VIACX700M2,0x00, VIA133, 0x00, ATA_UDMA6, "CX700M2" },
    { 0, 0, 0, 0, 0, 0 }};
    static struct ata_chip_id new_ids[] =
    {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" },
    @@ -5516,6 +5515,7 @@
    { ATA_VIA8237A, 0x00, 7, 0x00, ATA_SA150, "8237A" },
    { ATA_VIA8237S, 0x00, 7, 0x00, ATA_SA150, "8237S" },
    { ATA_VIA8251, 0x00, 0, VIAAHCI, ATA_SA300, "8251" },
    + { ATA_VIACX700M2,0x00, 0, 0x00, ATA_SA300, "CX700M2" },
    { 0, 0, 0, 0, 0, 0 }};

    if (pci_get_devid(dev) == ATA_VIA82C571) {
    --- ata/ata-pci.h.orig 2009-05-14 18:41:01.000000000 +0000
    +++ ata/ata-pci.h 2009-05-14 18:37:03.000000000 +0000
    @@ -414,6 +414,7 @@
    #define ATA_VIA6410 0x31641106
    #define ATA_VIA6420 0x31491106
    #define ATA_VIA6421 0x32491106
    +#define ATA_VIACX700M2 0x53241106

    /* chipset setup related defines */
    #define AHCI 1

    ReplyDelete
  11. Hi Tony!

    Thanks for the feedback. Glad that the issue got fixed for you too.

    As for the PR there are several submitted some dating back since 2006.

    The funny thing is the problem got fixed by the FreeNAS guys however it wasn't incorporated into FreeBSD.

    Regards.

    ReplyDelete
  12. Thing is though, I have a secondary issue. This second issue is probably what caused the first issue (DMA TIMEOUTS) to begin with. My disks keep spinning down then up, every 20 seconds or so. I have no idea why this is happening, but it's not just one disk. I think that it was timing out because the disk goes to spin up and that takes too long. Any ideas here? I've used atacontrol and it's not configured to spindown. Thanks.

    ReplyDelete
  13. Haven't come across a similar issue.

    Maybe this thread at FreeBSD's forums help: http://forums.freebsd.org/showthread.php?t=1012&highlight=spindown.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Just mailed you the patch.

    Do notice that it was already pasted in the comments.

    Take care.

    ReplyDelete
  16. Ok I will admit this could be something I am doing wrong 1st ever kernel update.

    Hmm... Looks like a unified diff to me...
    The text leading up to this was:
    --------------------------
    |--- ata/ata-all.c.orig 2009-04-15 03:14:26.000000000 +0000
    |+++ ata/ata-all.c 2009-05-07 18:17:12.000000000 +0000
    --------------------------
    Patching file ata/ata-all.c using Plan A...
    patch: **** malformed patch at line 4: uma_zone_t ata_request_zone;


    Any help would be appreciated
    Regards
    Graeme

    ReplyDelete
  17. The procedure and patch work. I've applied on both FreeBSD 7.1 and 7.2 up to p3.

    Just stick with the procedure and check that your source code is clean.

    ReplyDelete
  18. If you want drop your email address and I'll send you the original patch.

    ReplyDelete
  19. And judging by your timestamp you aren't using the correct patch.

    ReplyDelete
  20. Hi Tangram

    arab@tangerine_army.co.uk

    change the _ to a -

    Regards

    Graeme

    ReplyDelete
  21. Ok. You got mail.

    If you run into any issues let me know :)

    ReplyDelete
  22. Hi Tangram

    Yep that seemed to work ok, just for your info the patch that gave me the inital problem was a copy n paste of the patch posted in a comment further up the forum. Building the kernel as I type so I will let you know if all goes well

    Regards

    Graeme

    ReplyDelete
  23. Hi there Graeme

    I suspected as much. I guess that the copy paste mangles things.

    When I have the time I'll upload or share the patch somewhere.

    Take care.

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. Hi Michael,

    Just sent you the patch.

    Regards.

    ReplyDelete
  26. 1st of all, thank you for a quick reaction and sending me the patch.

    The other thing is - it didn't help in my case, still having trouble accesing one of my sata disks :( :

    Nov 24 12:22:14 myso kernel: ata2: [ITHREAD]
    Nov 24 12:22:14 myso kernel: ad4: 238475MB [WDC WD2500SD-01KCB0 08.02D08] at ata2-master SATA150
    Nov 24 12:22:14 myso kernel: GEOM_STRIPE: Disk ad4 attached to ShareStripe0.
    Nov 24 12:22:14 myso kernel: GEOM_STRIPE: Device ShareStripe0 activated.
    Nov 24 12:24:43 myso kernel: GEOM_LABEL: Label ufsid/4a71ed8e00b5018e removed.
    Nov 24 13:16:49 myso kernel: interrupt storm detected on "irq21:"; throttling interrupt source
    Nov 24 13:16:53 myso last message repeated 4 times
    Nov 24 13:16:54 myso kernel: ad4: TIMEOUT - WRITE_DMA retrying (1 retry left) LBA=160
    Nov 24 13:16:54 myso kernel: interrupt storm detected on "irq21:"; throttling interrupt source
    Nov 24 13:16:58 myso last message repeated 4 times
    Nov 24 13:16:59 myso kernel: ad4: TIMEOUT - WRITE_DMA retrying (0 retries left) LBA=160
    Nov 24 13:16:59 myso kernel: interrupt storm detected on "irq21:"; throttling interrupt source
    Nov 24 13:17:03 myso last message repeated 4 times
    Nov 24 13:17:04 myso kernel: ad4: FAILURE - WRITE_DMA timed out LBA=160
    Nov 24 13:17:04 myso kernel: interrupt storm detected on "irq21:"; throttling interrupt source
    Nov 24 13:17:08 myso last message repeated 4 times
    Nov 24 13:17:09 myso kernel: ad4: TIMEOUT - READ_DMA retrying (1 retry left) LBA=191
    Nov 24 13:17:14 myso kernel: ad4: FAILURE - device detached
    Nov 24 13:17:14 myso kernel: GEOM_STRIPE: Disk ad4 removed from ShareStripe0.
    Nov 24 13:17:14 myso kernel: GEOM_STRIPE: Device ShareStripe0 removed.

    ReplyDelete
  27. I don't use GEOM so I can't help you there.

    Have a browse at the open problem reports, maybe there's something on GEOM related issues.

    ReplyDelete
  28. actually, it's not a geom issue, it happens even with geom turned off, everytime I access ad4 it begins to storm and ends with detaching the drive...

    I'm already doing the research ;) I was hoping this patch will fix it, but unfortunately it didn't :(

    ReplyDelete
  29. I'd very much like to have to patch as well. Copy paste the patch in the thread ends up with the same patch: **** malformed patch at line 4: uma_zone_t

    So if possible, please send to b4gg3r1 at gmail.com


    Many thanks! Janis

    ReplyDelete
  30. Hmm, fixed all of the leading spaces in the patch file I think (freebsd7.1 BW), but still get a lot of errors :-(

    patch < /root//patch-ata.diff
    Hmm... Looks like a unified diff to me...
    The text leading up to this was:
    --------------------------
    |--- ata/ata-all.c.orig 2009-04-15 03:14:26.000000000 +0000
    |+++ ata/ata-all.c 2009-05-07 18:17:12.000000000 +0000
    --------------------------
    Patching file ata/ata-all.c using Plan A...
    Hunk #1 succeeded at 75.
    Hunk #2 succeeded at 98 with fuzz 2 (offset 1 line).
    Hunk #3 failed at 525.
    1 out of 3 hunks failed--saving rejects to ata/ata-all.c.rej

    New at patching freebsd unfortunately, so please forgive my ignorance

    ReplyDelete
  31. Don't forget that you need to extract the patch from the archive that I've mailed you.

    Check out the source code again and re-apply the patch on the freshly downloaded source code.

    In other words: follow the how to from the start.

    ReplyDelete
  32. Thanks for the patch, installing went perfect, made the new kernel, but situation got worse :-( Before, I managed to mount the disk and it only produced errors under load, now it doesn't even get through the boot-fase; messages-file:

    ad6: 1430799MB SAMSUNG HD154UI 1AG01118 at ata3-master SATA150
    ad6: FAILURE - device detached

    It's an external USB/eSata drive. Works perfect with USB but performance is low 25MB/s write and 28MB/sec read. With eSata, my previous (but now dead 1TB disk) performance was 3 times better.

    ReplyDelete
  33. Sorry to hear that Janis.

    The patch is supposed to address ATA/SATA issues. Haven't used it on USB.

    You can easily revert the patch.

    Run csup an pull the source code. This will overwrite the patched source code. From there compile the kernel and reboot.

    Take care.

    ReplyDelete
  34. Hi Tangram,

    No, what I said is: the disk works fine via USB (but slow).
    I want it to work via eSata because that's much faster. It used to work with my 1TB disk, but that crashed. I have a 1.5TB now which refuses to work with eSata.

    So back to USB.
    Thanks for all the effort!

    ReplyDelete
  35. Hi Janis,

    Have a look to Jeremy Chadwick page on FreeBSD's wiki. Maybe there's something that can help your case.

    Best of luck ;)

    ReplyDelete
  36. Please could someone email me the patch?

    freebsdpatch[AT]worldwide.me.uk

    Thanks!

    ReplyDelete
  37. Could someone please send me a copy of this patch?

    jackpenno[AT]yahoo.com.au

    ReplyDelete
  38. After someone sent me the patch i thought i might post some links.

    Peace

    http://www.mediafire.com/file/ymwuhyn5zmz/patch-ata.diff.gz

    http://hotfile.com/dl/23391435/9db129b/patch-ata.diff.gz.html

    ReplyDelete
  39. Hi Jack.

    It was me that sent you the patch. Thanks for hosting the file.

    Do give feedback if it worked out for you.

    Regards.

    ReplyDelete
  40. Thanks man, wasn't sure if you wanted me to disclose your name. I'm pretty lost trying to apply this patch. I'm not really a FreeBSD person, just a FreeNAS user. Is there any way to patch/compile the kernel from windows?

    ReplyDelete
  41. I think this patch is already part of FreeNAS. After all it was created by Volker Theile of the FreeNAS project.

    If you want to access FreeNAS, FreeBSD or any other Unix like system the easiest way is using SSH. To that end you need to enable it under the Unix like system (read FreeNAS manual on where to enable the service) and use a Windows SSH client such as PuTTY.

    That's pretty much outside the scope of this post, but you can find tons of online articles on this subject.

    Take care.

    ReplyDelete
  42. All of the original post is directed only to FreeBSD, namely 7.1 and 7.2 (haven't migrated to 8.0 so not sure if it's applicable or not).

    The patch is applied to affect operating system source code and then compiled. FreeBSD ships with the source code and can be installed using sysinstall or fetched using csup.

    To my knowledge FreeNAS doesn't ship with it source code nor there's an easy way to access it.

    ReplyDelete
  43. Is this ever going to be fixed? or can someone post how to install the patch without using fetch.

    ReplyDelete
  44. I'm not following you with regards to fetch. What's the problem with using fetch? You can of course download the using other tool such as wget. The thing is fetch is part of the base system while for instance wget is a third party application that needs to be installed.

    ReplyDelete
  45. The same issue occurs at regular interval (about once a day) with FreeBSD 8.0

    This is part of the ZFS RAID array, and every day zfs reports errors which have to be cleared with zpool clear..

    here is the patch for 8.0
    Index: ata/ata-all.c
    ===================================================================
    --- ata.orig/ata-all.c 2009-12-09 14:57:06.000000000 +1100
    +++ ata/ata-all.c 2010-02-26 11:34:04.000000000 +1100
    @@ -76,6 +76,7 @@
    uma_zone_t ata_composite_zone;
    int ata_wc = 1;
    int ata_setmax = 0;
    +int ata_to = ATA_REQUEST_TIMEOUT;
    int ata_dma_check_80pin = 1;

    /* local vars */
    @@ -100,6 +101,9 @@
    TUNABLE_INT("hw.ata.setmax", &ata_setmax);
    SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, &ata_setmax, 0,
    "ATA disk set max native address");
    +TUNABLE_INT("hw.ata.to", &ata_to);
    +SYSCTL_INT(_hw_ata, OID_AUTO, to, CTLFLAG_RW, &ata_to, 0,
    + "ATA disk timeout vis-a-vis power-saving");

    /*
    * newbus device interface related functions
    Index: ata/ata-all.h
    ===================================================================
    --- ata.orig/ata-all.h 2009-12-09 14:57:06.000000000 +1100
    +++ ata/ata-all.h 2010-02-26 11:37:54.000000000 +1100
    @@ -582,6 +582,7 @@
    extern devclass_t ata_devclass;
    extern int ata_wc;
    extern int ata_setmax;
    +extern int ata_to;
    extern int ata_dma_check_80pin;

    /* public prototypes */
    Index: ata/ata-disk.c
    ===================================================================
    --- ata.orig/ata-disk.c 2009-12-09 14:57:06.000000000 +1100
    +++ ata/ata-disk.c 2010-02-26 11:37:40.000000000 +1100
    @@ -230,7 +230,7 @@
    }
    request->dev = dev;
    request->flags = ATA_R_CONTROL;
    - request->timeout = ATA_REQUEST_TIMEOUT;
    + request->timeout = ata_to;
    request->retries = 1;
    request->callback = ad_power_callback;
    request->u.ata.command = ATA_STANDBY_IMMEDIATE;
    @@ -262,10 +262,10 @@
    if (atadev->spindown_state) {
    device_printf(dev, "request while spun down, starting.\n");
    atadev->spindown_state = 0;
    - request->timeout = MAX(ATA_REQUEST_TIMEOUT, 31);
    + request->timeout = MAX(ata_to, 31);
    }
    else {
    - request->timeout = ATA_REQUEST_TIMEOUT;
    + request->timeout = ata_to;
    }
    request->retries = 2;
    request->data = bp->bio_data;

    ReplyDelete
  46. Can someone explain this to me in plain english? Sorry, real noob here. Been getting this problem and I assume that my com is idle now trying to fix my problem.

    How do I apply the patch in Freenas interface? Like where do I click etc... I've built a freenas system and plan to do a raid 5 but have been hitting obstacles after obstacles...

    Hope this will be the last 1... Please help. Thanks in advance

    ReplyDelete
  47. I'm getting the same error as you guys when I check my log which is.

    kernel: ad1: TIMEOUT - READ_DMA retrying (1 retry left) LBA=21219968

    Over and over again... just to clarify.

    ReplyDelete
  48. Have you read the HowTo? If so read it again.

    It's meant for FreeBSD, namely 7.x.

    The patch was fetched from FreeNAS so I assume that the problem has been fixed in the latter version of FreeNAS. You can query FreeNAS developers on the subject.

    To sum up, please read the entire post again.

    ReplyDelete
  49. Have you read the HowTo? If so read it again.

    It's meant for FreeBSD, namely 7.x.

    The patch was fetched from FreeNAS so I assume that the problem has been fixed in the latter version of FreeNAS. You can query FreeNAS developers on the subject.

    To sum up, please read the entire post again.

    ReplyDelete
  50. Just thought I'd share what I'm doing. I've built a Freenas box and initially put in a 1.5TB HD and mounted it.

    Soon after, I'm already close to filling it up so I got myself another 5 x 1.5TB HDs and planned to SoftRaid 5 them.

    I'm running Freenas on a 1.8 Celeron with 1GB ram and have used a via sata controller to add in the other 2 SATA HDs as the motherboard only has 4 SATA inputs.

    While trying to build this I kept getting IPTOS_LOWDELAY error, so I got the latest Freenas release and now I'm plagued with kernel: ad1: TIMEOUT - READ_DMA retrying issue. Please help as I've been trying to resolve this issue for over a week now.

    Thanks Heaps.

    ReplyDelete
  51. Hi Tangram, thanks for the swift reply. I know its for FreeBSD but thought that since its running on the same platform that it can be applied to Freenas...

    I have read the How TO but as I've said... I don't understand the language ha ha... yeah... No background on FreeBSD whatsoever... that's why I was hoping you could guide me through the Freenas WebGUI...

    WOuld really appreciate it as I've googled for this problem and couldn't find a solution anywhere except here... Just people complaining about the same problem...

    ReplyDelete
  52. Hi there,

    FreeNAS is essentially a very customized and cut down version of FreeBSD. Non-essential things for its use (file serving) were taken out.

    This means that you won't be able to rebuild your kernel out-of-the-box much less using a web GUI.

    Plus the issue your having maybe related with something else from your set-up.

    You could try to narrow down the problem. For example disabling the SATA controller, seeing if the problem is in the RAID array, and so on.

    Try getting help from FreeNAS mailing list or forum (I assume they have something like that).

    Best of luck.

    ReplyDelete
  53. Thanks Tangram, should have done that first. Was just googling for the problems I was having when I should have just went to the Freenas Forums...

    Thanks

    ReplyDelete
  54. Do reply back back if your find a solution or workaround for your problem.

    Cheers mate ;)

    ReplyDelete
  55. LoL, found the solution and feeling a little embarrassed by it. Good thing I got a GURU in the forums to look at it.

    It was just the power supply and my disk was spinning down cos the power wasn't sufficient to run 6 HDs and 9 fans for cooling ha ha ha.

    Cheers

    ReplyDelete
  56. Just so people know: my timeout issues ended with FreeBSD 7.3.

    Upon reading http://www.freebsd.org/releases/7.3R/relnotes-detailed.html I suspected as much, and upon compiling FreeBSD 7.3-RELEASE all was fine. 24 hours latter I haven't found a single error message and the server is just fine.

    I just the next step would be to look up at the diff between each release and see what was pacthed ;)

    ReplyDelete
  57. Hi,

    I'm experiencing similar issues on FreeBSD 8.1 RELEASE.

    Is there a similar patch for 8.1 available?

    thanks,
    Blacky

    ReplyDelete
  58. The patch I posted above for FreeBSD 8.0 will apply fine with 8.1

    It works for me with the following settings in /boot/loader.conf
    hw.ata.to=15

    ReplyDelete
  59. Could someone upload somewhere this patch, please? When I'm trying to apply patch copied from here i get: "Patching file ata/ata-all.c using Plan A...
    patch: **** malformed patch at line 6: int ata_wc = 1;
    "

    ReplyDelete
  60. I'm still running FreeBSD 7.x so can't help.

    However according to Jean-Yves Avenard his patch code works. Probably formating issues?

    ReplyDelete
  61. It is a formatting issue.
    Original patch can be found here:
    http://www.avenard.org/files/ata_timeout.patch

    ReplyDelete
  62. I've updated the post with the FreeBSD 8.x patch.

    ReplyDelete
  63. Hello thanks fo help
    I try the commande csup but: "command not found"

    please help

    I've freenas 7.3

    ReplyDelete
  64. Just for information: while this hasn't been fixed as elegantly as in the patch FreeBSD does incorporate since 8-STABLE r199158 a solution for the problem: ATA_REQUEST_TIMEOUT kernel option that be be set higher than the default 5.
    What is needed is adding "options ATA_REQUEST_TIMEOUT=X" (where X is timeout in seconds) into the kernel configuration file.
    Changing the timeout will need rebuilding and installing the kernel, but it's still better than nothing.

    ReplyDelete
  65. Hello,
    Please send me the patch for FreeBSD 7.2 to cristimiu@yahoo.com!
    The links on mediafire and hotfile are outdated.
    Many thanks in advance,

    ReplyDelete
  66. Is this patch deprecated/obsolete? I'm applying it to 8.4 sources and a GENERIC kernel and I see this.

    MAKE=make sh /usr/src/sys/conf/newvers.sh GENERIC
    /usr/local/bin/svnversion
    cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror vers.c
    linking kernel.debug
    ata-disk.o(.text+0x59b): In function `ad_spindown':
    /usr/src/sys/dev/ata/ata-disk.c:238: undefined reference to `ata_to'
    ata-disk.o(.text+0x739): In function `ad_strategy':
    /usr/src/sys/dev/ata/ata-disk.c:270: undefined reference to `ata_to'
    ata-disk.o(.text+0x751):/usr/src/sys/dev/ata/ata-disk.c:273: undefined reference to `ata_to'
    *** Error code 1

    The patch applied cleanly so I assume those changes were not already in the tree.

    ReplyDelete
  67. @ a progressive crank

    I have no idea. The last time I applied the patch was in 7.4 since then the machine I had running FreeBSD died.

    ReplyDelete