File: btrfs-usage-report.1

package info (click to toggle)
python-btrfs 15-1
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 620 kB
  • sloc: python: 4,772; makefile: 195
file content (69 lines) | stat: -rw-r--r-- 2,963 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.TH BTRFS\-USAGE\-REPORT 1 "2018" "" "Btrfs Usage Report"
.nh
.ad l

.SH "NAME"
btrfs\-usage\-report \- show a detailed usage report about your btrfs filesystem

.SH SYNOPSIS
.B btrfs\-usage\-report
[\fIargs\fR]
.IR mountpoint

.SH DESCRIPTION
The \fBbtrfs\-usage\-report\fR program shows a detailed report about how a
btrfs filesystem is using available disk space.

The filesystem to show information about needs to be online and mounted.
Because the needed information is retrieved using the btrfs kernel API, it has
to be run as root.

In a btrfs filesystem, raw storage is shared by data of different \fItypes\fR
(System, MetaData and Data) and \fIprofiles\fR (e.g. single, DUP, RAID1). Also,
a filesystem can have multiple block devices of different sizes attached. All
of this together confuses regular tools like \fIdf\fR, which will already fail
to show us how much free space we still have to add more data to the
filesystem.

The report will show information about:

- \fIPhysical\fR disk space usage. On this level we can see the amount of disk
space allocated for specific combinations of type and profile. E.g. 1GiB of
Data with profile RAID1 will show that two devices both store 1GiB of raw data,
because it is duplicated.

- \fIVirtual\fR disk space usage. The btrfs virtual address space shows the
amount of data we store disregarding the storage \fIprofile\fR. So, if we store
1GiB of data using a RAID1 profile, then the virtual address space shows we
have 1GiB of data, while the physical space usage will show up as 2GiB in
total. Note that when using compression, the virtual address space counts
compressed data instead of uncompressed data.

- Estimated \fIfree\fR virtual space left for use. By extrapolating the current
usage patterns, a prediction can be made that shows how much extra data can be
added to the filesystem. These are the values that you would like to have
\fIdf\fR show you.

- \fIUnallocatable\fR disk space, which is raw physical disk space that cannot
be used, either because allocations in the filesystem are unbalanced, or
because of having different sizes of devices attached. Additionally, it will
show us if disk space can be reclaimed for use by using \fIbtrfs balance\fR.
When converting between profiles, these values can quickly show you if the
conversion to another profile can actually be completed or not.

.SH OPTIONS
.TP
.BR \-h ", " \-\-help
Show the built\-in help message and exit.

.SH "SEE ALSO"

\fBbtrfs\-space\-calculator\fR is a program that can calculate the amount of
allocatable (and unallocatable) disk space based on a list of (maybe
differently sized) block devices and target profiles to use.

This program is an example of what can be done using the python-btrfs library.
Do not parse the output of this program, as it just displays data that is
readily available when using functionality from this library.

Source and documentation on github: https://github.com/knorrie/python-btrfs