Any tools to go about zeroing about the free space on a btrfs file system so I can shrink the VMware vmdk virtual disk? I ran the VMware command, but the dynamic disk is still really big. I presume it is due to free space that isn''t zeroed out. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jan 21, 2011 at 10:20:34AM -0700, Rodney Beede wrote:> Any tools to go about zeroing about the free space on a btrfs file > system so I can shrink the VMware vmdk virtual disk? > > I ran the VMware command, but the dynamic disk is still really big. I > presume it is due to free space that isn''t zeroed out.One solution I''ve used before is to write a single very large file full of zeroes, filling the filesystem, then delete it. $ dd if=/dev/zero of=/mountpoint/foo.dat && rm /mountpoint/foo.dat Hugo. -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk == PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- ... one ping(1) to rule them all, and in the --- darkness bind(2) them.
On 21/01/11 17:20, Rodney Beede wrote:> Any tools to go about zeroing about the free space on a btrfs file > system so I can shrink the VMware vmdk virtual disk? > > I ran the VMware command, but the dynamic disk is still really big. I > presume it is due to free space that isn''t zeroed out.Does btrfs issue TRIM commands to the underlying (virtual) block device? I guess not yet, as otherwise you would not see this problem, as your virtual storage device should catch them and discard the corresponding virtual storage blocks. -- David Pottage -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jan 21, 2011 at 07:43:47PM +0000, David Pottage wrote:> On 21/01/11 17:20, Rodney Beede wrote: > > Any tools to go about zeroing about the free space on a btrfs file > > system so I can shrink the VMware vmdk virtual disk? > > > > I ran the VMware command, but the dynamic disk is still really big. I > > presume it is due to free space that isn''t zeroed out. > Does btrfs issue TRIM commands to the underlying (virtual) block device?It does when mounted with - o discard. IIRC, btrfs also supports FITRIM ioctl (but I''m not 100% sure about this). -- Tomasz Torcz RIP is irrevelant. Spoofing is futile. xmpp: zdzichubg@chrome.pl Your routes will be aggreggated. -- Alex Yuriev -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jan 21, 2011 at 10:34 AM, Hugo Mills <hugo-lkml@carfax.org.uk> wrote:> On Fri, Jan 21, 2011 at 10:20:34AM -0700, Rodney Beede wrote: >> Any tools to go about zeroing about the free space on a btrfs file >> system so I can shrink the VMware vmdk virtual disk? >> >> I ran the VMware command, but the dynamic disk is still really big. I >> presume it is due to free space that isn''t zeroed out. > > One solution I''ve used before is to write a single very large file > full of zeroes, filling the filesystem, then delete it. > > $ dd if=/dev/zero of=/mountpoint/foo.dat && rm /mountpoint/foo.dat > > Hugo. > > -- > === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ==> PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk > --- ... one ping(1) to rule them all, and in the --- > darkness bind(2) them. > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iD8DBQFNOcObIKyzvlFcI40RAodJAJ0VyXnvxNH2MxTZ08uT8WaywsA툀齂䕺 > 7MRCSpCsPWGiXeS73ItqnWA> =ngld > -----END PGP SIGNATURE----- > >I tried your method, and it made things worst. The disk just expanded to the maximum. I deleted the zero filled file and made sure btrfs compress was off. I ran the VMware disk manage tool and told it to defragment and shrink but it didn''t get any smaller. I think btrfs just doesn''t work that way. I also tried btrfs filesystem defragment with no luck. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html