sata NCQ errors (Re: [Nottingham] Missing CF drive with libata...)

Martin martin at ml1.co.uk
Sat May 24 23:48:01 BST 2008


Debugging my own code:

Martin wrote:
[---]
>> OK, so to change NCQ to be effectively disabled, you can use:
[---]
> You can add:
> 
> 
> for s in /sys/block/sd*
> do
>         s="$s/device/queue_depth"
>         [ -e "$s" ] && echo 1 >"$s"
> done
> 
> 
> onto the end of "/etc/rc.d/rc.local" to disable NCQ for all your sata
> (and any other sd*) drives.

An external USB HDD I've just tested doesn't have the queue_depth
writable, so, the updated code is:


for s in /sys/block/sd*
do
        s="$s/device/queue_depth"
        [ -e "$s" ] && [ -w "$s" ] && echo 1 >"$s"
done


Note the extra 'writable' test first.

An alternative is to just try writing out the "1" regardless and to
ignore the errors. However, I consider that to be dangerously sloppy...
When would you know if it really has failed (for some other reason or
problem) where you wanted it to succeed?...



And:

>> Is there a better way of setting this for boot rather than doing the
>> hack of adding that line onto the end of "/etc/rc.d/rc.local" (or
>> whatever other startup script)?
> 
> Anyone?
> 
> That fix is a fix that is made a long way after the boot process starts...


Good luck,
Martin

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list