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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
.TH xfs_spaceman 8
.SH NAME
xfs_spaceman \- show free space information about an XFS filesystem
.SH SYNOPSIS
.B xfs_spaceman
[
.B \-c
.I cmd
]
.I file
.br
.B xfs_spaceman \-V
.SH DESCRIPTION
.B xfs_spaceman
reports and controls free space usage in an XFS filesystem.
.SH OPTIONS
.TP 1.0i
.BI \-c " cmd"
.B xfs_spaceman
commands may be run interactively (the default) or as arguments on
the command line. Multiple
.B \-c
arguments may be given. The commands are run in the sequence given,
then the program exits.
.SH COMMANDS
.TP
.BI "freesp [ \-dgrs ] [-a agno]... [ \-b | \-e bsize | \-h bsize | \-m factor ]"
With no arguments,
.B freesp
shows a histogram of all free space extents in the filesystem.
The command takes the following options:
.RS 1.0i
.PD 0
.TP 0.4i
.B \-a agno
Collect free space information from this allocation group.
This option can be specified multiple times to collect from multiple groups.
.TP
.B \-b
This argument establishes that the histogram bin sizes are successive powers of two.
This is the default, and is mutually exclusive with the
.BR "-e" ", " "-h" ", and " "-m" " options."
.TP
.B \-d
Print debugging information such as the raw free space extent information.
.TP
.B \-g
Print the free space block and extent counts for each AG.
.TP
.B \-e bsize
Set all histogram bin sizes to a specific value.
This option is mutually exclusive with the
.BR "-b" ", " "-h" ", and " "-m" " options."
.TP
.B \-h bsize
Create a histogram bin with a lower bound of this value.
The upper bound of this bin will be one less than the lower bound of the
next highest histogram bin.
This option can be given multiple times to control the exact bin sizes.
This option is mutually exclusive with the
.BR "-b" ", " "-e" ", and " "-m" " options."
.TP
.B \-m factor
Create each histogram bin with a size that is this many times the size
of the prvious bin created.
This option is mutually exclusive with the
.BR "-b" ", " "-e" ", and " "-h" " options."
.TP
.B \-r
Query the realtime device for free space information.
.TP
.B \-s
Display a summary of the free space information found.
.PD
.RE
.TP
.B info
Displays selected geometry information about the filesystem.
The opened file must be a mount point of a XFS filesystem.
The output will have the same format that
.BR "xfs_info" "(8)"
prints when querying a filesystem.
.TP
.BI "health [ \-a agno] [ \-c ] [ \-f ] [ \-i inum ] [ \-q ] [ paths ]"
Reports the health of the given group of filesystem metadata.
.RS 1.0i
.PD 0
.TP 0.4i
.B \-a agno
Report on the health of the given allocation group.
.TP
.B \-c
Scan all inodes in the filesystem and report each file's health status.
If the
.B \-a
option is given, scan only the inodes in that AG.
.TP
.B \-f
Report on the health of metadata that affect the entire filesystem.
.TP
.B \-i inum
Report on the health of a specific inode.
.TP
.B \-q
Report only unhealthy metadata.
.TP
.B paths
Report on the health of the files at the given path.
.PD
.RE
.TP
.BR "help [ " command " ]"
Display a brief description of one or all commands.
.TP
.BI "prealloc [ \-u id ] [ \-g id ] [ -p id ] [ \-m minlen ] [ \-s ]"
Removes speculative preallocation.
If no
.BR "-u" ", " "-g" ", or " "-p"
options are given, this command acts on all files.
The command takes the following options:
.RS 1.0i
.PD 0
.TP 0.4i
.B \-u uid
Clear all speculative preallocations for files with this user id.
This option can be given in combination with the
.B "-g" " and " "-p"
options.
.TP
.B \-g gid
Clear all speculative preallocations for files with this group id.
This option can be given in combination with the
.B "-u" " and " "-p"
options.
.TP
.B \-p pid
Clear all speculative preallocations for files with this project id.
This option can be given in combination with the
.B "-u" " and " "-g"
options.
.TP
.B \-m minlen
Ignore all files smaller than this size.
Units can be supplied for this argument.
.TP
.B \-s
Wait for removal to complete.
.PD
.RE
.TP
.B print
Display a list of all open files.
.TP
.B quit
Exit
.BR xfs_spaceman .
.TP
.BI "trim ( \-a agno | \-f | " "offset" " " "length" " ) [ -m minlen ]"
Instructs the underlying storage device to release all storage that may
be backing free space in the filesystem.
The command takes the following options:
(One of
.BR -a ", " -f ", or the "
.IR offset / length
pair are required.)
.RS 1.0i
.PD 0
.TP 0.4i
.B \-a agno
Trim free space extents in the given allocation group.
This option is mutually exclusive with the
.BR "-f" " option and the "
.IR "offset" "/" "length" " options."
.TP
.B \-f
Trim all free space in the filesystem.
This option is mutually exclusive with the
.BR "-a" " option and the "
.IR "offset" "/" "length" " options."
.TP
.IR "option" ", " "length"
Trim all free space within the physical range defined by the
.I offset
and
.I length
from this filesystem.
Units can be appended to these arguments.
This option is mutually exclusive with the
.BR "-a" " and " "-f" " options."
.TP
.B \-m minlen
Do not trim free space extents shorter than this length.
Units can be appended to this argument.
.PD
.RE
|