16 Commits

Author SHA1 Message Date
Kent Overstreet
0f78d027d3 New reconcile commands
- bcachefs reconcile status
- bcachefs reconcile wait

These obsolete the commands

- bcachefs data rereplicate
- bcachefs data drop_extra_replicas
- bcachefs data job drop_extra_replicas
- bcachefs data job migrate

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-11-12 17:54:30 -05:00
Kent Overstreet
e65dd86e41 bcachefs undump
Some checks failed
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 our own version of 'qemu-img convert', which doesn't have the l1
table size limit or require fixing our missing reflink table.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-09-01 15:11:56 -04:00
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
60ec05df84 bcachefs recovery-passes
New subcommand for scheduling or descheduling recovery passes on an
unmounted filesystem.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-06 12:29:26 -04:00
Kent Overstreet
cdde2f1160 Add missing newline to bcachefs --help
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-06 11:26:15 -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
Kent Overstreet
f2d9a55b1b cmd_strip_alloc
Add a command for stripping allocation info for a filesystem.

This is primarily to test codepaths used by the new image creation tool.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-20 17:16:33 -04:00
Kent Overstreet
7b35cb1e4a reshuffle device_cmds(), data_cmds()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Integral
66c943be6c bcachefs-tools: add fs_usage & return -EINVAL when no matching subcommand
Add the missing usage function for "fs" subcommand; when no matching
subcommand exists, print the usage and return -EINVAL.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 12:51:18 -04:00
Integral
396545c2ea bcachefs-tools: hide FUSE in usage when BCACHEFS_FUSE disabled
When BCACHEFS_FUSE is disabled or not defined, FUSE section shouldn't
be displayed in bcachefs usage (--help).

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-28 11:12:32 -04:00
Kent Overstreet
64ce740ac6 cmd_recover_super: 'bcachefs recover-super'
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-Tests / nix-flake-check (push) Has been cancelled
New tool for scanning for backup superblocks, to recover when the
primary superblock + sb layout have been overwritten.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-17 14:28:10 -04:00
Kent Overstreet
3fcc955d00 Scrub
Implement 'bcachefs data scrub', frontend for
BCH_IOCTL_DATA.BCH_DATA_OP_scrub.

Takes a path to a device, mountpoint, or filesystem uuid. Can be run on
a specific device by passing a device, or if run on a filesystem scrubs
all devices in parallel.

Metadata only scrubbing is supported via -m.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-03 14:08:49 -05:00
Kent Overstreet
c4e25c6c3c bcachefs fs top
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-03 14:08:49 -05:00
Kent Overstreet
52b9e813bd Rename option commands
set-option	-> set-fs-option
setattr 	-> set-file-option

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-20 16:45:08 -04:00
Ryan Lahfa
76538fa923 feat(c_src): drop entirely subvolume subcommands
We get rid of it as we have now a pure Rust version.

Signed-off-by: Ryan Lahfa <bcachefs@lahfa.xyz>
2024-01-27 05:46:24 +01:00
Thomas Bertschinger
f5baaf48e3 move Rust sources to top level, C sources into c_src
This moves the Rust sources out of rust_src/ and into the top level.
Running the bcachefs executable out of the development tree is now:

$ ./target/release/bcachefs command
or
$ cargo run --profile release -- command

instead of "./bcachefs command".

Building and installing is still:

$ make && make install

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16 01:47:05 -05:00