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 inode|path [foreground
10       [verbose]]
11

DESCRIPTION

13       The dmfilemapd daemon monitors groups of dmstats(8) 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  ex‐
28              tents.
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 abs_path by the daemon differs, de‐
41              pending on the filemap following mode in use; see MODES and  the
42              mode option for more information.
43
44       inode|path
45              The  filemap  monitoring  mode  the  daemon.   Use  either inode
46              (DM_FILEMAP_FOLLOW_INODE), or path (DM_FILEMAP_FOLLOW_PATH),  to
47              enable follow-inode or follow-path mode respectively.
48
49       [foreground]
50              If  set to 1, disable forking and allow the daemon to run in the
51              foreground.
52
53       [verbose]
54              Control daemon logging. If set to zero, the  daemon  will  close
55              all  stdio  streams and run silently. If verbose is a number be‐
56              tween 1 and 3, stdio will be retained and the  daemon  will  log
57              messages to stdout and stderr that match the specified verbosity
58              level.
59

MODES

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

LIMITATIONS

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

EXAMPLES

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

AUTHORS

133       Bryn M. Reeves <bmr@redhat.com>
134

SEE ALSO

136       dmstats(8)
137
138       LVM2 resource page: ⟨https://www.sourceware.org/lvm2
139       Device-mapper resource page: ⟨http://sources.redhat.com/dm
140
141
142
143Linux                             Dec 17 2016                    DMFILEMAPD(8)
Impressum