btrfs-image
create/restore an image of the filesystem
- Provided by: btrfs-progs (Version: 6.17.1-1build1)
- Report a bug
create/restore an image of the filesystem
btrfs-image [options] <source> <target>
btrfs-image is used to create an image of a btrfs filesystem. All data will be zeroed, but metadata and the like is preserved. Mainly used for debugging purposes.
In the dump mode, source is the btrfs device/file and target is the output file (use - for stdout).
In the restore mode (option -r), source is the dumped image and target is the btrfs device/file.
One -s means just generate random garbage, which means that the directory hash won't match its file names. Using two -s will calculate a collision for the file name so that the hashes match, and if it can't calculate a collision then it will just generate garbage. The collision calculator is very time and CPU intensive.
btrfs-image will return 0 if no error happened. If any problems happened, 1 will be returned.