How can I use dd to write an image to my android phones SD card?

light24bulbs picture light24bulbs · Jun 18, 2012 · Viewed 10.7k times · Source

I'm trying to use my android phone in place of a card reader to write a .img file to its external(removable) sd card(/mnt/emc) but when I try to do this from a terminal on the phone(dd if=foobar.img of=/mnt/emmc) dd complains that I'm writing to a directory. The galaxy s2 mounts it's internal storage to /mnt/sdcard, and then mounts the external sd card as a directory inside of that. Apparently using DD from a computer that has the SD mounted over USB will silently corrupt the image on write because of how the device shelters it's storage somehow. Is what I'm trying to do even possible?

Answer

usr picture usr · Nov 11, 2012

You can "dd" to a device, not to its mount point. /mnt/emc is a mount point, not a device.
dd if=foobar.img of=/dev/mydevice would instead work.
Please use command mount to see which device corresponds to that mount point