create disk image

You can use Unix dd command to create FAT/EXT formatted disk which can be dumpped to a sdcard too.

  • Let’s assumed that we can 20MB FAT formatted disk:
sudo dd if=/dev/zero of=ramdisk.bin bs=1M count=20
sudo mkfs.vfat fat-disk.bin
  • Mount above created disk image
sudo mkdir disk
sudo mount -o loopfat-disk.bin disk/
  • Use sudo cp commmands to copy contents to disk folder
  • Once you are done with copying, issue
sync
  • Umount the folder
sudo umount disk
  • loopfat-disk.bin image is ready for use. You can use dd command to dump to sdcard too.

 

Advertisements