mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-02 00:00:03 +03:00
9a9af6e9e6
The bcachefs sub-commands that are implemented in Rust (completions, list, and mount) had separate entrypoints and thus had some differences in behavior. This introduces a common entry point for the Rust sub-commands. This reduces duplicate boilerplate code like parsing argv and setting up logging, and will facilitate converting more sub-commands to Rust in the future. An immediate benefit is that this fixes an issue with `bcachefs list` not reporting errors: before: $ bcachefs list /dev/typo $ echo $? 0 after: $ bcachefs list /dev/typo ERROR - bcachefs_rust::cmd_list: Fatal error: "No such file or directory" $ echo $? 1 Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> |
||
---|---|---|
.. | ||
bch_bindgen | ||
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
README.md | ||
rustfmt.toml |
Usage
bcachefs-mount 0.1.0
Mount a bcachefs filesystem by its UUID
USAGE:
bcachefs-mount [OPTIONS] <uuid> <mountpoint>
FLAGS:
-h, --help
Prints help information
-V, --version
Prints version information
OPTIONS:
-o <options>
Mount options [default: ]
-p, --password <password>
Where the password would be loaded from.
Possible values are: "fail" - don't ask for password, fail if filesystem is encrypted; "wait" - wait for
password to become available before mounting; "ask" - prompt the user for password; [default: fail]
ARGS:
<uuid>
External UUID of the bcachefs filesystem
<mountpoint>
Where the filesystem should be mounted
Caveats
--password ask
is not yet implemented, but you can use--password wait
, and load the key withbcachefs unlock
.
Build
$ git submodule update --init --recursive
$ cargo build --release
Binary will be built in target/release/bcachefs-mount
Dependencies:
- rust
- blkid
- uuid
- liburcu
- libsodium
- zlib
- liblz4
- libzstd
- libkeyutils