DMFILEMAPD(8)
π DMFILEMAPD(8) π
okay so this is the dmfilemapd page, bestie β the device-mapper filemap monitoring daemon, and yes she is iconic for it π
β¨ SYNOPSIS β¨
dmfilemapd file_descriptor group_id abs_path inode|path [foreground
[verbose]]
πΈ DESCRIPTION πΈ
Okay so listen: the dmfilemapd daemon is out here monitoring groups of dmstats(8) regions that correspond to the extents of a file, and she's literally adding and removing regions so everything reflects the changing state of the file on-disk. It's giving diligent. It's giving on top of it. π
Usually the daemon gets launched automatically by the dmstats create command, but bestie, you can run it manually β either to create a new daemon where one didn't previously exist, or to change the options that were previously used, by killing the existing daemon and starting a new one. Lowkey love that for us. β¨
π OPTIONS π
file_descriptorβ Specify the file descriptor number for the file to be monitored, okay? The file descriptor must reference a regular file, open for reading, in a local file system that supports theFIEMAPioctl, and that returns data describing the physical location of extents. Fr fr, those are the rules. And heads up: the process that executesdmfilemapdis responsible for opening the file descriptor that is handed to the daemon. No passing off the responsibility, bestie. π«Άgroup_idβ Thedmstatsgroup identifier of the group thatdmfilemapdshould update. The group must exist and it should correspond to a set of regions created by a previous filemap operation. Like, don't just make up a group ID, okay? It has to actually be there. πabs_pathβ The absolute path to the file being monitored, at the time that it was opened. The use ofabs_pathby the daemon differs, depending on the filemap following mode in use; see MODES and themodeoption for more information. Iykyk. πinode|pathβ The filemap monitoring mode the daemon. Use eitherinode(DM_FILEMAP_FOLLOW_INODE), orpath(DM_FILEMAP_FOLLOW_PATH), to enable follow-inode or follow-path mode respectively. Pick your fighter, bestie. π[foreground]β If set to1, disable forking and allow the daemon to run in the foreground. She stays right there with you. π[verbose]β Control daemon logging. If set to zero, the daemon will close all stdio streams and run silently. Ifverboseis a number between1and3, stdio will be retained and the daemon will log messages to stdout and stderr that match the specified verbosity level. So like, 1-3 is chatty, 0 is stealth mode. π€«
π¦ 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. Bestie, this is important, don't skip it. β¨
In both modes, the daemon will always shut down when the group being monitored is deleted. Periodt. π
π Follow inode
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.
This mode is useful if the file is expected to be renamed, or moved within the file system, while it is being monitored. Like, she'll follow that inode anywhere. Obsessed. π§
π Follow path
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).
This mode is useful if the file is updated by unlinking the original and placing a new file at the same path. Swap the file out, she'll find the new one. Slay. π₯
π LIMITATIONS π
Okay so ngl, there are some caveats and I need you to hear them. The daemon attempts to maintain good synchronization 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 dd program). So like, some events just get away. It's not her fault. π
There is a further loss of events in that there is currently no way to atomically resize a dmstats 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. RIP to those events, fr fr. π
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. So like, watch this space, bestie. π
π EXAMPLES π
Normally the daemon is started automatically by the dmstats create or update_filemap commands but it can be run manually for debugging or testing purposes. Cute. Let's go. π
Start the daemon in the background, in follow-path mode:
# dmfilemapd 3 0 /srv/images/vm.img path 0 0 3< /srv/images/vm.img
Start the daemon in follow-inode mode, disable forking and enable verbose logging:
# dmfilemapd 3 0 /var/tmp/data inode 1 3 3< /var/tmp/data
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: initialized flags to 4000000000000
starting stats walk with GROUP
exiting _filemap_monitor_get_events() with deleted=0, check=0
Waiting for check interval
Look at her go. Main character energy, honestly. π
π AUTHORS π
Bryn M. Reeves <bmr@redhat.com> β thank you for your service, king. π«‘
π SEE ALSO π
dmstats(8)- LVM2 resource page:
https://www.sourceware.org/lvm2 - Device-mapper resource page:
http://sources.redhat.com/dm
This page is from Linux, dated Dec 17 2016 β and that's the whole vibe, bestie. Stay mapped, stay monitored, and don't forget to check your extents. xoxo πβ¨ππ¦πΈπ
π«Άππ₯ππβππππ§π
π¦ where this page comes from
- opensuse-leap 16.0: device-mapper 2.03.29_1.02.203-160000.3.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: device-mapper 2.03.29_1.02.203-160000.3.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: device-mapper 2.03.29_1.02.203-160000.3.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: device-mapper 2.03.29_1.02.203-160000.3.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms