TRIM on SD cards

Adrian Chadd adrian at freebsd.org
Sat May 31 17:31:54 UTC 2014


On 31 May 2014 09:45, Warner Losh <imp at bsdimp.com> wrote:

> One of the things that I did for images years ago was compressed tar files. There was so much variation between CF makers and at the time CF geometry was important to the BIOS, so we made our images as tar balls. We then had a makefile target that would create a partition on the card that was actually there, put boot blocks on it then extract the tarball…  I never have liked DD for creating images, even when LBAs ruled the day because you’d always have to grow/shrink the FS afterwards. The only advantage it had was it was easy… Perhaps it is time to go back to that model? The alternative that wouldn’t suck too bad would be to create variable sized images based on how much data was actually present and ensure there are no holes (or minimal holes) in the filesystem.
>
> Hmmm, if we know WHAT filesystem we’re dealing with, then we could perhaps enhance fsck and/or growfs to BIO_DELETE all the blocks that it knows are free, which would be a useful, data-driven approach that could ensure we start out with a nicely trimmed FS. Given the vagaries of the different kinds of TRIMs and the various translation layers we have, that might be the most robust.

Having makefs spit this out would be rather useful.


-a


More information about the freebsd-arm mailing list