Expand description
§btrfs-cli: the btrfs command-line tool
This crate provides the btrfs command-line binary, an alternative
implementation of btrfs-progs written in Rust. It is built on top of btrfs-uapi for kernel communication,
btrfs-disk for direct on-disk structure parsing, and btrfs-stream for
send/receive stream processing.
Not all commands from btrfs-progs are implemented yet. Run btrfs help to
see what is available. Most commands require root privileges or
CAP_SYS_ADMIN.
§Stability
This is a pre-1.0 release. Read-only commands are stable. The
mutating commands that go through the new btrfs-transaction
crate (offline filesystem resize, the rescue subcommands,
and the tune conversions when built with the tune feature)
are experimental and may have edge cases that testing doesn’t
cover. Take a backup before running them on filesystems you
care about.
Structs§
- Arguments
- User-space command-line tool for managing Btrfs filesystems.
- Balance
Cancel Command - Cancel a running balance operation
- Balance
Command - Balance data across devices, or change block groups using filters.
- Balance
Pause Command - Pause a running balance operation
- Balance
Resume Command - Resume a paused balance operation
- Balance
Start Command - Balance chunks across the devices
- Balance
Status Command - Show status of running or paused balance operation.
- Check
Command - Check structural integrity of a filesystem (unmounted).
- Device
AddCommand - Add one or more devices to a mounted filesystem
- Device
Command - Manage devices in a btrfs filesystem.
- Device
Ready Command - Check whether all devices of a multi-device filesystem are present
- Device
Remove Command - Remove one or more devices from a mounted filesystem
- Device
Scan Command - Scan or unregister devices for multi-device btrfs filesystems
- Device
Stats Command - Show device I/O error statistics for all devices of a filesystem
- Device
Usage Command - Show detailed information about internal allocations in devices
- Dump
Super Command - Dump the btrfs superblock from a device or image file.
- Dump
Tree Command - Dump tree blocks from a btrfs device or image file.
- Filesystem
Command - Overall filesystem tasks and information.
- Filesystem
Commit Stats Command - Show commit statistics for a mounted filesystem
- Filesystem
Defrag Command - Defragment files or directories on a btrfs filesystem
- Filesystem
DfCommand - Show space usage information for a mounted filesystem
- Filesystem
DuCommand - Summarize disk usage of each file, showing shared extents
- Filesystem
Label Command - Get or set the label of a btrfs filesystem
- Filesystem
Mkswapfile Command - Create a swapfile on a btrfs filesystem
- Filesystem
Resize Command - Resize a mounted btrfs filesystem
- Filesystem
Show Command - Show information about one or more mounted or unmounted filesystems
- Filesystem
Sync Command - Force a sync on a mounted filesystem
- Filesystem
Usage Command - Show detailed information about internal filesystem usage
- Global
Options - Flags shared across all subcommands (verbosity, dry-run, output format).
- Inode
Resolve Command - Get file system paths for the given inode
- Inspect
Command - Query various internal filesystem information.
- List
Chunks Command - List all chunks in the filesystem, one row per stripe
- Logical
Resolve Command - Get file system paths for the given logical address
- MapSwapfile
Command - Print physical offset of first block and resume offset if file is suitable as swapfile.
- MinDev
Size Command - Print the minimum size a device can be shrunk to.
- Parsed
Subvolume Flags - Wrapper around
SubvolumeFlagsthat implementsFromStrfor clap parsing. - Property
Command - Modify properties of filesystem objects.
- Property
GetCommand - Get a property value of a btrfs object
- Property
List Command - List available properties with their descriptions for the given object
- Property
SetCommand - Set a property on a btrfs object
- Qgroup
Assign Command - Assign a qgroup as the child of another qgroup
- Qgroup
Clear Stale Command - Clear all stale qgroups (level 0/subvolid) without a subvolume
- Qgroup
Command - Manage quota groups.
- Qgroup
Create Command - Create a subvolume quota group
- Qgroup
Destroy Command - Destroy a quota group
- Qgroup
Limit Command - Set limits on a subvolume quota group
- Qgroup
Remove Command - Remove the relation between child qgroup SRC and DST
- Qgroup
Show Command - List subvolume quota groups
- Quota
Command - Manage filesystem quota settings.
- Quota
Disable Command - Disable subvolume quota support for a filesystem
- Quota
Enable Command - Enable subvolume quota support for a filesystem
- Quota
Rescan Command - Trash all qgroup numbers and scan the metadata again
- Quota
Status Command - Show status information about quota on the filesystem
- Receive
Command - Receive subvolumes from a stream.
- Replace
Cancel Command - Cancel a running device replace operation.
- Replace
Command - Replace a device in the filesystem.
- Replace
Start Command - Replace a device in the filesystem.
- Replace
Status Command - Print status of a running device replace operation.
- Rescue
Chunk Recover Command - Recover the chunk tree by scanning the devices one by one
- Rescue
Clear InoCache Command - Remove leftover items pertaining to the deprecated inode cache feature
- Rescue
Clear Space Cache Command - Completely remove the v1 or v2 free space cache
- Rescue
Clear Uuid Tree Command - Delete uuid tree so that kernel can rebuild it at mount time
- Rescue
Command - Toolbox for specific rescue operations.
- Rescue
Create Control Device Command - Create /dev/btrfs-control
- Rescue
FixData Checksum Command - Fix data checksum mismatches
- Rescue
FixDevice Size Command - Re-align device and super block sizes
- Rescue
Super Recover Command - Recover bad superblocks from good copies
- Rescue
Zero LogCommand - Clear the tree log (usable if it’s corrupted and prevents mount)
- Restore
Command - Try to restore files from a damaged filesystem (unmounted).
- Rootid
Command - Get tree ID of the containing subvolume of path
- RunContext
- Runtime context passed to every command.
- Scrub
Cancel Command - Cancel a running scrub
- Scrub
Command - Verify checksums of data and metadata.
- Scrub
Limit Command - Show or set the per-device scrub throughput limit
- Scrub
Resume Command - Resume a previously cancelled or interrupted scrub
- Scrub
Start Command - Start a new scrub on the filesystem or a device.
- Scrub
Status Command - Show the status of a running or finished scrub
- Send
Command - Send the subvolume(s) to stdout.
- SortKey
- A sort key with direction.
- Sort
Keys - Comma-separated list of sort keys (e.g. “rfer,-excl”).
- Subvolid
Resolve Command - Resolve the path of a subvolume given its ID
- Subvolume
Command - Create, delete, list, and manage btrfs subvolumes and snapshots.
- Subvolume
Create Command - Create a new subvolume at each given path.
- Subvolume
Delete Command - Delete one or more subvolumes or snapshots.
- Subvolume
Find NewCommand - List the recently modified files in a subvolume
- Subvolume
GetDefault Command - Show the default subvolume of a filesystem
- Subvolume
GetFlags Command - Show the flags of a subvolume
- Subvolume
List Command - List subvolumes and snapshots in the filesystem
- Subvolume
SetDefault Command - Set the default subvolume of a filesystem.
- Subvolume
SetFlags Command - Set the flags of a subvolume
- Subvolume
Show Command - Show detailed information about a subvolume
- Subvolume
Snapshot Command - Create a snapshot of a subvolume
- Subvolume
Sync Command - Wait until given subvolume(s) are completely removed from the filesystem
- Tree
Stats Command - Print statistics about trees in a btrfs filesystem
- Unit
Mode - Unit display mode flags, shared by subcommands that output sizes.
Enums§
- Balance
Subcommand - Check
Mode - Check mode for filesystem verification.
- Chunk
RowHeader - Command
- DevRow
Header - Device
Subcommand - DfRow
Header - DuRow
Header - DuSort
- Sort order for entries within each directory.
- Filesystem
Subcommand - Format
- Output format for commands that support structured output.
- GenFilter
- A generation filter: exact match, >= (plus), or <= (minus).
- Inspect
Subcommand - Level
- Log verbosity level, ordered from most to least verbose.
- Overall
RowHeader - Profile
RowHeader - Property
Object Type - Object type for property operations
- Property
Subcommand - Qgroup
Limit Size - A size limit that is either a byte count or “none” to remove the limit.
- Qgroup
RowHeader - Qgroup
Subcommand - Quota
Subcommand - Replace
Subcommand - Rescue
Subcommand - Scrub
RawRow Header - Scrub
Result RowHeader - Scrub
RowHeader - Scrub
Subcommand - Space
Cache Version - Free space cache version to clear.
- Stats
RowHeader - Status
RowHeader - Subvol
RowHeader - Subvolume
Subcommand - Usage
RowHeader
Traits§
- Command
Group - A command group that delegates to a leaf subcommand.
- Runnable
- A CLI subcommand that can be executed.