You are not logged in.

#1 2014-10-19 23:45:38

brettski
Member
Registered: 2013-06-21
Posts: 18
Website

Uncompress btrfs file

So I just converted my storage drive from ext4 to btrfs. The conversion process went off without a hitch and I decided to mount the drive with compression enabled. Everything seemed fine until I tried to launch a virtual machine whose .vdi lives on the new btrfs volume. The virtual machine is now unbearably slow and I believe it is due to the compression as nothing else in my system has changed.

I have since removed the compression option from /etc/fstab but the slowness has not gone away. This seems to suggest that removing the option does not cause the file to magically decompress (duh).

I have googled "decompress btrfs file" and read through some of the documentation but have not found anything that seemed like it would solve my problem.

Does anyone have any suggestions as to how to permanently decompress this file?

Thanks in advance!

Offline

#2 2014-10-19 23:56:05

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Uncompress btrfs file

If you simply converted the filesystem then added the compression mount flag, your data is actually not compressed.  Once the data is overwritten/rewritten/defragged it will compress it.  So unless you have copied your virtual machine images since mounting with the compression flag, they should be stored normally still.

See here.

Also, virtual machine images are likely to get highly fragmented on a copy-on-write filesystem.  It is advisable to set the directory where you store your virtual machine images as nodatacow.  This can be done with a file attribute.

Offline

#3 2014-10-20 00:45:28

brettski
Member
Registered: 2013-06-21
Posts: 18
Website

Re: Uncompress btrfs file

I have not copied the VM but a massive windows update was installed which seems to have been enough to have jammed up the image. Could copying/defragmenting decompress the portions that are compressed?

Offline

#4 2014-10-21 11:34:07

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Uncompress btrfs file

You can "soon" disable compression for a dir/file/subvolume the same way as you can disable cow.

Last edited by Mr.Elendig (2014-10-21 11:35:08)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#5 2014-10-22 03:15:31

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Uncompress btrfs file

Well, I know that you can use chattr  to enable compression for new file written there.

chattr +c /path/to/directory

  So since chattr arguments take -, +, or =, I imagine that doing the following will disable compression on a filesystem where it is enabled globally.

# chattr -c /path/to/directory

Edit: Similarly, -C would be what you use to disable CoW.  See the chattr man page for more info.

Last edited by WonderWoofy (2014-10-22 03:16:30)

Offline

Board footer

Powered by FluxBB