Comments (4)
Ah, duh...
-# ./show_usage.py /mnt/tutorial
dev item devid 1 total bytes 6442450944 bytes used 3026583552
dev item devid 2 total bytes 6442450944 bytes used 1961230336
dev item devid 3 total bytes 6442450944 bytes used 3034972160
block group vaddr 20971520 length 8388608 flags SYSTEM|RAID1 used 16384 used_pct 0
chunk vaddr 20971520 type SYSTEM|RAID1 length 8388608 num_stripes 2
stripe devid 3 offset 1048576
stripe devid 2 offset 1048576
block group vaddr 29360128 length 1073741824 flags METADATA|RAID1 used 140083200 used_pct 13
chunk vaddr 29360128 type METADATA|RAID1 length 1073741824 num_stripes 2
stripe devid 1 offset 20971520
stripe devid 3 offset 9437184
block group vaddr 1103101952 length 1932656640 flags DATA|RAID0 used 1932591104 used_pct 100
chunk vaddr 1103101952 type DATA|RAID0 length 1932656640 num_stripes 3
stripe devid 2 offset 9437184
stripe devid 1 offset 1094713344
stripe devid 3 offset 1083179008
block group vaddr 3035758592 length 1962934272 flags DATA|RAID0 used 1962934272 used_pct 100
chunk vaddr 3035758592 type DATA|RAID0 length 1962934272 num_stripes 3
stripe devid 2 offset 653656064
stripe devid 1 offset 1738932224
stripe devid 3 offset 1727397888
block group vaddr 4998692864 length 1962934272 flags DATA|RAID0 used 955039744 used_pct 49
chunk vaddr 4998692864 type DATA|RAID0 length 1962934272 num_stripes 3
stripe devid 2 offset 1307967488
stripe devid 1 offset 2393243648
stripe devid 3 offset 2381709312
And I'm doing (line 370):
length = chunk.length * len(stripes)
That of course is the wrong thing to do for a RAID0
chunk. Instead, I need to have a look at the device extent objects for these stripe, and take the sum of their length.
from btrfs-heatmap.
Euh, no. Looking up device extents objects for each stripe would be a large waste of cpu and disk io. When the amount of stripe items in the chunk is known and the profile, we can calcute the actual total usage on disk with a few simple rules.
from btrfs-heatmap.
- heatmap a48a494 "Fix raw disk space usage for chunks"
- python-btrfs knorrie/python-btrfs@6376962 "Add helper to calc dev extent length for chunk"
(commit ids might change because I tend to force-push in the development branch)
So, next btrfs-heatmap will depend on the next python-btrfs version.
from btrfs-heatmap.
Ok, this is done. Just tagged v8 (which needs python-btrfs v10 for --sort virtual) and now it produces correct pictures and does not crash any more.
from btrfs-heatmap.
Related Issues (12)
- Explicitly use python2 HOT 3
- "Btrfs and dirvish, a perfect match" HOT 7
- Man page missing from regular releases HOT 1
- Documentation needed? HOT 2
- Running python script as root? HOT 2
- Clarify license HOT 3
- btrfs-heatmap: search_v2(): ioctl.py:265:search_v2:PermissionError: [Errno 1] Operation not permitted HOT 6
- BTRFS mounted on BTRFS shows the top most filesystem HOT 5
- ! [new branch] debian/master -> origin/debian/master (unable to update local ref)
- Feature request: Support image output to stdout HOT 10
- Suggestion: Use colors for different RAID levels HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btrfs-heatmap.