All Projects → knorrie → Btrfs Heatmap

knorrie / Btrfs Heatmap

Licence: mit
Visualize the layout of data on your btrfs filesystem over time

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Btrfs Heatmap

Pic2ascii
Converts a picture and video to ascii art
Stars: ✭ 79 (-28.18%)
Mutual labels:  picture
React Responsive Picture
A future-proof responsive image component that supports latest Picture specification
Stars: ✭ 91 (-17.27%)
Mutual labels:  picture
Wanimal 1983
WANIMAL(王动)全部原版资源免费分享,目前WANIMAL作品在黑市上最高被炒到了5000多元,本项目整理了WANIMAL从2013年到现在的所有作品,建议在电脑查看图片效果会更好(目前更新到2020年3月,共8765张图片,大小16.1G,还会持续更新)
Stars: ✭ 107 (-2.73%)
Mutual labels:  picture
Noodlesplate
Offline Shader Editor with many cool features
Stars: ✭ 79 (-28.18%)
Mutual labels:  picture
Telegramgallery
world level Gallery , from Telegram,Photo album selector,QQ style
Stars: ✭ 1,294 (+1076.36%)
Mutual labels:  picture
Wait4disney
Shanghai Disney Waiting Queue Statistics 上海迪士尼排队情况
Stars: ✭ 99 (-10%)
Mutual labels:  heatmap
Python Btrfs
Python Btrfs module
Stars: ✭ 72 (-34.55%)
Mutual labels:  btrfs
Albumcamerarecorder
一个高效的多媒体支持操作库,可多方面的简单配置操作相册、拍照、录制、录音等功能。也支持配套使用的展示图片、视频、音频的九宫格功能。 (An efficient multimedia support operation library, can be a variety of simple configuration operation album, photo, recording, recording and other functions.Also support supporting the use of the display of pictures, video, audio of the nine grid function.)
Stars: ✭ 106 (-3.64%)
Mutual labels:  picture
Hxphotobrowser
📷 Photo browser that simulates progressive loading 可以模拟渐进式加载的图片浏览器
Stars: ✭ 91 (-17.27%)
Mutual labels:  picture
Btrfs Sxbackup
Incremental btrfs snapshot backups with push/pull support via SSH
Stars: ✭ 105 (-4.55%)
Mutual labels:  btrfs
Genetic Algorithm Montage
genetic algorithm for self-referential image approximation.
Stars: ✭ 86 (-21.82%)
Mutual labels:  picture
Deep Learning With Cats
Deep learning with cats (^._.^)
Stars: ✭ 1,290 (+1072.73%)
Mutual labels:  picture
Grid
The Guardian’s image management system
Stars: ✭ 1,380 (+1154.55%)
Mutual labels:  picture
Seranet
Super Resolution of picture images using deep learning
Stars: ✭ 79 (-28.18%)
Mutual labels:  picture
Physt
Python histogram library - histograms as updateable, fully semantic objects with visualization tools. [P]ython [HYST]ograms.
Stars: ✭ 107 (-2.73%)
Mutual labels:  heatmap
Calendar Heatmap
Calendar heatmap with matplotlib and random data
Stars: ✭ 76 (-30.91%)
Mutual labels:  heatmap
Mini3d
3D Software Renderer in 700 Lines !!
Stars: ✭ 1,320 (+1100%)
Mutual labels:  picture
Academic Drawing
Providing codes (including Matlab and Python) for visualizing numerical experiment results.
Stars: ✭ 110 (+0%)
Mutual labels:  heatmap
Gis
gis (go image server) go 实现的图片服务,实现基本的上传,下载,存储,按比例裁剪等功能
Stars: ✭ 108 (-1.82%)
Mutual labels:  picture
Tinyraycaster
486 lines of C++: old-school FPS in a weekend
Stars: ✭ 1,383 (+1157.27%)
Mutual labels:  picture

Btrfs Heatmap

The btrfs heatmap script creates a visualization of how a btrfs filesystem is using the underlying disk space of the block devices that are added to it.

What does it look like?

238GiB file system
filesystem

This picture shows the 238GiB filesystem in my computer at work. It was generated using the command btrfs-heatmap --size 9 /, resulting in a 512x512 pixel png. The black parts are unallocated disk space. Raw disk space that is allocated to be used for data (white), metadata (blue) or system (red) gets brighter if the fill factor of block groups is higher.

How do I create a picture like this of my own computer?

Well, first install the program. It's probably available as package 'btrfs-heatmap' in your favourite Linux distro.

When pointing btrfs-heatmap to a mounted btrfs filesystem location, it will ask the linux kernel for usage information and build a png picture reflecting that low level information. Because the needed information is retrieved using the btrfs kernel API, it has to be run as root user:

-$ sudo btrfs-heatmap /mountpoint

I have a picture now, with quite a long filename, why?

The filename of the png picture is a combination of the filesystem ID and a timestamp by default, so that if you create multiple of them, they nicely pile up as input for creating a timelapse video.

Creating multiple ones is as easy as doing watch 'btrfs-heatmap /mountpoint'

Can I directly view the resulting image?

Yes! For this, output to stdout can be used. When using a dash as output filename (-o -), the resulting png data is written to stdout directly, which can be connected to an image viewer like catimg for displaying the image right away in a terminal screen using ansi color codes. For a pop up window, a program like feh can be used.

A typical use case for using this functionality and catimg is to conveniently view results on a remote server without having to copy resulting png files around.

Where's what? In what corner is the first or last byte located?

By default, the ordering inside the picture is based on a Hilbert Curve. The lowest physical address of the block devices is located in the bottom left corner. From there it walks up, to the right and down again.

Hilbert Curve Example Image
Hilbert Curve Mekker

In btrfs technical terms speaking, what does it display?

The picture that is generated by default shows the physical address space of a filesystem, by walking all dev extents of all devices in the filesystem using the search ioctl and concatenating all information into a single big image. The usage values are computed by looking up usage counters in the block group items from the extent tree.

It's also possible to have the picture sorted by btrfs virtual address space instead, or to create pictures of the contents of block groups, on extent level. For more information, see links to additional documentation below.

How do I create a timelapse movie out of this?

Here's an example command to create an mp4 video out of all the png files if you create multiple ones over time:

ffmpeg -framerate 2 -pattern_type glob -i '*.png' -c:v libx264 -r 25 -pix_fmt yuv420p btrfs-heatmap.mp4

By varying the -framerate option, you can make the video go faster or slower.

Another option is to create an animated gif. By varying the -delay option, you change the speed.

convert -layers optimize-frame -loop 0 -delay 20 *.png btrfs-heatmap.gif

The next picture is an animated gif of running btrfs balance on the data of the filesystem which the first picture was also taken of. You can see how all free space is defragmented by packing data together:

btrfs balance
animated gif balance

More documentation and advanced usage

Feedback

Let me know if this program was useful for you, or if you have brilliant ideas about how to improve it.

You can reach me on IRC in #btrfs on Freenode (I'm Knorrie), use the github issue system or send me an email on [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].