rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Compress SD card for Compute Module lite

Fri Sep 28, 2018 6:18 pm

I have my first beta image for our Compute Module-based controller.
I would like to take this image and compress it so that when I need to duplicate it (using dd), I only have to copy the first N in-use blocks, and not 7GB of unused blocks.

I have seen hints on the web on how to do this, but most of them suggest running raspi-config, and expanding the filesystem, which will NOT work for our application. I want to have a fully working 8GB filesystem that has all the data moved to the first N blocks.

Is there anyone who has done this?

fruitoftheloom
Posts: 21623
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Compress SD card for Compute Module lite

Fri Sep 28, 2018 8:14 pm

rzusman wrote:
Fri Sep 28, 2018 6:18 pm
I have my first beta image for our Compute Module-based controller.
I would like to take this image and compress it so that when I need to duplicate it (using dd), I only have to copy the first N in-use blocks, and not 7GB of unused blocks.

I have seen hints on the web on how to do this, but most of them suggest running raspi-config, and expanding the filesystem, which will NOT work for our application. I want to have a fully working 8GB filesystem that has all the data moved to the first N blocks.

Is there anyone who has done this?

Maybe ??

https://github.com/Drewsif/PiShrink/blo ... /README.md
Retired disgracefully.....
......to a more gentile life !

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: Compress SD card for Compute Module lite

Sat Sep 29, 2018 12:38 am

Maybe.
I'll give it a try.
It would be nice to find something that just "optimizes" the layout on the SD, though.

W. H. Heydt
Posts: 11472
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Compress SD card for Compute Module lite

Sat Sep 29, 2018 4:46 am

When I wanted to something like that a couple of years ago, I started by getting a couple of 2GB uSD cards and built the system on one of these. Then when I wrote to a CM, I expanded the file system to fill the available space.

I'll grant that that may be a slightly odd way to approach the problem, but it worked for me.

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: Compress SD card for Compute Module lite

Sat Sep 29, 2018 9:04 pm

I tried the PiShrink script, and it failed with some "Superblock" issue, even though the SD card boots just fine.
I'll fsck it manually, and try again.

I found another script (from a Korean programmer), and that one failed, also.

This really shouldn't be that difficult.

I like W.H.H.'s suggestion - that might be the simplest way to go, although I'd like to get the copy down to the exact number of bytes (I'm using "Minibian," so the install size is pretty small.)

I'm going to research the "rsync" method - that might give me better results.

Still, if anyone has actually done this, I'd love to hear from them!

rln
Posts: 176
Joined: Wed Apr 09, 2014 1:43 pm
Location: Sweden
Contact: Website

Re: Compress SD card for Compute Module lite

Tue Oct 02, 2018 9:39 am

You might want to look at my project Nard which instead works by creating a master image all in your PC. That image is about 40 MB and can later be written to the CM.
http://www.nard.se/
Author of the robust Nard distro http://www.nard.se

Return to “Advanced users”