On 02/08/2016 03:05 PM, m.roth at 5-cent.us wrote:> Wes James wrote: >> Is there a utility to zero unused blocks on a disk? >> >> CentOS 6.7/Ext4 >> >> I saw zerofree, but I?m not sure it would work on Ext4 or even work on >> this version of CentOS. >> > I don't understand the point of doing this.Wes didn't say the reason he wanted to zero unused blocks, but I always do this in kickstart scripts when constructing VM images as the image size is considerably reduced by doing this... -Greg
Once upon a time, Greg Bailey <gbailey at lxpro.com> said:> Wes didn't say the reason he wanted to zero unused blocks, but I > always do this in kickstart scripts when constructing VM images as > the image size is considerably reduced by doing this...For that purpose, use something that can TRIM a VM image, like virt-sparsify. -- Chris Adams <linux at cmadams.net>
On 02/08/2016 07:04 PM, Chris Adams wrote:> Once upon a time, Greg Bailey <gbailey at lxpro.com> said: >> Wes didn't say the reason he wanted to zero unused blocks, but I >> always do this in kickstart scripts when constructing VM images as >> the image size is considerably reduced by doing this... > > For that purpose, use something that can TRIM a VM image, like > virt-sparsify.That's doing the same thing. virt-sparsify works by mounting the filesystem, filling it to capacity with zeros, then performing a copy operation which skips over the all-zero blocks, leaving them unallocated in the sparse destination file. -- Bob Nichols "NOSPAM" is really part of my email address. Do NOT delete it.