Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [Comparing Snapshots](./commands/backup/comparing_snapshots.md)
- [Special Items and Metadata](./commands/backup/special_items_metadata.md)
- [Reading data from StdIn](./commands/backup/reading_stdin.md)
- [Backup Block Devices](./commands/backup/blockdev.md)
- [Tags](./commands/backup/tags.md)
- [Scheduling](./commands/backup/scheduling.md)
- [Space requirements](./commands/backup/space_requirements.md)
Expand Down
31 changes: 31 additions & 0 deletions src/commands/backup/blockdev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Backup block devices

Special files like block devices or pipes are by default stored by only the
metadata of the special file like a device number. This allows to restore
something like `/dev` on Unix platforms and to get the original state.

Sometimes, however, you want to backup the contents of block device, e.g. a
snapshot of a disc. To do so, rustic supports the `set-devid` options. You can
define it in the config file:

```toml
[[backup.snapshots]]
sources = ["/dev/my-blockdev"]
set-blockdev = "file"
```

or directly on the command line

```console
rustic backup --set-blockdev=file /dev/my-blockdev
```

Note that for blockdevices, a fixed sized chunking with chunksize being a
multiple of the block size is recommended as this speeds-up the backup from
large single files and also good chunking points are typically on block
boundaries for block devices. Fixed size chunking can be set e.g. during
repository initalization, for example:

```console
rustic init --set-chunker=fixed_size --set-chunk-size=1MiB
```