<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">A normal RaspberryPi image from Raspian is ~1.5GB as a zip, and as far as I can tell, around or about 4GB when expanded and burned to an SD card.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br>I’m having a hard time taking the SD card and creating a sparse image from it. I think “sparse” is what I want — I burned the image to a 16GB SD card made some changes and then tried to use dd to create an image of the modified card, and no matter what I do I’m always ending up with a 16GB image file. The changes I made include installing a couple of packages, a couple of python modules, and setting up some python scripts to run as a service on boot. Nothing major.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">I’ve tried to run zerofree on the card (to ensure the free space is all 0x00), and then specifying ‘conv=sparse’ to dd but it made no difference. I tried making the image on Linux and Mac. dd seems to be very similar on both.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"># dd if=/dev/sdc of=/tmp/sd_card.img conv=sparse</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">I can use gzip, and it takes 16GB down to ~1.5GB. Etcher is a really nice, user-friendly app for making a new SD card. It’s what I’d like to recommend to my client for making a new SD card if they need it.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">Etcher takes the 1.5GB gzip, says “oh, okay, cool. I can deal with a gz’d file. Looks like ~3GB. Give me a few minutes”. Etcher gets to 100% fairly quickly, then stays there for a long time. It’s not, but it looks like it’s hanging. I can only guess that Etcher is calculating that it needs to write 3GB, but is actually writing the full 16GB.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">‘Disk Utility’ on the Mac has become a nearly useless piece of junk over the last several macOS/OSX versions. It often disallows or fails on operations more than the most simple, and it will only see the smaller FAT32 partition of the SD card, not the ext partition.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">Maybe I’m not understanding what “sparse” means in this context?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">Any ideas?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">Thanks!</div></body></html>