Hi guys, I know this is not completely related to Xen but it affects my Xen setup. I have some Win2003 VMs using disks via iscsi. I do backups using snapshots on LVM, dd and gzip. So far so good. The thing is that the size of backups increases in time due to VM use although the used space in the VM disk does not increase. I''d like to zero the free space on the ext3 and ntfs partitions so gzip can compress more the files and the backups end up being somewhat smaller. I wonder if this would work. I''d stop the VM and mount the disk temporarily on a iscsi client (maybe not necessary on ext3 partitions) and then I''d do a "dd if=/dev/zero of=file". After filling all available space on the disk I''d delete the file, thus leaving all free space zeroed. Has any of you tried something similar? Thanks a lot, Aleix. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Aug-21 07:39 UTC
Re: [Xen-users] Will this work? (Zeroing free space)
On Fri, Aug 21, 2009 at 2:31 PM, Aleix Dorca<adorca@uda.ad> wrote:> I have some Win2003 VMs using disks via iscsi. I do backups using snapshots > on LVM, dd and gzip. So far so good.> I wonder if this would work. I''d stop the VM and mount the disk temporarily > on a iscsi client (maybe not necessary on ext3 partitions) and then I''d do a > "dd if=/dev/zero of=file". After filling all available space on the disk I''d > delete the file, thus leaving all free space zeroed.In theory, they should work. In practice, last time I tried the zeroing process (note: there''s sdelete for Windows) simply took too much time and disk bandwitdh to be useful. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Martti Kuparinen
2009-Aug-21 07:51 UTC
Re: [Xen-users] Will this work? (Zeroing free space)
Now related to Xen but this is exactly what I do with my laptop in order to make the backup image as small as possible. Works great! So the same should work with virtual machines as well... http://kuparinen.org/martti/comp/windows/ Martti _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks for your comments. I see that Martii you do almost exactly as I do. It''s good to know it works as intended. I''ve also tried sdelete on a small VM and the backup has dropped from 5.6Gb to 3.4Gb on a 30Gb partition disk. Quite impressive. I''ve just also found "zerofree". A linux utility I didn''t know about that zeros free space on ext2/3 filesystems. The device has to be unmounted though. Thanks again. Aleix. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Aug-21 10:10 UTC
Re: [Xen-users] Re: Will this work? (Zeroing free space)
On Fri, Aug 21, 2009 at 4:41 PM, Aleix Dorca<adorca@uda.ad> wrote:> I''ve also tried sdelete on a small VM and the backup has dropped from 5.6Gb > to 3.4Gb on a 30Gb partition disk. Quite impressive. > > I''ve just also found "zerofree". A linux utility I didn''t know about that > zeros free space on ext2/3 filesystems. The device has to be unmounted > though.For Windows domU backup involving LVM snapshot, you might want to look at ntfsclone. It has the benefit of saving only used ntfsblock without having to run I/O-intensive zeroing application like sdelete first. The downside, backup is done per domU partition, meaning you also need a separate backup of domU''s partition table and MBR (which rarely change, so one-time backup should be enough). I''m using it mainly to clone Windows domU, and it''s working great for Windows XP and 2003. To be specific, the cloning process includes: - create partition table manually - restoring a known good MBR - restore data using ntfsclone - ntfsresize if necessary Using it for Windows 2008 is somewhat harder though, I''ve had some non-working result. Probably related to ntfsclone version, more testing needed. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users