1

I have read that this is possible on Windows using Win32DiskImager.exe but I'm looking for a Linux (Mint) based solution. I have downloaded the latest distribution and configured it with the software I need and now I'd like to make a *.img file of it - ideally with the ability to not include unallocated sectors as Win32DiskImager.exe apparently does. Is this possible on Linux?

Thanks, Dave

1 Answers1

2

To create a complete image of a SD Card on a Linux system you can use the dd program. It will copy bit by bit from the SD Card into a file so the file will get the same size than the SD Card. How to do it you can look at
raspberry pi compute module replication.

Fortunately you can compress the image to about one sixth of size for example with most used gzip:

pc ~$ gzip sdcard.img

This will make a compressed image sdcard.img.gz. You can also use the power of the Unix command line and pipe the commands to one command, for example using the instructions from the linked answer:

pc ~$ sudo dd if=/dev/sdb bs=4M | gzip > sdcard.img.gz

To restore it you use:

pc ~$ gzip --decompress --stdout sdcard.img.gz | sudo dd of=/dev/sdb bs=4M conv=fsync
Ingo
  • 42,961
  • 20
  • 87
  • 207