Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to write a disk image on Linux

📅 2013-Jun-21 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ dd, disk image, linux, ubuntu, umount ⬩ 📚 Archive

You may sometimes need to write a disk image to a USB thumbdrive or a SD card. This is typically done to create a system that you can use to boot a device. The image file typically has the .img file extension, though its not necessary and does not matter. Writing the disk image can be easily done on Ubuntu or any other Linux distribution.

$ umount /dev/sdb
$ sudo dd if=/blah/foo.img of=/dev/sdb bs=1M
$ sync

That is it! The disk image is written and you can take out your USB thumbdrive or SD card to use it.

Related: How to write a disk image on Windows using Win32 Disk Imager

Tried with: Ubuntu 12.04