Re: Accepting discard to free space from disk images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 09 Feb 2015 00:17:49 -0500
"Devon B." <devon.b@xxxxxxxxxxxxxxxxxxx> wrote:

> Looking to use btrfs with disk images that contain ext4, xfs, and other
> possible filesystems.  One of my main concerns is reclaiming disk space
> when files are deleted on the disk image's filesystem.  Using fstrim on
> the mount point of the disk image or mounting the disk image (loop) with
> discard doesn't appear to pass the freed blocks to btrfs.
> 
> The image file on the btrfs filesystem just keeps growing in size.  When
> hosting images on ext4, using fstrim or discard frees up the space on
> the host filesystem (ext4).
> 
> I see discard is pretty well supported for btrfs to the underlying block
> devices but is there any way to properly free space on the btrfs host
> filesystem from overlying filesystems while they are online?

I use KVM (QEMU) with discard pass-through from the VM guest ("discard=unmap"
option), with the VM images stored on Btrfs. It works just fine, the disk
space used for the image file does shrink when the guest OS issues discards on
its FS. Maybe there is a difference in how KVM and the 'loop' module submit
discards to Btrfs?

-- 
With respect,
Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux