site  contact  subhomenews

Another fix for drive read speed test

January 04, 2026 — BarryK

In Easy 7.1.2, the code in the initrd to test drive read speed was changed:

Forum member pp4mnlinux reported that the 'dd' utility was failing to read the drive:

https://forum.puppylinux.com/viewtopic.php?p=162832#p162832

It seems that, although Linux kernel has recognised /dev/sda, and 'blkid' was able to read it's parameters, it was still not ready to be read from. So, I will change the code to a loop, like this:

#20260103 dd fail, ref: https://forum.puppylinux.com/viewtopic.php?p=162700#p162700
for A in 1 2 3 4
do
sleep 1
echo 3 > /proc/sys/vm/drop_caches
TIMEs="$(dd if=/dev/${WKG_DRV} of=/dev/null bs=1M count=118 2>&1 | grep -o '[0-9.]* [second]*s,' | cut -f 1 -d ' ')"
[ -z "$TIMEs" ] && continue
TIME10k=$(dc -e"${TIMEs} 100 * p" | cut -f 1 -d '.')
[ $TIME10k -ne 0 ] && break
done
[ -z "$TIMEs" ] && TIME10k=500

But I'm concerned that the problem is deeper than that. pp4mnlinux has already tried changing the 'sleep 0.1" to "sleep 2" before the 'dd' line, and got the same error. Two seconds should have been enough delay! I think something else is amiss.

I did some reading, and 'dd' may fail if it encounters bad blocks. The recommendation is to use "conv=noerror". OK, will try that. Then maybe don't need that loop.

EDIT 2026-01-05:
Have settled on this:

#20260204 conv=noerror dd will keep going when encounter bad blocks...
sleep 0.5
TIMEs="$(dd if=/dev/${WKG_DRV} of=/dev/null bs=1M count=118 conv=noerror 2>&1 | grep -o '[0-9.]* [second]*s,' | cut -f 1 -d ' ')"
if [ -z "$TIMEs" ];then
TIME10k=500
else
TIME10k=$(dc -e"${TIMEs} 100 * p" | cut -f 1 -d '.')
fi

Looks good. 

Tags: easy