From 78b7b1ba8989400e3e8b52e7c3a02a7a73e96f11 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sun, 20 Jul 2025 01:28:02 +0300 Subject: [PATCH] btrfs: add aliases (#17268) --- pages/linux/btrfs-balance.md | 14 +++++++------- pages/linux/btrfs-check.md | 14 +++++++------- pages/linux/btrfs-device.md | 10 +++++----- pages/linux/btrfs-filesystem.md | 14 +++++++------- pages/linux/btrfs-inspect-internal.md | 12 ++++++------ pages/linux/btrfs-property.md | 10 +++++----- pages/linux/btrfs-rescue.md | 10 +++++----- pages/linux/btrfs-restore.md | 10 +++++----- pages/linux/btrfs-scrub.md | 12 ++++++------ pages/linux/btrfs-subvolume.md | 12 ++++++------ pages/linux/btrfs-version.md | 4 ++-- pages/linux/btrfs.md | 10 +++++----- 12 files changed, 66 insertions(+), 66 deletions(-) diff --git a/pages/linux/btrfs-balance.md b/pages/linux/btrfs-balance.md index 7207701f13..1eddb93633 100644 --- a/pages/linux/btrfs-balance.md +++ b/pages/linux/btrfs-balance.md @@ -5,28 +5,28 @@ - Show the status of a running or paused balance operation: -`sudo btrfs balance status {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} status {{path/to/btrfs_filesystem}}` - Balance all block groups (slow; rewrites all blocks in filesystem): -`sudo btrfs balance start {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} start {{path/to/btrfs_filesystem}}` - Balance data block groups which are less than 15% utilized, running the operation in the background: -`sudo btrfs balance start {{[--bg|--background]}} -dusage={{15}} {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} start {{[--bg|--background]}} -dusage={{15}} {{path/to/btrfs_filesystem}}` - Balance a max of 10 metadata chunks with less than 20% utilization and at least 1 chunk on a given device `devid` (see `btrfs filesystem show`): -`sudo btrfs balance start -musage={{20}},limit={{10}},devid={{devid}} {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} start -musage={{20}},limit={{10}},devid={{devid}} {{path/to/btrfs_filesystem}}` - Convert data blocks to the raid6 and metadata to raid1c3 (see mkfs.btrfs(8) for profiles): -`sudo btrfs balance start -dconvert={{raid6}} -mconvert={{raid1c3}} {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} start -dconvert={{raid6}} -mconvert={{raid1c3}} {{path/to/btrfs_filesystem}}` - Convert data blocks to raid1, skipping already converted chunks (e.g. after a previous cancelled conversion operation): -`sudo btrfs balance start -dconvert={{raid1}},soft {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} start -dconvert={{raid1}},soft {{path/to/btrfs_filesystem}}` - Cancel, pause, or resume a running or paused balance operation: -`sudo btrfs balance {{cancel|pause|resume}} {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[b|balance]}} {{cancel|pause|resume}} {{path/to/btrfs_filesystem}}` diff --git a/pages/linux/btrfs-check.md b/pages/linux/btrfs-check.md index 7172843f15..d9d3b289c2 100644 --- a/pages/linux/btrfs-check.md +++ b/pages/linux/btrfs-check.md @@ -5,28 +5,28 @@ - Check a btrfs filesystem: -`sudo btrfs check {{path/to/partition}}` +`sudo btrfs {{[c|check]}} {{path/to/partition}}` - Check and repair a btrfs filesystem (dangerous): -`sudo btrfs check --repair {{path/to/partition}}` +`sudo btrfs {{[c|check]}} --repair {{path/to/partition}}` - Show the progress of the check: -`sudo btrfs check {{[-p|--progress]}} {{path/to/partition}}` +`sudo btrfs {{[c|check]}} {{[-p|--progress]}} {{path/to/partition}}` - Verify the checksum of each data block (if the filesystem is good): -`sudo btrfs check --check-data-csum {{path/to/partition}}` +`sudo btrfs {{[c|check]}} --check-data-csum {{path/to/partition}}` - Use the `n`-th superblock (`n` can be 0, 1 or 2): -`sudo btrfs check {{[-s|--super]}} {{n}} {{path/to/partition}}` +`sudo btrfs {{[c|check]}} {{[-s|--super]}} {{n}} {{path/to/partition}}` - Rebuild the checksum tree: -`sudo btrfs check --repair --init-csum-tree {{path/to/partition}}` +`sudo btrfs {{[c|check]}} --repair --init-csum-tree {{path/to/partition}}` - Rebuild the extent tree: -`sudo btrfs check --repair --init-extent-tree {{path/to/partition}}` +`sudo btrfs {{[c|check]}} --repair --init-extent-tree {{path/to/partition}}` diff --git a/pages/linux/btrfs-device.md b/pages/linux/btrfs-device.md index 1117da4c1a..dc5a8bbab4 100644 --- a/pages/linux/btrfs-device.md +++ b/pages/linux/btrfs-device.md @@ -5,20 +5,20 @@ - Add one or more devices to a btrfs filesystem: -`sudo btrfs device add {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[d|device]}} {{[a|add]}} {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}` - Remove a device from a btrfs filesystem: -`sudo btrfs device remove {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}` +`sudo btrfs {{[d|device]}} {{[rem|remove]}} {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}` - Display error statistics: -`sudo btrfs device stats {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[d|device]}} {{[st|stats]}} {{path/to/btrfs_filesystem}}` - Scan all disks and inform the kernel of all detected btrfs filesystems: -`sudo btrfs device scan {{[-d|--all-devices]}}` +`sudo btrfs {{[d|device]}} {{[sc|scan]}} {{[-d|--all-devices]}}` - Display detailed per-disk allocation statistics: -`sudo btrfs device usage {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[d|device]}} {{[u|usage]}} {{path/to/btrfs_filesystem}}` diff --git a/pages/linux/btrfs-filesystem.md b/pages/linux/btrfs-filesystem.md index 4fc6587bd7..c44690acf1 100644 --- a/pages/linux/btrfs-filesystem.md +++ b/pages/linux/btrfs-filesystem.md @@ -5,28 +5,28 @@ - Show filesystem usage (optionally run as root to show detailed information): -`btrfs filesystem usage {{path/to/btrfs_mount}}` +`btrfs {{[f|filesystem]}} {{[u|usage]}} {{path/to/btrfs_mount}}` - Show usage by individual devices: -`sudo btrfs filesystem show {{path/to/btrfs_mount}}` +`sudo btrfs {{[f|filesystem]}} {{[sh|show]}} {{path/to/btrfs_mount}}` - Defragment a single file on a btrfs filesystem (avoid while a deduplication agent is running): -`sudo btrfs filesystem defragment {{[-v|--verbose]}} {{path/to/file}}` +`sudo btrfs {{[f|filesystem]}} {{[de|defragment]}} {{[-v|--verbose]}} {{path/to/file}}` - Defragment a directory recursively (does not cross subvolume boundaries): -`sudo btrfs filesystem defragment {{[-v|--verbose]}} -r {{path/to/directory}}` +`sudo btrfs {{[f|filesystem]}} {{[de|defragment]}} {{[-v|--verbose]}} -r {{path/to/directory}}` - Force syncing unwritten data blocks to disk(s): -`sudo btrfs filesystem sync {{path/to/btrfs_mount}}` +`sudo btrfs {{[f|filesystem]}} {{[sy|sync]}} {{path/to/btrfs_mount}}` - Summarize disk usage for the files in a directory recursively: -`sudo btrfs filesystem du {{[-s|--summarize]}} {{path/to/directory}}` +`sudo btrfs {{[f|filesystem]}} du {{[-s|--summarize]}} {{path/to/directory}}` - Create a swap file: -`sudo btrfs filesystem mkswapfile --size {{8g}} --uuid {{clear|random|time|UUID_value}} {{path/to/swapfile}}` +`sudo btrfs {{[f|filesystem]}} {{[m|mkswapfile]}} --size {{8g}} --uuid {{clear|random|time|UUID_value}} {{path/to/swapfile}}` diff --git a/pages/linux/btrfs-inspect-internal.md b/pages/linux/btrfs-inspect-internal.md index 6a62ce6574..62f0c9a9ed 100644 --- a/pages/linux/btrfs-inspect-internal.md +++ b/pages/linux/btrfs-inspect-internal.md @@ -5,24 +5,24 @@ - Print superblock's information: -`sudo btrfs inspect-internal dump-super {{path/to/partition}}` +`sudo btrfs {{[i|inspect-internal]}} {{[dump-s|dump-super]}} {{path/to/partition}}` - Print superblock's and all of its copies' information: -`sudo btrfs inspect-internal dump-super {{[-a|--all]}} {{path/to/partition}}` +`sudo btrfs {{[i|inspect-internal]}} {{[dump-s|dump-super]}} {{[-a|--all]}} {{path/to/partition}}` - Print filesystem's metadata information: -`sudo btrfs inspect-internal dump-tree {{path/to/partition}}` +`sudo btrfs {{[i|inspect-internal]}} {{[dump-t|dump-tree]}} {{path/to/partition}}` - Print list of files in inode `n`-th: -`sudo btrfs inspect-internal inode-resolve {{n}} {{path/to/btrfs_mount}}` +`sudo btrfs {{[i|inspect-internal]}} {{[i|inode-resolve]}} {{n}} {{path/to/btrfs_mount}}` - Print list of files at a given logical address: -`sudo btrfs inspect-internal logical-resolve {{logical_address}} {{path/to/btrfs_mount}}` +`sudo btrfs {{[i|inspect-internal]}} {{[lo|logical-resolve]}} {{logical_address}} {{path/to/btrfs_mount}}` - Print stats of root, extent, csum and fs trees: -`sudo btrfs inspect-internal tree-stats {{path/to/partition}}` +`sudo btrfs {{[i|inspect-internal]}} {{[t|tree-stats]}} {{path/to/partition}}` diff --git a/pages/linux/btrfs-property.md b/pages/linux/btrfs-property.md index 8864072f47..93f414785e 100644 --- a/pages/linux/btrfs-property.md +++ b/pages/linux/btrfs-property.md @@ -5,20 +5,20 @@ - List available properties (and descriptions) for the given btrfs object: -`sudo btrfs property list {{path/to/btrfs_object}}` +`sudo btrfs {{[p|property]}} {{[l|list]}} {{path/to/btrfs_object}}` - Get all properties for the given btrfs object: -`sudo btrfs property get {{path/to/btrfs_object}}` +`sudo btrfs {{[p|property]}} {{[g|get]}} {{path/to/btrfs_object}}` - Get the `label` property for the given btrfs filesystem or device: -`sudo btrfs property get {{path/to/btrfs_filesystem}} label` +`sudo btrfs {{[p|property]}} {{[g|get]}} {{path/to/btrfs_filesystem}} label` - Get all object type-specific properties for the given btrfs filesystem or device: -`sudo btrfs property get -t {{subvol|filesystem|inode|device}} {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[p|property]}} {{[g|get]}} -t {{subvol|filesystem|inode|device}} {{path/to/btrfs_filesystem}}` - Set the `compression` property for a given btrfs inode (either a file or directory): -`sudo btrfs property set {{path/to/btrfs_inode}} compression {{zstd|zlib|lzo|none}}` +`sudo btrfs {{[p|property]}} {{[s|set]}} {{path/to/btrfs_inode}} compression {{zstd|zlib|lzo|none}}` diff --git a/pages/linux/btrfs-rescue.md b/pages/linux/btrfs-rescue.md index d8196ec6a7..27f765a59a 100644 --- a/pages/linux/btrfs-rescue.md +++ b/pages/linux/btrfs-rescue.md @@ -5,20 +5,20 @@ - Rebuild the filesystem metadata tree (very slow): -`sudo btrfs rescue chunk-recover {{path/to/partition}}` +`sudo btrfs {{[resc|rescue]}} {{[ch|chunk-recover]}} {{path/to/partition}}` - Fix device size alignment related problems (e.g. unable to mount the filesystem with super total bytes mismatch): -`sudo btrfs rescue fix-device-size {{path/to/partition}}` +`sudo btrfs {{[resc|rescue]}} {{[fix-de|fix-device-size]}} {{path/to/partition}}` - Recover a corrupted superblock from correct copies (recover the root of filesystem tree): -`sudo btrfs rescue super-recover {{path/to/partition}}` +`sudo btrfs {{[resc|rescue]}} {{[s|super-recover]}} {{path/to/partition}}` - Recover from an interrupted transactions (fixes log replay problems): -`sudo btrfs rescue zero-log {{path/to/partition}}` +`sudo btrfs {{[resc|rescue]}} {{[z|zero-log]}} {{path/to/partition}}` - Create a `/dev/btrfs-control` control device when `mknod` is not installed: -`sudo btrfs rescue create-control-device` +`sudo btrfs {{[resc|rescue]}} {{[c|create-control-device]}}` diff --git a/pages/linux/btrfs-restore.md b/pages/linux/btrfs-restore.md index 0f513542f0..c105bbaeba 100644 --- a/pages/linux/btrfs-restore.md +++ b/pages/linux/btrfs-restore.md @@ -5,20 +5,20 @@ - Restore all files from a btrfs filesystem to a given directory: -`sudo btrfs restore {{path/to/btrfs_device}} {{path/to/target_directory}}` +`sudo btrfs {{[rest|restore]}} {{path/to/btrfs_device}} {{path/to/target_directory}}` - List (don't write) files to be restored from a btrfs filesystem: -`sudo btrfs restore {{[-D|--dry-run]}} {{path/to/btrfs_device}} {{path/to/target_directory}}` +`sudo btrfs {{[rest|restore]}} {{[-D|--dry-run]}} {{path/to/btrfs_device}} {{path/to/target_directory}}` - Restore files matching a given regex ([c]ase-insensitive) files to be restored from a btrfs filesystem (all parent directories of target file(s) must match as well): -`sudo btrfs restore --path-regex {{regex}} -c {{path/to/btrfs_device}} {{path/to/target_directory}}` +`sudo btrfs {{[rest|restore]}} --path-regex {{regex}} -c {{path/to/btrfs_device}} {{path/to/target_directory}}` - Restore files from a btrfs filesystem using a specific root [t]ree `bytenr` (see `btrfs-find-root`): -`sudo btrfs restore -t {{bytenr}} {{path/to/btrfs_device}} {{path/to/target_directory}}` +`sudo btrfs {{[rest|restore]}} -t {{bytenr}} {{path/to/btrfs_device}} {{path/to/target_directory}}` - Restore files from a btrfs filesystem (along with metadata, extended attributes, and Symlinks), overwriting files in the target: -`sudo btrfs restore {{[-m|--metadata]}} {{[-x|--xattr]}} {{[-S|--symlinks]}} {{[-o|--overwrite]}} {{path/to/btrfs_device}} {{path/to/target_directory}}` +`sudo btrfs {{[rest|restore]}} {{[-m|--metadata]}} {{[-x|--xattr]}} {{[-S|--symlinks]}} {{[-o|--overwrite]}} {{path/to/btrfs_device}} {{path/to/target_directory}}` diff --git a/pages/linux/btrfs-scrub.md b/pages/linux/btrfs-scrub.md index 8e8d1ab376..09f6adc8f6 100644 --- a/pages/linux/btrfs-scrub.md +++ b/pages/linux/btrfs-scrub.md @@ -6,24 +6,24 @@ - Start a scrub: -`sudo btrfs scrub start {{path/to/btrfs_mount}}` +`sudo btrfs {{[sc|scrub]}} start {{path/to/btrfs_mount}}` - Show the status of an ongoing or last completed scrub: -`sudo btrfs scrub status {{path/to/btrfs_mount}}` +`sudo btrfs {{[sc|scrub]}} status {{path/to/btrfs_mount}}` - Cancel an ongoing scrub: -`sudo btrfs scrub cancel {{path/to/btrfs_mount}}` +`sudo btrfs {{[sc|scrub]}} {{[c|cancel]}} {{path/to/btrfs_mount}}` - Resume a previously cancelled scrub: -`sudo btrfs scrub resume {{path/to/btrfs_mount}}` +`sudo btrfs {{[sc|scrub]}} {{[r|resume]}} {{path/to/btrfs_mount}}` - Start a scrub, but do not put the program in the [B]ackground: -`sudo btrfs scrub start -B {{path/to/btrfs_mount}}` +`sudo btrfs {{[sc|scrub]}} start -B {{path/to/btrfs_mount}}` - Start a scrub in quiet mode (does not print errors or statistics): -`sudo btrfs scrub start {{[-q|--quiet]}} {{path/to/btrfs_mount}}` +`sudo btrfs {{[sc|scrub]}} start {{[-q|--quiet]}} {{path/to/btrfs_mount}}` diff --git a/pages/linux/btrfs-subvolume.md b/pages/linux/btrfs-subvolume.md index a6727a8567..a802a8c195 100644 --- a/pages/linux/btrfs-subvolume.md +++ b/pages/linux/btrfs-subvolume.md @@ -5,24 +5,24 @@ - Create a new empty subvolume: -`sudo btrfs subvolume create {{path/to/new_subvolume}}` +`sudo btrfs {{[su|subvolume]}} {{[c|create]}} {{path/to/new_subvolume}}` - List all subvolumes and snapshots in the specified filesystem: -`sudo btrfs subvolume list {{path/to/btrfs_filesystem}}` +`sudo btrfs {{[su|subvolume]}} {{[l|list]}} {{path/to/btrfs_filesystem}}` - Delete a subvolume: -`sudo btrfs subvolume delete {{path/to/subvolume}}` +`sudo btrfs {{[su|subvolume]}} {{[d|delete]}} {{path/to/subvolume}}` - Create a [r]ead-only snapshot of an existing subvolume: -`sudo btrfs subvolume snapshot -r {{path/to/source_subvolume}} {{path/to/target}}` +`sudo btrfs {{[su|subvolume]}} {{[sn|snapshot]}} -r {{path/to/source_subvolume}} {{path/to/target}}` - Create a read-write snapshot of an existing subvolume: -`sudo btrfs subvolume snapshot {{path/to/source_subvolume}} {{path/to/target}}` +`sudo btrfs {{[su|subvolume]}} {{[sn|snapshot]}} {{path/to/source_subvolume}} {{path/to/target}}` - Show detailed information about a subvolume: -`sudo btrfs subvolume show {{path/to/subvolume}}` +`sudo btrfs {{[su|subvolume]}} {{[sh|show]}} {{path/to/subvolume}}` diff --git a/pages/linux/btrfs-version.md b/pages/linux/btrfs-version.md index da5499c2ce..42fcc81f28 100644 --- a/pages/linux/btrfs-version.md +++ b/pages/linux/btrfs-version.md @@ -5,8 +5,8 @@ - Display help: -`btrfs version --help` +`btrfs {{[v|version]}} --help` - Display version: -`btrfs version` +`btrfs {{[v|version]}}` diff --git a/pages/linux/btrfs.md b/pages/linux/btrfs.md index f0da7e0400..6d1481f814 100644 --- a/pages/linux/btrfs.md +++ b/pages/linux/btrfs.md @@ -6,20 +6,20 @@ - Create subvolume: -`sudo btrfs subvolume create {{path/to/subvolume}}` +`sudo btrfs {{[su|subvolume]}} {{[c|create]}} {{path/to/subvolume}}` - List subvolumes: -`sudo btrfs subvolume list {{path/to/mount_point}}` +`sudo btrfs {{[su|subvolume]}} {{[l|list]}} {{path/to/mount_point}}` - Show space usage information: -`sudo btrfs filesystem df {{path/to/mount_point}}` +`sudo btrfs {{[f|filesystem]}} df {{path/to/mount_point}}` - Enable quota: -`sudo btrfs quota enable {{path/to/subvolume}}` +`sudo btrfs {{[qu|quota]}} {{[e|enable]}} {{path/to/subvolume}}` - Show quota: -`sudo btrfs qgroup show {{path/to/subvolume}}` +`sudo btrfs {{[qg|qgroup]}} {{[s|show]}} {{path/to/subvolume}}`