If the command to replicate an SD card:
date; sudo sh -c 'pv /dev/mmcblk0 >pv sdcard.image'; date
images a fresh install of Raspbian sitting on a 128GB SD-Card, then sdcard.image file will be 128GB. Assume that a fresh install of Raspbian takes 10 GB of space. Most of the image would not contain data ('empty space'). It would be useful if the resulting image:
- is minimal in size (before any compression and not copy 'empty space')
- could be installed to a
minimal SD-Card
(16GB SD card or larger)
A minimal SD-card
capacity is the smallest SD card that can accept a fresh install Raspbian: because there is no 10GB SD-Card, the next larger size (16GB) is defined as the minimal SD-Card.
Solutions preferences are for simplicity and standard Unix commands (scripts if necessary).
How can the 2 goals be achieved? Would a sensible strategy determine the amount of data (10GB) on the SD card and change the disk parameters a disk size slightly larger than 10GB: in this case 16 GB?
References: