[lug] Problems cloning SD card from Android

Jed S. Baer blug at jbaer.cotse.net
Thu May 3 16:46:33 MDT 2018


Howdy folks.

Believing that the SD card in my Android phone was getting problematic, I
decided to replace it. Cloning it to a new one, same size, is not working
well. I've tried a couple approaches.

Use DD to make a copy of the card:
  dd if=/dev/sde of=sdimg
  dd if=seimg of=/dev/sde

and, after formatting it on the phone
  tar cf sdimg.tar /mount/point (old card)
  cd /mount/point		(new card)
  tar xf /path/to/sdimg.tar

In both cases, it goes for a while, and then aborts with errors. In the
case of tar, a lot of errors. What seems to me to be happening is that
it's just not liking heavy IO. Here's a few lines from syslog:

usb 1-10.1: reset high-speed USB device number 25 using xhci_hcd
xhci_hcd 0000:00:14.0:Command completion event does not match command
xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
usb 1-10.1: device not accepting address 25, error -62

The rest is just a lot of repeated IO errors.

The dd method ought to work, based on multiple forum postings I've read.
I guess I could try it at the partition level, instead of the device, but
I think the same thing will happen.

The other method I've seen recommended is with the device mounted, to use
cp -R to copy everything off, and then reverse it to copy everything back
to the new card. Again, I suspect the same problem will occur.

I'm using a USB2 card reader. Maybe USB3 would work better?

Any suggestions appreciated.


More information about the LUG mailing list