Douglas McClendon wrote:
Mark McLoughlin wrote:
> Hey,
> Okay, I follow you now. Doing:
>
> - Create snapshot of os.img
> - Resize it down to the smallest possible size
> - Copy it to disk
> - Resize it back up to the size of the disk
>
> has the dual advantages of being able to install to the small
> possible
> disk size and not copying unallocated blocks.
>
> Sounds like a reasonable plan ... go ahead and give it a shot.
>
> The reservation I'd have is if you're resizing down from 4G to 3G,
> the
> 1G of data blocks which have to be moved could potentially be at the end
> of the image. In that case, you'd need a 1G COW area for the snapshot.
The part of my theory that is supposed to cover that, is an extra
minimize/truncate/sparsify_expand/maximize cycle on the image just
before it gets burned in the squashfs. Fingers crossed...
Actually even before testing this, I'm 90% sure it won't work... But I'm 99%
sure I figured out something that will. You'll love it, trust me ;)
-dmc