Slow dd speeds

Hi
Bit of background:
I have a pi 3 running latest beta of Leia, on stretch.
I also have a pi 2 running latest release Raspbian stretch.
Both Pis both boot from identical 16 GB USB3 sticks, and are powered by iPad 2.5amp PSUs.

The problem, I’ve adapted a script which will backup the pis on the fly, one command used in the script is DD, to create a zero filled image of the appropriate size to the users home directory.

On the Pi2 running Raspbian the DD command averages about 12-15MB/s, around what id expect.
On the Pi3 running OSMC the DD command is noticeably slower, around 1.5-3MB/s, it seems to take forever.

I stop Kodi while running the script, and any other services that could be slowing things down but it makes no difference.

Is there anything obvious that could be causing this difference in speed that I’ve overlooked?..if anything id presume the Pi3 would be a little bit quicker if anything.

First thing to note is that an iPad PSU is inappropriate for Pi.

Try stopping Kodi then running the test

Ive tested it on another 2.5A psu and it made no difference Sam, out of interest whats wrong with the iPad ones?
Im not disputing it I’m just interested, as I thought they were ok.

You can learn more on our Wiki here: Frequently Asked Questions - Raspberry Pi - OSMC

iPad chargers don’t really provide 2.5A or anything near it. They have big drops.

Fair enough, I’ve got a 5A one somewhere in my garage that I’ll dig out tomorrow and see if that makes a difference.
I know its overkill for a Pi but at least i’ll be able to rule out power altogether if that one displays the same behaviour.

I assume you are doing something like:

dd if=/dev/zero of=/mount/usbstick bs=1M count=xxx

It seems to me that you will wear out the USB stick by doing this :wink: A spinning drive would probably be better.

You’re not wrong, but tbh I’ll only run the script about once per month so I doubt it’ll wear the usb that much.

Also I got a load of these sticks really cheap so I’m not really that concerned.

Yea, if it’s only monthly or so, that’s probably OK.

Odd.

Could you upload the output of the following commands to paste.osmc.tv please?

lsusb; \
lsusb -v; \
lsusb -t; \
lsblk -O /dev/sd?; \
fdisk -l /dev/sd?

Or concatenate like a true pro:

(lsusb; \
lsusb -v; \
lsusb -t; \
lsblk -O /dev/sd?; \
fdisk -l /dev/sd? ) > /tmp/usb_foo.txt

I think you need to install usbutils before you can use lsusb, so do an apt install usbutils first. Speaking of which, the output of iotop while running the script would be interesting as well.

Also: could you show us the script you’re using?

Because that sounds wonky.

jfyi: Since Kodi 18 Leia, this topic was moved to category “Development and Testing”.

Why? The development and testing thread is meant to be used by developers to publish announcements

Otherwise, we will get people seeing the thread and thinking we have some improvements

Good to know, now.

Thanks for showing interest, maybe I didn’t explain clearly, the idea of the script is to create a backup image which is only the size (slightly bigger) of the used space of the installation, making it very simple to move installations to smaller memory cards, and also saves a lot of time when writing the image to cards.
Rather than writing a 16/32 GB image, its now just writing 3/4GB as thats all the space that was used.

More importantly, once i’d ruled out power as a cause, I’ve tracked down the issue and its a faulty USB stick thats causing it, I swapped the USB sticks from each pi and rewrote the images, and the problem follows the USB stick, now its the PI2 on Raspbian that has the very slow write speeds, and the OSMC Pi3 is performing exactly as it should.

Its something I stupidly overlooked at first as both sticks were brand new, identical, and taken out of the packaging at the same time.

I’ll be returning the faulty stick for a replacement as its less than a week old.

Mark this one as solved!