Bug 1514731 - Btrfs Free + Used != Total
Summary: Btrfs Free + Used != Total
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: system-storage-manager
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Tulak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-18 04:41 UTC by Chris Murphy
Modified: 2018-08-14 20:18 UTC (History)
4 users (show)

Fixed In Version: system-storage-manager-1.0-0.fc28 system-storage-manager-1.2-0.fc27
Clone Of:
Environment:
Last Closed: 2018-08-07 01:14:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Chris Murphy 2017-11-18 04:41:23 UTC
Description of problem:

Btrfs Free + Used != Total.

--------------------------------------------------------------------
Pool        Type   Devices       Free       Used       Total  Parent
--------------------------------------------------------------------
4vg         lvm    1          6.48 GB  925.03 GB   931.51 GB        
vg          lvm    1         83.64 GB  704.17 GB   787.82 GB        
4pool       thin   1        384.89 GB  540.11 GB   925.00 GB  4vg   
thintastic  thin   1        671.51 GB   28.49 GB   700.00 GB  vg    
fedoraroot  btrfs  1         42.49 GB   50.00 GB    50.00 GB        
first       btrfs  1        540.12 GB    1.00 TB  1024.00 GB        
--------------------------------------------------------------------



Version-Release number of selected component (if applicable):

btrfs-progs-4.13.3-1.fc28.x86_64
system-storage-manager-0.5-0.fc27.noarch



How reproducible:

Always


Steps to Reproduce:
1. create a btfs volume
2. ssm list
3.

Actual results:

Btrfs Free + Used != Total



Expected results:

Same as for lvm, and thin; free + used should equal total.


Additional info:


[chris@f27s ~]$ sudo btrfs fi us /mnt/first
Overall:
    Device size:		1024.00GiB
    Device allocated:		 488.06GiB
    Device unallocated:		 535.94GiB
    Device missing:		     0.00B
    Used:			 484.91GiB
    Free (estimated):		 537.10GiB	(min: 269.13GiB)
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		 512.00MiB	(used: 0.00B)

Data,single: Size:484.00GiB, Used:482.84GiB
   /dev/mapper/first	 484.00GiB

Metadata,DUP: Size:2.00GiB, Used:1.04GiB
   /dev/mapper/first	   4.00GiB

System,DUP: Size:32.00MiB, Used:80.00KiB
   /dev/mapper/first	  64.00MiB

Unallocated:
   /dev/mapper/first	 535.94GiB

[chris@f27s ~]$ sudo btrfs fi show /mnt/first
Label: 'first'  uuid: 0f43f49d-6e63-4b1b-bc8c-c54da409872d
	Total devices 1 FS bytes used 483.88GiB
	devid    2 size 1024.00GiB used 488.06GiB path /dev/mapper/first



The most accurate variant of "used" is from the 'filesystem usage' subcommand, 484.91GiB. That's counting data used 482.84GiB, plus duplicate metadata used 1.04 + 1.04.

The older 'filesystem show' command's first used, 'FS bytes used' is off by 1.04 because it counts metadata once, even though there are two copies.

What you definitely don't want to use is the second used value from fi show, because that's the value of allocated block groups, some portion of which is empty. So we don't really care about that when talking about pool used value.

Comment 1 Fedora Update System 2018-06-19 13:30:59 UTC
system-storage-manager-1.0-0.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a5e9bb0d59

Comment 2 Fedora Update System 2018-06-19 13:31:58 UTC
system-storage-manager-1.0-0.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-82590e658c

Comment 3 Fedora Update System 2018-06-19 16:36:37 UTC
system-storage-manager-1.0-0.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-a5e9bb0d59

Comment 4 Fedora Update System 2018-06-19 16:57:50 UTC
system-storage-manager-1.0-0.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-82590e658c

Comment 5 Fedora Update System 2018-08-07 01:14:10 UTC
system-storage-manager-1.0-0.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2018-08-10 16:34:07 UTC
system-storage-manager-1.2-0.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7783adc03e

Comment 7 Fedora Update System 2018-08-11 16:43:18 UTC
system-storage-manager-1.2-0.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-7783adc03e

Comment 8 Fedora Update System 2018-08-14 20:18:58 UTC
system-storage-manager-1.2-0.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.