6 Commits

Author SHA1 Message Date
Kent Overstreet
3321afc8b6 cmd_image_update
New tool: 'bcachefs image update', for updating images produced by
'bcachefs image create': this tool will update images while making the
minimal changes to the on disk image, to make tools like casync more
efficient.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-12 19:49:55 -04:00
Kent Overstreet
c1a25673e9 cmd_image: finish_image()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-12 19:49:41 -04:00
Kent Overstreet
b02c3e9682 posix_to_bcachefs: cleanup
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-12 19:49:41 -04:00
Kent Overstreet
f9d8d2c51d cmd_image: hook up c->loglevel
Quieter output.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-12 19:49:41 -04:00
Kent Overstreet
a0f12e09b6 cmd_image: Flush journal before moving btree
We need the key cache to be flushed before moving btree nodes - key
cache flushing won't obey the target we're moving btree nodes to.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-07 19:54:48 -04:00
Kent Overstreet
45f6fe0a14 cmd_image_create
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Add a tool for creating small image files.

Data is written out in a reproducible order, sequentially from the
start of the device.

Metadata is initially written to a temporary device, then after writing
out data, the metadata we want to keep (alloc info is left out by
default) is migrated to the real device.

Then, the image file is trimmed to minimum size and the temporary
metadata device dropped.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-20 17:16:33 -04:00