dd command in OS X

I have trouble remembering dd command’s usage everytime! So i have decided to note this here!

Step 1. Lists all currently mounted devices.

$ diskutil list



Step 2. Unmount the disk which you want to use for writing like this;

$ diskutil unmountDisk /dev/diskN

Note: N is number of partition or disk! Do not use diskname like “diskNs1”!

Step 3. Write your image into disk you unmounted.

$ sudo dd bs=1m if=input_image_file.img of=/dev/disk2

That’s it! 🙂