1DMFILEMAPD(8)                MAINTENANCE COMMANDS                DMFILEMAPD(8)
2
3
4

NAME

6       dmfilemapd — device-mapper filemap monitoring daemon
7

SYNOPSIS

9       dmfilemapd [file_descriptor] [group_id] [abs_path] [mode] [fore‐
10       ground[verbose]]
11

DESCRIPTION

13       The dmfilemapd daemon monitors groups of dmstats  regions  that  corre‐
14       spond  to the extents of a file, adding and removing regions to reflect
15       the changing state of the file on-disk.
16
17       The daemon is normally launched automatically  by  the  dmstats  create
18       command,  but  can be run manually, either to create a new daemon where
19       one did not previously exist, or to change the options previously used,
20       by killing the existing daemon and starting a new one.
21

OPTIONS

23       file_descriptor
24              Specify the file descriptor number for the file to be monitored.
25              The file descriptor must reference  a  regular  file,  open  for
26              reading,  in a local file system that supports the FIEMAP ioctl,
27              and that  returns  data  describing  the  physical  location  of
28              extents.
29
30              The  process that executes dmfilemapd is responsible for opening
31              the file descriptor that is handed to the daemon.
32
33       group_id
34              The dmstats group identifier of the group that dmfilemapd should
35              update.  The  group must exist and it should correspond to a set
36              of regions created by a previous filemap operation.
37
38       abs_path
39              The absolute path to the file being monitored, at the time  that
40              it  was opened. The use of path by the daemon differs, depending
41              on the filemap following mode in use; see  MODES  and  the  mode
42              option for more information.
43
44
45       mode
46              The  filemap  monitoring  mode  the  daemon  should  use: either
47              "inode" (DM_FILEMAP_FOLLOW_INODE),  or  "path"  (DM_FILEMAP_FOL‐
48              LOW_PATH),  to  enable  follow-inode or follow-path mode respec‐
49              tively.
50
51       [foreground]
52              If set to 1, disable forking and allow the daemon to run in  the
53              foreground.
54
55       [verbose] Control daemon logging. If set to zero, the daemon will close
56              all stdio streams and run  silently.  If  verbose  is  a  number
57              between  1 and 3, stdio will be retained and the daemon will log
58              messages to stdout and stderr that match the specified verbosity
59              level.
60

MODES

62       The  file map monitoring daemon can monitor files in two distinct ways:
63       the mode affects the behaviour of the daemon when a file under monitor‐
64       ing  is  renamed or unlinked, and the conditions which cause the daemon
65       to terminate.
66
67       In both modes, the daemon will always shut down when  the  group  being
68       monitored is deleted.
69
70
71       Follow inode
72
73       The  daemon  follows  the  inode of the file, as it was at the time the
74       daemon started. The file descriptor referencing the file is  kept  open
75       at  all  times,  and the daemon will exit when it detects that the file
76       has been unlinked and it is the last holder of a reference to the file.
77
78       This mode is useful if the file is expected to  be  renamed,  or  moved
79       within the file system, while it is being monitored.
80
81
82       Follow path
83
84       The  daemon follows the path that was given on the daemon command line.
85       The file descriptor referencing the file is re-opened on each iteration
86       of the daemon, and the daemon will exit if no file exists at this loca‐
87       tion (a tolerance is allowed so that a brief delay between removal  and
88       replacement is permitted).
89
90       This  mode  is  useful if the file is updated by unlinking the original
91       and placing a new file at the same path.
92

LIMITATIONS

94       The daemon attempts to maintain good synchronisation between  the  file
95       extents and the regions contained in the group, however, since the dae‐
96       mon can only react to new allocations  once  they  have  been  written,
97       there  are inevitably some IO events that cannot be counted when a file
98       is growing, particularly if the file is  being  extended  by  a  single
99       thread writing beyond EOF (for example, the dd program).
100
101       There  is a further loss of events in that there is currently no way to
102       atomically resize a dmstats region and  preserve  its  current  counter
103       values.  This  affects  files  when  they  grow  by extending the final
104       extent, rather than allocating a new extent: any events that had  accu‐
105       mulated  in  the  region between any prior operation and the resize are
106       lost.
107
108       File mapping is currently most effective in cases where the majority of
109       IO does not trigger extent allocation. Future updates may address these
110       limitations when kernel support is available.
111

EXAMPLES

113       Normally the daemon is started automatically by the dmstats  create  or
114       update_filemap  commands  but  it  can be run manually for debugging or
115       testing purposes.
116
117       Start the daemon in the background, in follow-path mode
118       # dmfilemapd 3 0 /srv/images/vm.img path 0 0 3< /srv/images/vm.img
119
120       Start the daemon in follow-inode mode, disable forking and enable  ver‐
121       bose logging
122       # dmfilemapd 3 0 /var/tmp/data inode 1 3 3< /var/tmp/data
123       Starting     dmfilemapd     with     fd=3,    group_id=0    mode=inode,
124       path=/var/tmp/data
125       dm version   [ opencount flush ]   [16384] (*1)
126       dm info   (253:0) [ opencount flush ]   [16384] (*1)
127       dm message   (253:0) [ opencount flush ]  @stats_list  dmstats  [16384]
128       (*1)
129       Read alias 'data' from aux_data
130       Found group_id 0: alias="data"
131       dm_stats_walk_init: initialised flags to 4000000000000
132       starting stats walk with   GROUP
133       exiting _filemap_monitor_get_events() with deleted=0, check=0
134       Waiting for check interval
135

AUTHORS

137       Bryn M. Reeves <bmr@redhat.com>
138

SEE ALSO

140       dmstats(8)
141
142       LVM2 resource page: https://www.sourceware.org/lvm2/
143       Device-mapper resource page: http://sources.redhat.com/dm/
144
145
146
147Linux                             Dec 17 2016                    DMFILEMAPD(8)
Impressum