How to increase discs timeout?

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

Post Reply
msdobrescu
Old Dear Hen
Posts: 890
Joined: Sun Aug 21, 2011 8:48

How to increase discs timeout?

Post by msdobrescu » Fri Aug 07, 2020 17:42

Hello,

I have an old USB to SATA multiplier and I have attached large discs to it.
I can't copy on them for a long time, looks like sometimes the write operation takes longer.
I am not really sure.
I'd like to check that and increase the timeout on the discs.
How could I do that?

Thanks you.

msdobrescu
Old Dear Hen
Posts: 890
Joined: Sun Aug 21, 2011 8:48

Re: How to increase discs timeout?

Post by msdobrescu » Sat Aug 08, 2020 5:06

Here is my temporary solution, until the disk is ejected or the computer restarted:

Code: Select all

echo 180 > /sys/block/sdf/deviceMM/timeout
Above, the disk is sdf, but will be used the needed one.

And checked (although the naming differs:

Code: Select all

find /sys/class/scsi_generic/*/device/timeout -exec grep -H . '{}' \;

/sys/class/scsi_generic/sg0/device/timeout:30
/sys/class/scsi_generic/sg10/device/timeout:30
/sys/class/scsi_generic/sg1/device/timeout:30
/sys/class/scsi_generic/sg2/device/timeout:30
/sys/class/scsi_generic/sg3/device/timeout:30
/sys/class/scsi_generic/sg4/device/timeout:30
/sys/class/scsi_generic/sg5/device/timeout:30
/sys/class/scsi_generic/sg6/device/timeout:180
/sys/class/scsi_generic/sg7/device/timeout:30
/sys/class/scsi_generic/sg8/device/timeout:30
/sys/class/scsi_generic/sg9/device/timeout:30
This is inspired by this post on StackExchange.

The problem is related to using large drives (SATA III 6TB) on an old controller (supporting LBA48) supporting SATA II only. I don't really know the source of the problem, but would be really useful to be able to persist the timeout for certain drives. There are udev solutions over the Internet, but it seems udev is not used on Sabayon.

User avatar
sabayonino
Sagely Hen
Posts: 3569
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: How to increase discs timeout?

Post by sabayonino » Sat Aug 08, 2020 10:20

look at "sdparm" disk utility.

Code: Select all

  @@ Searching...
╠      @@ Package: sys-apps/sdparm-1.10 branch: 5, [sabayon-weekly] 
╠          Available:     version: 1.10 ~ tag: NoTag ~ revision: 0
╠          Installed:     version: 1.10 ~ tag: NoTag ~ revision: 0
╠          Slot:          0
╠          Homepage:      http://sg.danny.cz/sg/sdparm.html 
╠          Description:   Utility to output and modify parameters 
╠                         on a SCSI device, like hdparm 
╠          License:       BSD
╠   Keywords:  sdparm
╠   Found:     1 entry
and read this : https://lists.debian.org/debian-user/20 ... 00125.html

It could help you

Your problem could be related to the cache read/write performance + USB controller performance

The system r/w progress utility can show the fully r/w operations are completed but the deviece still r/w so you can't umount or remove the device(s)

msdobrescu
Old Dear Hen
Posts: 890
Joined: Sun Aug 21, 2011 8:48

Re: How to increase discs timeout?

Post by msdobrescu » Sat Aug 08, 2020 20:59

Hi, thanks, it is interesting, but that link is referring to spin down or power down. It's a good resource for the ones needing the power down or spin down.
I think my problem is quite opposite. The card I have, Lycom UB-208M, despite discontinued, has a firmnware that prevents the spin down/sleep in case of inactivity. It was my request to them, so, graciously, Lycom support offered me the firmware I've needed.

Now, my problem is really related to the cache and controller performance. So, copying files, breaks the transfer at some point, sometimes soon, after 20GB, sometimes later, after 200GB. I've tested with the same files and got strange results. Also, copying from a drive connected to that card, didn't finish. It ended in a true crash that needed to check the target disk (that was not on that controller).

I've searched and read many articles, but seems that running those commands above helps.
Unfortunately, I can't persist that, as I don't know how to identify the disks, they being assigned dynamically due to the pluggable nature of the setup.
I've increased the timeout progressively, by 30, 180 being the smallest that worked so far for about 1.2TB data transfer at once, regardless it's written or read. I see that the more is transferred, the bigger the timeout must be. The transfer rate is proportional to the timeout set, so the bigger the timeout is, the slower it goes.

Post Reply