summaryrefslogtreecommitdiff
path: root/man/dmfilemapd.8_main
blob: e317166b6d3f0acb572406b04cb6ee5af713d019 (plain)
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
.TH DMFILEMAPD 8 "Dec 17 2016" "Linux" "MAINTENANCE COMMANDS"
.
.de OPT_FD
.  I file_descriptor
..
.
.de OPT_GROUP
.  I group_id
..
.
.de OPT_PATH
.  I abs_path
..
.
.de OPT_MODE
.  BR inode | path
..
.
.de OPT_DEBUG
.  RI [ foreground " [" verbose ]]
..
.
.SH NAME
.
dmfilemapd \(em device-mapper filemap monitoring daemon
.
.SH SYNOPSIS
.
.de CMD_DMFILEMAPD
.  ad l
.  nh
.  BR dmfilemapd
.  OPT_FD
.  OPT_GROUP
.  OPT_PATH
.  OPT_MODE
.  OPT_DEBUG
.  hy
.  ad b
..
.CMD_DMFILEMAPD
.
.PD
.
.SH DESCRIPTION
.
The dmfilemapd daemon monitors groups of \fBdmstats\fP(8) regions that
correspond to the extents of a file, adding and removing regions to
reflect the changing state of the file on-disk.
.P
The daemon is normally launched automatically by the \fBdmstats
create\fP command, but can be run manually, either to create a new
daemon where one did not previously exist, or to change the options
previously used, by killing the existing daemon and starting a new
one.
.
.SH OPTIONS
.
.TP
.OPT_FD
Specify the file descriptor number for the file to be monitored.
The file descriptor must reference a regular file, open for reading,
in a local file system that supports the FIEMAP ioctl, and that
returns data describing the physical location of extents.
.sp
The process that executes \fBdmfilemapd\fP is responsible for
opening the file descriptor that is handed to the daemon.
.
.TP
.OPT_GROUP
The \fBdmstats\fP group identifier of the group that \fBdmfilemapd\fP
should update. The group must exist and it should correspond to
a set of regions created by a previous filemap operation.
.
.TP
.OPT_PATH
The absolute path to the file being monitored, at the time that
it was opened. The use of \fIabs_path\fP by the daemon differs,
depending on the filemap following mode in use; see \fBMODES\fP
and the \fImode\fP option for more information.
.
.TP
.OPT_MODE
The filemap monitoring mode the daemon.
Use either
.B inode
(\fBDM_FILEMAP_FOLLOW_INODE\fP), or
.B path
(\fBDM_FILEMAP_FOLLOW_PATH\fP), to enable follow-inode or
follow-path mode respectively.
.
.TP
.RI [ foreground ]
.br
If set to 1, disable forking and allow the daemon to run in the
foreground.
.
.TP
.RI [ verbose ]
.br
Control daemon logging. If set to zero, the daemon will close all
stdio streams and run silently. If \fBverbose\fP is a number
between 1 and 3, stdio will be retained and the daemon will log
messages to stdout and stderr that match the specified verbosity
level.
.
.SH MODES
.
The file map monitoring daemon can monitor files in two distinct
ways: the mode affects the behaviour of the daemon when a file
under monitoring is renamed or unlinked, and the conditions which
cause the daemon to terminate.
.P
In both modes, the daemon will always shut down when the group
being monitored is deleted.
.P
.B Follow inode
.P
The daemon follows the inode of the file, as it was at the time the
daemon started. The file descriptor referencing the file is kept
open at all times, and the daemon will exit when it detects that
the file has been unlinked and it is the last holder of a reference
to the file.
.P
This mode is useful if the file is expected to be renamed, or moved
within the file system, while it is being monitored.
.P
.B Follow path
.P
The daemon follows the path that was given on the daemon command
line. The file descriptor referencing the file is re-opened on each
iteration of the daemon, and the daemon will exit if no file exists
at this location (a tolerance is allowed so that a brief delay
between removal and replacement is permitted).
.P
This mode is useful if the file is updated by unlinking the original
and placing a new file at the same path.
.
.SH LIMITATIONS
.
The daemon attempts to maintain good synchronisation between the file
extents and the regions contained in the group, however, since the
daemon can only react to new allocations once they have been written,
there are inevitably some IO events that cannot be counted when a
file is growing, particularly if the file is being extended by a
single thread writing beyond EOF (for example, the \fBdd\fP program).
.P
There is a further loss of events in that there is currently no way
to atomically resize a \fBdmstats\fP region and preserve its current
counter values. This affects files when they grow by extending the
final extent, rather than allocating a new extent: any events that
had accumulated in the region between any prior operation and the
resize are lost.
.P
File mapping is currently most effective in cases where the majority
of IO does not trigger extent allocation. Future updates may address
these limitations when kernel support is available.
.
.SH EXAMPLES
.
Normally the daemon is started automatically by the \fBdmstats\fP
\fBcreate\fP or \fBupdate_filemap\fP commands but it can be run
manually for debugging or testing purposes.
.P
Start the daemon in the background, in follow-path mode
.br
#
.B dmfilemapd 3 0 /srv/images/vm.img path 0 0 3< /srv/images/vm.img
.br
.P
Start the daemon in follow-inode mode, disable forking and enable
verbose logging
.br
.ad l
#
.B dmfilemapd 3 0 /var/tmp/data inode 1 3 3< /var/tmp/data
.nf
Starting dmfilemapd with fd=3, group_id=0 mode=inode, path=/var/tmp/data
dm version   [ opencount flush ]   [16384] (*1)
dm info   (253:0) [ opencount flush ]   [16384] (*1)
dm message   (253:0) [ opencount flush ]  @stats_list dmstats [16384] (*1)
Read alias 'data' from aux_data
Found group_id 0: alias="data"
dm_stats_walk_init: initialised flags to 4000000000000
starting stats walk with   GROUP
exiting _filemap_monitor_get_events() with deleted=0, check=0
Waiting for check interval
.fi
.ad b

.
.SH AUTHORS
.
Bryn M. Reeves <bmr@redhat.com>
.
.SH SEE ALSO
.
.BR dmstats (8)
.P
LVM2 resource page:
.UR https://www.sourceware.org/lvm2
.UE
.br
Device-mapper resource page:
.UR http://sources.redhat.com/dm
.UE