Skip to main content

Crate btrfs_cli

Crate btrfs_cli 

Source
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.

Structs§

Arguments
User-space command-line tool for managing Btrfs filesystems.
BalanceCancelCommand
Cancel a running balance operation
BalanceCommand
Balance data across devices, or change block groups using filters.
BalancePauseCommand
Pause a running balance operation
BalanceResumeCommand
Resume a paused balance operation
BalanceStartCommand
Balance chunks across the devices
BalanceStatusCommand
Show status of running or paused balance operation.
CheckCommand
Check structural integrity of a filesystem (unmounted).
DeviceAddCommand
Add one or more devices to a mounted filesystem
DeviceCommand
Manage devices in a btrfs filesystem.
DeviceReadyCommand
Check whether all devices of a multi-device filesystem are present
DeviceRemoveCommand
Remove one or more devices from a mounted filesystem
DeviceScanCommand
Scan or unregister devices for multi-device btrfs filesystems
DeviceStatsCommand
Show device I/O error statistics for all devices of a filesystem
DeviceUsageCommand
Show detailed information about internal allocations in devices
DumpSuperCommand
Dump the btrfs superblock from a device or image file.
DumpTreeCommand
Dump tree blocks from a btrfs device or image file.
FilesystemCommand
Overall filesystem tasks and information.
FilesystemCommitStatsCommand
Show commit statistics for a mounted filesystem
FilesystemDefragCommand
Defragment files or directories on a btrfs filesystem
FilesystemDfCommand
Show space usage information for a mounted filesystem
FilesystemDuCommand
Summarize disk usage of each file, showing shared extents
FilesystemLabelCommand
Get or set the label of a btrfs filesystem
FilesystemMkswapfileCommand
Create a swapfile on a btrfs filesystem
FilesystemResizeCommand
Resize a mounted btrfs filesystem
FilesystemShowCommand
Show information about one or more mounted or unmounted filesystems
FilesystemSyncCommand
Force a sync on a mounted filesystem
FilesystemUsageCommand
Show detailed information about internal filesystem usage
GlobalOptions
InodeResolveCommand
Get file system paths for the given inode
InspectCommand
Query various internal filesystem information.
ListChunksCommand
List all chunks in the filesystem, one row per stripe
LogicalResolveCommand
Get file system paths for the given logical address
MapSwapfileCommand
Print physical extents of a file suitable for swap
MinDevSizeCommand
Print the minimum size a device can be shrunk to.
ParsedSubvolumeFlags
Wrapper around SubvolumeFlags that implements FromStr for clap parsing.
PropertyCommand
Modify properties of filesystem objects.
PropertyGetCommand
Get a property value of a btrfs object
PropertyListCommand
List available properties with their descriptions for the given object
PropertySetCommand
Set a property on a btrfs object
QgroupAssignCommand
Assign a qgroup as the child of another qgroup
QgroupClearStaleCommand
Clear all stale qgroups (level 0/subvolid) without a subvolume
QgroupCommand
Manage quota groups.
QgroupCreateCommand
Create a subvolume quota group
QgroupDestroyCommand
Destroy a quota group
QgroupLimitCommand
Set limits on a subvolume quota group
QgroupRemoveCommand
Remove the relation between child qgroup SRC and DST
QgroupShowCommand
List subvolume quota groups
QuotaCommand
Manage filesystem quota settings.
QuotaDisableCommand
Disable subvolume quota support for a filesystem
QuotaEnableCommand
Enable subvolume quota support for a filesystem
QuotaRescanCommand
Trash all qgroup numbers and scan the metadata again
QuotaStatusCommand
Show status information about quota on the filesystem
ReceiveCommand
Receive subvolumes from a stream.
ReplaceCancelCommand
Cancel a running device replace operation.
ReplaceCommand
Replace a device in the filesystem.
ReplaceStartCommand
Replace a device in the filesystem.
ReplaceStatusCommand
Print status of a running device replace operation.
RescueChunkRecoverCommand
Recover the chunk tree by scanning the devices one by one
RescueClearInoCacheCommand
Remove leftover items pertaining to the deprecated inode cache feature
RescueClearSpaceCacheCommand
Completely remove the v1 or v2 free space cache
RescueClearUuidTreeCommand
Delete uuid tree so that kernel can rebuild it at mount time
RescueCommand
Toolbox for specific rescue operations.
RescueCreateControlDeviceCommand
Create /dev/btrfs-control
RescueFixDataChecksumCommand
Fix data checksum mismatches
RescueFixDeviceSizeCommand
Re-align device and super block sizes
RescueSuperRecoverCommand
Recover bad superblocks from good copies
RescueZeroLogCommand
Clear the tree log (usable if it’s corrupted and prevents mount)
RestoreCommand
Try to restore files from a damaged filesystem (unmounted).
RootidCommand
Get tree ID of the containing subvolume of path
ScrubCancelCommand
Cancel a running scrub
ScrubCommand
Verify checksums of data and metadata.
ScrubLimitCommand
Show or set the per-device scrub throughput limit
ScrubResumeCommand
Resume a previously cancelled or interrupted scrub
ScrubStartCommand
Start a new scrub on the filesystem or a device.
ScrubStatusCommand
Show the status of a running or finished scrub
SendCommand
Send the subvolume(s) to stdout.
SortKey
A sort key with direction.
SortKeys
Comma-separated list of sort keys (e.g. “rfer,-excl”).
SubvolidResolveCommand
Resolve the path of a subvolume given its ID
SubvolumeCommand
Create, delete, list, and manage btrfs subvolumes and snapshots.
SubvolumeCreateCommand
Create a new subvolume at each given path.
SubvolumeDeleteCommand
Delete one or more subvolumes or snapshots.
SubvolumeFindNewCommand
List the recently modified files in a subvolume
SubvolumeGetDefaultCommand
Show the default subvolume of a filesystem
SubvolumeGetFlagsCommand
Show the flags of a subvolume
SubvolumeListCommand
List subvolumes and snapshots in the filesystem
SubvolumeSetDefaultCommand
Set the default subvolume of a filesystem.
SubvolumeSetFlagsCommand
Set the flags of a subvolume
SubvolumeShowCommand
Show detailed information about a subvolume
SubvolumeSnapshotCommand
Create a snapshot of a subvolume
SubvolumeSyncCommand
Wait until given subvolume(s) are completely removed from the filesystem
TreeStatsCommand
Print statistics about trees in a btrfs filesystem
UnitMode
Unit display mode flags, shared by subcommands that output sizes.

Enums§

BalanceSubcommand
CheckMode
Check mode for filesystem verification
Command
DeviceSubcommand
FilesystemSubcommand
Format
GenFilter
A generation filter: exact match, >= (plus), or <= (minus).
InspectSubcommand
Level
PropertyObjectType
Object type for property operations
PropertySubcommand
QgroupLimitSize
A size limit that is either a byte count or “none” to remove the limit.
QgroupSubcommand
QuotaSubcommand
ReplaceSubcommand
RescueSubcommand
ScrubSubcommand
SpaceCacheVersion
SubvolumeSubcommand

Traits§

Runnable