On 05/11/15 04:18, Duncan wrote:
> OmegaPhil posted on Wed, 04 Nov 2015 21:53:09 +0000 as excerpted:
> 
>> The volume doesn't change hugely over time, so it really ought not to
>> have broken so quickly - a quick rundown of the storage usage:
>>
>> 36% general (small files, some smallish videos)
>> 24% music 23% pr0n 17% VMs
>>
>> But in terms of 'large files changing', it could be the VM disks perhaps
>> -
>> I'll move them out, balance, and then back in again, hopefully that'd be
>> a meaningful test.
> 
> VM image files (and large database files, for the same reason) are a bit 
> of a problem on btrfs, and indeed, any COW-based filesystem, since the 
> random rewrite pattern matching that use-case is pretty much the absolute 
> worst-case match for a COW-based filesystem there is.
> 
> And that would be the worst-case in terms of the unsplit extents issue 
> Hugo was talking about as well.  So they may well be the problem, indeed.
> 
> Since you're not doing snapshotting (which conflicts with this option, 
> with an imperfect workaround), setting nocow on those files may well 
> eliminate the problem, but be aware if you aren't already that (1) nocow 
> does turn off checksumming as well, in ordered to avoid a race that could 
> easily lead to data corruption, and (2) you can't just activate nocow on 
> the existing file and expect it to work, the procedure is a bit more 
> complicated than that, since nocow is only guaranteed to work if it's set 
> at file creation.  Detailed instructions for #2 skipped as they've been 
> posted many times, but if you are interested and haven't seen them, ask.


Thankyou Hugo, Duncan - moving VMs out, then:

=====================================================

sudo chattr +C '/mnt/storage-1/Virtual Machines'
sudo btrfs balance start -mconvert=dup /mnt/storage-1
sudo btrfs fi defrag -rv /mnt/storage-1

=====================================================

And after moving VMs back, du reports 884GB used,

=====================================================

$ sudo btrfs fi usage /mnt/storage-1

Overall:
    Device size:                 953.87GiB
    Device allocated:            924.07GiB
    Device unallocated:           29.80GiB
    Device missing:                  0.00B
    Used:                        886.11GiB
    Free (estimated):             65.72GiB      (min: 50.82GiB)
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:              512.00MiB      (used: 0.00B)

Data,single: Size:918.01GiB, Used:882.09GiB
   /dev/sdb      918.01GiB

Metadata,DUP: Size:3.00GiB, Used:2.01GiB
   /dev/sdb        6.00GiB

System,DUP: Size:32.00MiB, Used:128.00KiB
   /dev/sdb       64.00MiB

Unallocated:
   /dev/sdb       29.80GiB

=====================================================

So a couple of gig still unaccountable but irrelevant. Thanks, problem
solved! Although hopefully checksumming will be allowed on nocow files
in the future as thats currently 17% of all data unprotected and will
get worse...

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to