How to Write an SD Card Image (Linux, Windows, Mac OSX)


The question “How do I write a TS Image to an SD card under Linux / Mac OSX / Windows?” comes up quite a bit when dealing with embedded systems or any situation where you want to make an exact, bit-by-bit copy of a removable storage card or disk. While the following guide talks about our products, it can be applied generically. Read through it first to make sure you have a basic, core understanding of the instructions given, and then apply them to your situation. We’ll be looking at how to write to an entire disk and/or a specific partition on that disk using the dd  command, a common utility found in most unix systems for low-level operations on hard disks.  Jokingly, ‘dd’ stands for “disk destroyer” or “delete data”, so take care!

If you are working with a Technologic Systems’ product, please be sure to also see the product manual for specific instructions for that device.


1.) The following commands will need to be executed as root. It’s popular to prefix the commands with ‘sudo’, but you can also become root by using the command (may vary depending on distribution):

2.) Plug in your SD card and then use the following command to see which /dev/ node it’s located on (be sure of this!):

3.) Unmount the disk (using /dev/sda as example, verify with step 2):

4.) Use the dd  command to copy the image file (ts-image.dd) to the entire disk:

Note, bs=1M  is telling dd  to write 1 Mb block sizes at a time (faster write speeds this way) and conv=fsync  is telling dd  to flush data to the disk after every write.

As an example, say you have a separate kernel partition, you can write the image to the specific partition number:


1.) Become root:

2.) Plug in your SD card and then use the following command to see which /dev/diskN node it’s located on:

3.) Unmount the disk where “N” is the number of the disk taken from the above command:

If the above command was successful, you will see:

4.) Use the dd command to copy the image file (ts-image.dd) to the entire disk:

Also, you can write the image to particular partitions of the disk with (N is the disk number and P is the partition number):

The process to do this under Linux is very similar except that it’s not required to un-mount the drive before using the dd command and the commands are a little different. For example, you would use fdisk -l instead of diskutil list, your device node would be located at /dev/sda instead of /dev/disk and the un-mount command is umount instead of diskutil unmountDisk.


With Windows, you’ll need to search out some third party utilities to help.  For example, here are some we’ve seen which work well:


You could also use a Linux virtual machine.  VirtualBox is a nice, user friendly virtualization program and you can find ready-to-run Linux distributions easily online, such as Ubuntu on

Author: Derek Hildreth

eBusiness Manager for Technologic Systems

  • Pingback: What I Wish I’d Known When I Was an Embedded Linux Newbie()

  • cincodenada

    Thanks for this quick guide, I always need a reminder, and I appreciate the explanation of the flags to dd!

    Another way to determine which device is the SD card on Linux is to run lsblk, which lists the devices, whether mounted or not (and is runnable by not-root). It should be easy to recognize the card by the size, and they usually start with “MMC”.

    I would recommend changing the example from “/dev/sda” to “/dev/mmcblk0”, since that’s more likely to be the device node, whereas sda is more likely to be the hard drive that the root partition is on – a less safe example!

    • Derek Hildreth

      Thanks for the tip! I like it. 🙂