How datto/dattobd works
Dattobd is a Linux kernel block driver for live copy-on-write snapshots and incremental backup tracking. The user workflow is to create a snapshot with dbdctl, copy the exposed snapshot device to an image, switch the driver to incremental tracking, and later create a new snapshot and apply changed blocks with update-img. The graph includes the documented control path and core tracing/storage layers. Some runtime wiring is unsampled, so uncertain links are omitted; the incremental-copy relationship is documented in the README.
Main entry points: tracer.c I/O Tracer · update-img.c update-img · ioctl_handlers.c IOCTL Handlers · cow_manager.c COW Manager
Components 17
User Control
- dbdctl
app/dbdctl.c - Control Library
lib/libdattobd.c
Kernel Driver
- IOCTL Handlers
src/ioctl_handlers.c - Device State
src/snap_device.h - I/O Tracer
src/tracer.c - Bio Processing
src/bio_helper.c - Block Device Access
src/blkdev.c - Mount State
src/bdev_state_handler.c
Snapshot Storage
- COW Manager
src/cow_manager.c - File Operations
src/filesystem.c - COW File
Backup Workflow
- Snapshot Device
src/snap_device.c - Image Copy
- update-img
utils/update-img.c - Backup Image
Other components
- Operator
- Linux Block I/O
Connections 19
- Operator → dbdctl: runs commands
- dbdctl → Control Library: calls API
app/dbdctl.c - Control Library → IOCTL Handlers: issues controls
- IOCTL Handlers → Device State: manages state
src/ioctl_handlers.c - IOCTL Handlers → COW Manager: configures COW
src/ioctl_handlers.c - I/O Tracer → Device State: uses state
src/tracer.c - I/O Tracer → COW Manager: uses mappings
src/tracer.c - I/O Tracer → Bio Processing: processes bios
src/tracer.c - I/O Tracer → Block Device Access: uses block devices
src/tracer.c - Mount State → Device State: checks devices
src/bdev_state_handler.c - COW Manager → File Operations: reads and writes
src/cow_manager.c - File Operations → COW File: accesses COW data
- Operator → Image Copy: copies snapshot
- Snapshot Device → Backup Image: copies image data
- Operator → update-img: runs update
- update-img → Snapshot Device: reads changed blocks
- update-img → COW File: reads block list
- update-img → Backup Image: updates image
- Linux Block I/O → I/O Tracer: submits I/O