You then need to copy the contents of each partition in as per my other answer here. This answer describes how to create a device image with filesystem partitions in it, but those partitions will be empty. See here for more about these important distinctions. This is distinct from a filesystem image, which is a byte for byte copy of a single partition. I'll discuss this in relation to Raspbian but it is the same for any other GNU/Linux system.Ī device image is for our purposes a complete byte for byte copy of a bootable device medium such an SD card, which may contain zero or more filesystem partitions. You can't shrink a device image (although you can shrink an individual filesystem with resize2fs), but you can create one of whatever size and duplicate the contents of another one.