Bug 869489
| Summary: | incorrect btrfs used and free space listed | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Chris Murphy <bugzilla> |
| Component: | system-storage-manager | Assignee: | Lukáš Czerner <lczerner> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 18 | CC: | lczerner |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-10-31 07:29:30 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Chris Murphy
2012-10-24 04:44:55 UTC
[chris@f18v ~]$ sudo btrfs balance status / 73 out of about 77 chunks balanced (74 considered), 5% left Again, interesting that during OS install (and 2-3 yum updates) ~77GB worth of chunks were allocated for only 4-5GB. This rebalance went quickly. [chris@f18v ~]$ sudo btrfs fi show failed to read /dev/sr0 Label: 'fedora' uuid: 780b8553-4097-4136-92a4-c6fd48779b0c Total devices 1 FS bytes used 3.91GB devid 1 size 76.06GB used 9.13GB path /dev/sda1 Btrfs Btrfs v0.19 [chris@f18v ~]$ sudo btrfs fi df / Data: total=5.00GB, used=3.66GB System, DUP: total=64.00MB, used=4.00KB System: total=4.00MB, used=0.00 Metadata, DUP: total=2.00GB, used=256.84MB And now: [root@f18v ~]# ssm list ------------------------------------------------------------- Device Free Used Total Pool Mount point ------------------------------------------------------------- /dev/sda 80.00 GB PARTITIONED /dev/sda1 66.93 GB 9.13 GB 76.06 GB fedora /dev/sda2 3.94 GB SWAP /dev/sdb 8.00 GB /dev/sdb1 0.00 KB 7.97 GB 8.00 GB thegroup /dev/sdc 8.00 GB /dev/sdc1 0.00 KB 7.97 GB 8.00 GB thegroup ------------------------------------------------------------- ------------------------------------------------------ Pool Type Devices Free Used Total ------------------------------------------------------ thegroup lvm 2 0.00 KB 15.94 GB 15.94 GB fedora btrfs 1 72.15 GB 76.06 GB 76.06 GB ------------------------------------------------------ ---------------------------------------------------------------------------------- Volume Pool Volume size FS FS size Free Type Mount point ---------------------------------------------------------------------------------- /dev/thegroup/vol1 thegroup 2.78 GB ext4 2.78 GB 2.53 GB linear /dev/thegroup/vol2 thegroup 5.78 GB ext4 5.78 GB 5.27 GB linear /dev/thegroup/vol3 thegroup 7.38 GB ext4 7.38 GB 6.75 GB linear fedora fedora 76.06 GB btrfs 76.06 GB 72.15 GB btrfs / ---------------------------------------------------------------------------------- So is there a bug? The first block ssm list returns (device) is clearly calculating free space differently than the other two blocks. 72.15 free vs 66.93 free is still a big difference, esp if the user isn't particularly familiar with btrfs. Hi Chris,
thanks a lot for the report. The first block (Device list) shows how much of the device is actually used for the volume (in this case btrfs file system) and it might not be even related to the file system size.
In the first case, before the rebalance most of the space on the device was allocated by btrfs (for whatever weird reason)
[root@f18v ~]# btrfs fi show
failed to read /dev/sr0
Label: 'fedora' uuid: 780b8553-4097-4136-92a4-c6fd48779b0c
Total devices 1 FS bytes used 3.93GB
devid 1 size 76.06GB used 76.06GB path /dev/sda1
and the Device listing just presented that information
/dev/sda1 573.44 KB 76.06 GB 76.06 GB fedora
On the other hand after the rebalance the btrfs could free some of the chunks so actually have smaller portion of the device allocated:
[chris@f18v ~]$ sudo btrfs fi show
failed to read /dev/sr0
Label: 'fedora' uuid: 780b8553-4097-4136-92a4-c6fd48779b0c
Total devices 1 FS bytes used 3.91GB
devid 1 size 76.06GB used 9.13GB path /dev/sda1
So again we just present that information
/dev/sda1 66.93 GB 9.13 GB 76.06 GB fedora
Important to mention is that the portion of the device which is used might not correspond with the file system size, or even how much data is actually used in the file system. Well, it actually corresponds a little bit in the way that it will be always bigger than amount of data used by the file system (not talking about RAID).
It is similar to the lvm where lvm can use just a part of the device to create logical volume. In this case we will show how much of the device is actually used and how much of it is free.
Does it make sense for you ? Is there anything we can make to make this distinction more obvious ?
Thanks!
-Lukas
It does make sense. I think this is less a bug than it is (initially) unexpected behavior due in large part how btrfs can report usage. I wonder if the device list should represent information the user would find from parted, instead of being file system related? If the interface reveals information general to specific, you have the device list in a good position as the most general view. Maybe instead of free/used/total space based on the file systems (a more specific concept) on those devices, it's based on sectors (in human readable values). As you point out, with file systems like btrfs, we can end up with a situation where the free space reported is larger than the physical device, and in a device list I think that's confusing. If the device list is strictly about device size, that might make more sense. And then leave the file system used/free information in the pool and volume listings. So the Total in the device listing should represent the device size. Granted that I should probably rename it to Size so it is more obvious.
'Free' and 'Used' represents how much of the device is used for a volume. It does not have nothing to do with file system in particular, but since btrfs has volume management accidentally this is file system related information in this case. But if we talk about lvm, then it is not. So this is "storage" related information in general and I think is incredibly useful to see how much (if any) space is actually used by the volume.
Consider adding a device to the btrfs, or lvm pool. At that point the device is part of the pool, but it is not used at all so the 'Used' part of the device reports 0, which is useful information to have, because you immediately know that you could reuse that device for something else without much hassle.
I am not sure what you mean about sector based information about the device. The information about the Size ("Total") of the device is gathered from /proc/partitions, and it is presented in human readable format.
Also, in other volume management backends such as lvm, you do not have to use the whole device for a single volume and you can use one device for several volumes, so the 'Used' size adds up. So I think it is good to have such information.
Or maybe I misunderstood you point ?
Thanks!
-Lukas
I think part of what's confusing is how btrfs fi show and fi df currently show used space. This is currently being discussed on the linux-btrfs list, looks like some changes for fi df (and possibly fi show) are being bounced around. Yeah, I am going through the thread right now. So if you do not mind, I'll close this BZ with NOTABUG. Feel free to reopen it if you realize that there might still be a problem. Thanks! -Lukas |