Subject: Re: Zeroing unused FFS blocks
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Hubert Feyrer <hubert@feyrer.de>
List: port-xen
Date: 01/25/2008 13:13:45
On Fri, 25 Jan 2008, Martti Kuparinen wrote:
> I created a large file (say 10 GB with "dd if=/dev/zero of=filename bs=1m 
> count=10k") on my Xen dom0. Then I used this file as a virtual hard drive for 
> my NetBSD domU. When the domU is running, it sometimes uses almost all the 
> disk space for some temporary files and then later removes those files.
>
> Now, after halting the domU it would be very nice to compress this virtual 
> hard drive before storing it on a DVD or moving it to another server.
>
> Is there any way to zero all unused FFS blocks in order to make the 
> compressed image smaller?

Run that dd (and rm) command on shutdown?
I guess you could also fiddle with vnd(4)...


  - Hubert