Memory Card Block Optimization

Asked by David Gray on 2017-12-28

I'm currently using a 256MB MicroSD with only 160MB of allocated data (as shown w/unix command "df").

When creating an image with Win32 Image Writer, and checking the box for "Read Only Allocated Partitions", my image size is still 256MB. I'm guessing that means some of my data is hanging out in a latter block - if I understand how this works... (please correct me if I'm in error).

Otherwise:

Is it possible to manipulate data on the MicroSD Card such that when I create an image, it will be closer to the size of allocated data?

Best!
-Ros

Question information

Language:
English Edit question
Status:
Solved
For:
Image Writer Edit question
Assignee:
No assignee Edit question
Solved by:
Tobin Davis
Solved:
2017-12-28
Last query:
2017-12-28
Last reply:
2017-12-28
Best Tobin Davis (gruemaster) said : #1

Excellent question.

Unfortunately, Win32DiskImager only looks at the partition table, and has no understanding of the underlying filesystem. So if you wanted to save an image of only the used portion, you would have to run something like resize2fs on a Linux system to shrink the filesystem, then remake the partition table to only encompass the shrunk filesystem.

Adding functionality to Win32DiskImager to resize partitions to used space would be incredibly difficult. Not impossible, but we just do not have the resources to take that large of a feature into consideration. To do so, we would have to create functions for each of the filesystems supported by most OSs. Even if we only handled the most common across the 3 most popular OSs, that would be ~8 filesystems minimum. At that point, you may as well reboot into a live Clonezilla OS image and use that.

David Gray (roslof) said : #2

Thanks for the quick response, Tobin. Yes, I agree that it wouldn't make sense to add that functionality. Great app as-is, and with your advice above, I think I have a solution that will work.

Best,
-Ros