Re: Accepting discard to free space from disk images

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

 



On Mon, Feb 09, 2015 at 11:40:23AM +0500, Roman Mamedov wrote:
> 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?

   This is interesting, because I've tried exactly that setup (KVM,
discard=unmap) and it's not worked for me.

   Hugo.

-- 
Hugo Mills             | If you see something, say nothing and drink to
hugo@... carfax.org.uk | forget
http://carfax.org.uk/  |
PGP: 65E74AC0          |                                 Welcome to Night Vale

Attachment: signature.asc
Description: Digital signature


[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