Skip to content

Commit 78b7b1b

Browse files
authored
btrfs: add aliases (#17268)
1 parent e9f7de1 commit 78b7b1b

12 files changed

+66
-66
lines changed

pages/linux/btrfs-balance.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
66
- Show the status of a running or paused balance operation:
77

8-
`sudo btrfs balance status {{path/to/btrfs_filesystem}}`
8+
`sudo btrfs {{[b|balance]}} status {{path/to/btrfs_filesystem}}`
99

1010
- Balance all block groups (slow; rewrites all blocks in filesystem):
1111

12-
`sudo btrfs balance start {{path/to/btrfs_filesystem}}`
12+
`sudo btrfs {{[b|balance]}} start {{path/to/btrfs_filesystem}}`
1313

1414
- Balance data block groups which are less than 15% utilized, running the operation in the background:
1515

16-
`sudo btrfs balance start {{[--bg|--background]}} -dusage={{15}} {{path/to/btrfs_filesystem}}`
16+
`sudo btrfs {{[b|balance]}} start {{[--bg|--background]}} -dusage={{15}} {{path/to/btrfs_filesystem}}`
1717

1818
- 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`):
1919

20-
`sudo btrfs balance start -musage={{20}},limit={{10}},devid={{devid}} {{path/to/btrfs_filesystem}}`
20+
`sudo btrfs {{[b|balance]}} start -musage={{20}},limit={{10}},devid={{devid}} {{path/to/btrfs_filesystem}}`
2121

2222
- Convert data blocks to the raid6 and metadata to raid1c3 (see mkfs.btrfs(8) for profiles):
2323

24-
`sudo btrfs balance start -dconvert={{raid6}} -mconvert={{raid1c3}} {{path/to/btrfs_filesystem}}`
24+
`sudo btrfs {{[b|balance]}} start -dconvert={{raid6}} -mconvert={{raid1c3}} {{path/to/btrfs_filesystem}}`
2525

2626
- Convert data blocks to raid1, skipping already converted chunks (e.g. after a previous cancelled conversion operation):
2727

28-
`sudo btrfs balance start -dconvert={{raid1}},soft {{path/to/btrfs_filesystem}}`
28+
`sudo btrfs {{[b|balance]}} start -dconvert={{raid1}},soft {{path/to/btrfs_filesystem}}`
2929

3030
- Cancel, pause, or resume a running or paused balance operation:
3131

32-
`sudo btrfs balance {{cancel|pause|resume}} {{path/to/btrfs_filesystem}}`
32+
`sudo btrfs {{[b|balance]}} {{cancel|pause|resume}} {{path/to/btrfs_filesystem}}`

pages/linux/btrfs-check.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
66
- Check a btrfs filesystem:
77

8-
`sudo btrfs check {{path/to/partition}}`
8+
`sudo btrfs {{[c|check]}} {{path/to/partition}}`
99

1010
- Check and repair a btrfs filesystem (dangerous):
1111

12-
`sudo btrfs check --repair {{path/to/partition}}`
12+
`sudo btrfs {{[c|check]}} --repair {{path/to/partition}}`
1313

1414
- Show the progress of the check:
1515

16-
`sudo btrfs check {{[-p|--progress]}} {{path/to/partition}}`
16+
`sudo btrfs {{[c|check]}} {{[-p|--progress]}} {{path/to/partition}}`
1717

1818
- Verify the checksum of each data block (if the filesystem is good):
1919

20-
`sudo btrfs check --check-data-csum {{path/to/partition}}`
20+
`sudo btrfs {{[c|check]}} --check-data-csum {{path/to/partition}}`
2121

2222
- Use the `n`-th superblock (`n` can be 0, 1 or 2):
2323

24-
`sudo btrfs check {{[-s|--super]}} {{n}} {{path/to/partition}}`
24+
`sudo btrfs {{[c|check]}} {{[-s|--super]}} {{n}} {{path/to/partition}}`
2525

2626
- Rebuild the checksum tree:
2727

28-
`sudo btrfs check --repair --init-csum-tree {{path/to/partition}}`
28+
`sudo btrfs {{[c|check]}} --repair --init-csum-tree {{path/to/partition}}`
2929

3030
- Rebuild the extent tree:
3131

32-
`sudo btrfs check --repair --init-extent-tree {{path/to/partition}}`
32+
`sudo btrfs {{[c|check]}} --repair --init-extent-tree {{path/to/partition}}`

pages/linux/btrfs-device.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
66
- Add one or more devices to a btrfs filesystem:
77

8-
`sudo btrfs device add {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}`
8+
`sudo btrfs {{[d|device]}} {{[a|add]}} {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}`
99

1010
- Remove a device from a btrfs filesystem:
1111

12-
`sudo btrfs device remove {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}`
12+
`sudo btrfs {{[d|device]}} {{[rem|remove]}} {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}`
1313

1414
- Display error statistics:
1515

16-
`sudo btrfs device stats {{path/to/btrfs_filesystem}}`
16+
`sudo btrfs {{[d|device]}} {{[st|stats]}} {{path/to/btrfs_filesystem}}`
1717

1818
- Scan all disks and inform the kernel of all detected btrfs filesystems:
1919

20-
`sudo btrfs device scan {{[-d|--all-devices]}}`
20+
`sudo btrfs {{[d|device]}} {{[sc|scan]}} {{[-d|--all-devices]}}`
2121

2222
- Display detailed per-disk allocation statistics:
2323

24-
`sudo btrfs device usage {{path/to/btrfs_filesystem}}`
24+
`sudo btrfs {{[d|device]}} {{[u|usage]}} {{path/to/btrfs_filesystem}}`

pages/linux/btrfs-filesystem.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
66
- Show filesystem usage (optionally run as root to show detailed information):
77

8-
`btrfs filesystem usage {{path/to/btrfs_mount}}`
8+
`btrfs {{[f|filesystem]}} {{[u|usage]}} {{path/to/btrfs_mount}}`
99

1010
- Show usage by individual devices:
1111

12-
`sudo btrfs filesystem show {{path/to/btrfs_mount}}`
12+
`sudo btrfs {{[f|filesystem]}} {{[sh|show]}} {{path/to/btrfs_mount}}`
1313

1414
- Defragment a single file on a btrfs filesystem (avoid while a deduplication agent is running):
1515

16-
`sudo btrfs filesystem defragment {{[-v|--verbose]}} {{path/to/file}}`
16+
`sudo btrfs {{[f|filesystem]}} {{[de|defragment]}} {{[-v|--verbose]}} {{path/to/file}}`
1717

1818
- Defragment a directory recursively (does not cross subvolume boundaries):
1919

20-
`sudo btrfs filesystem defragment {{[-v|--verbose]}} -r {{path/to/directory}}`
20+
`sudo btrfs {{[f|filesystem]}} {{[de|defragment]}} {{[-v|--verbose]}} -r {{path/to/directory}}`
2121

2222
- Force syncing unwritten data blocks to disk(s):
2323

24-
`sudo btrfs filesystem sync {{path/to/btrfs_mount}}`
24+
`sudo btrfs {{[f|filesystem]}} {{[sy|sync]}} {{path/to/btrfs_mount}}`
2525

2626
- Summarize disk usage for the files in a directory recursively:
2727

28-
`sudo btrfs filesystem du {{[-s|--summarize]}} {{path/to/directory}}`
28+
`sudo btrfs {{[f|filesystem]}} du {{[-s|--summarize]}} {{path/to/directory}}`
2929

3030
- Create a swap file:
3131

32-
`sudo btrfs filesystem mkswapfile --size {{8g}} --uuid {{clear|random|time|UUID_value}} {{path/to/swapfile}}`
32+
`sudo btrfs {{[f|filesystem]}} {{[m|mkswapfile]}} --size {{8g}} --uuid {{clear|random|time|UUID_value}} {{path/to/swapfile}}`

pages/linux/btrfs-inspect-internal.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
66
- Print superblock's information:
77

8-
`sudo btrfs inspect-internal dump-super {{path/to/partition}}`
8+
`sudo btrfs {{[i|inspect-internal]}} {{[dump-s|dump-super]}} {{path/to/partition}}`
99

1010
- Print superblock's and all of its copies' information:
1111

12-
`sudo btrfs inspect-internal dump-super {{[-a|--all]}} {{path/to/partition}}`
12+
`sudo btrfs {{[i|inspect-internal]}} {{[dump-s|dump-super]}} {{[-a|--all]}} {{path/to/partition}}`
1313

1414
- Print filesystem's metadata information:
1515

16-
`sudo btrfs inspect-internal dump-tree {{path/to/partition}}`
16+
`sudo btrfs {{[i|inspect-internal]}} {{[dump-t|dump-tree]}} {{path/to/partition}}`
1717

1818
- Print list of files in inode `n`-th:
1919

20-
`sudo btrfs inspect-internal inode-resolve {{n}} {{path/to/btrfs_mount}}`
20+
`sudo btrfs {{[i|inspect-internal]}} {{[i|inode-resolve]}} {{n}} {{path/to/btrfs_mount}}`
2121

2222
- Print list of files at a given logical address:
2323

24-
`sudo btrfs inspect-internal logical-resolve {{logical_address}} {{path/to/btrfs_mount}}`
24+
`sudo btrfs {{[i|inspect-internal]}} {{[lo|logical-resolve]}} {{logical_address}} {{path/to/btrfs_mount}}`
2525

2626
- Print stats of root, extent, csum and fs trees:
2727

28-
`sudo btrfs inspect-internal tree-stats {{path/to/partition}}`
28+
`sudo btrfs {{[i|inspect-internal]}} {{[t|tree-stats]}} {{path/to/partition}}`

pages/linux/btrfs-property.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
66
- List available properties (and descriptions) for the given btrfs object:
77

8-
`sudo btrfs property list {{path/to/btrfs_object}}`
8+
`sudo btrfs {{[p|property]}} {{[l|list]}} {{path/to/btrfs_object}}`
99

1010
- Get all properties for the given btrfs object:
1111

12-
`sudo btrfs property get {{path/to/btrfs_object}}`
12+
`sudo btrfs {{[p|property]}} {{[g|get]}} {{path/to/btrfs_object}}`
1313

1414
- Get the `label` property for the given btrfs filesystem or device:
1515

16-
`sudo btrfs property get {{path/to/btrfs_filesystem}} label`
16+
`sudo btrfs {{[p|property]}} {{[g|get]}} {{path/to/btrfs_filesystem}} label`
1717

1818
- Get all object type-specific properties for the given btrfs filesystem or device:
1919

20-
`sudo btrfs property get -t {{subvol|filesystem|inode|device}} {{path/to/btrfs_filesystem}}`
20+
`sudo btrfs {{[p|property]}} {{[g|get]}} -t {{subvol|filesystem|inode|device}} {{path/to/btrfs_filesystem}}`
2121

2222
- Set the `compression` property for a given btrfs inode (either a file or directory):
2323

24-
`sudo btrfs property set {{path/to/btrfs_inode}} compression {{zstd|zlib|lzo|none}}`
24+
`sudo btrfs {{[p|property]}} {{[s|set]}} {{path/to/btrfs_inode}} compression {{zstd|zlib|lzo|none}}`

pages/linux/btrfs-rescue.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
66
- Rebuild the filesystem metadata tree (very slow):
77

8-
`sudo btrfs rescue chunk-recover {{path/to/partition}}`
8+
`sudo btrfs {{[resc|rescue]}} {{[ch|chunk-recover]}} {{path/to/partition}}`
99

1010
- Fix device size alignment related problems (e.g. unable to mount the filesystem with super total bytes mismatch):
1111

12-
`sudo btrfs rescue fix-device-size {{path/to/partition}}`
12+
`sudo btrfs {{[resc|rescue]}} {{[fix-de|fix-device-size]}} {{path/to/partition}}`
1313

1414
- Recover a corrupted superblock from correct copies (recover the root of filesystem tree):
1515

16-
`sudo btrfs rescue super-recover {{path/to/partition}}`
16+
`sudo btrfs {{[resc|rescue]}} {{[s|super-recover]}} {{path/to/partition}}`
1717

1818
- Recover from an interrupted transactions (fixes log replay problems):
1919

20-
`sudo btrfs rescue zero-log {{path/to/partition}}`
20+
`sudo btrfs {{[resc|rescue]}} {{[z|zero-log]}} {{path/to/partition}}`
2121

2222
- Create a `/dev/btrfs-control` control device when `mknod` is not installed:
2323

24-
`sudo btrfs rescue create-control-device`
24+
`sudo btrfs {{[resc|rescue]}} {{[c|create-control-device]}}`

pages/linux/btrfs-restore.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
66
- Restore all files from a btrfs filesystem to a given directory:
77

8-
`sudo btrfs restore {{path/to/btrfs_device}} {{path/to/target_directory}}`
8+
`sudo btrfs {{[rest|restore]}} {{path/to/btrfs_device}} {{path/to/target_directory}}`
99

1010
- List (don't write) files to be restored from a btrfs filesystem:
1111

12-
`sudo btrfs restore {{[-D|--dry-run]}} {{path/to/btrfs_device}} {{path/to/target_directory}}`
12+
`sudo btrfs {{[rest|restore]}} {{[-D|--dry-run]}} {{path/to/btrfs_device}} {{path/to/target_directory}}`
1313

1414
- 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):
1515

16-
`sudo btrfs restore --path-regex {{regex}} -c {{path/to/btrfs_device}} {{path/to/target_directory}}`
16+
`sudo btrfs {{[rest|restore]}} --path-regex {{regex}} -c {{path/to/btrfs_device}} {{path/to/target_directory}}`
1717

1818
- Restore files from a btrfs filesystem using a specific root [t]ree `bytenr` (see `btrfs-find-root`):
1919

20-
`sudo btrfs restore -t {{bytenr}} {{path/to/btrfs_device}} {{path/to/target_directory}}`
20+
`sudo btrfs {{[rest|restore]}} -t {{bytenr}} {{path/to/btrfs_device}} {{path/to/target_directory}}`
2121

2222
- Restore files from a btrfs filesystem (along with metadata, extended attributes, and Symlinks), overwriting files in the target:
2323

24-
`sudo btrfs restore {{[-m|--metadata]}} {{[-x|--xattr]}} {{[-S|--symlinks]}} {{[-o|--overwrite]}} {{path/to/btrfs_device}} {{path/to/target_directory}}`
24+
`sudo btrfs {{[rest|restore]}} {{[-m|--metadata]}} {{[-x|--xattr]}} {{[-S|--symlinks]}} {{[-o|--overwrite]}} {{path/to/btrfs_device}} {{path/to/target_directory}}`

pages/linux/btrfs-scrub.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
77
- Start a scrub:
88

9-
`sudo btrfs scrub start {{path/to/btrfs_mount}}`
9+
`sudo btrfs {{[sc|scrub]}} start {{path/to/btrfs_mount}}`
1010

1111
- Show the status of an ongoing or last completed scrub:
1212

13-
`sudo btrfs scrub status {{path/to/btrfs_mount}}`
13+
`sudo btrfs {{[sc|scrub]}} status {{path/to/btrfs_mount}}`
1414

1515
- Cancel an ongoing scrub:
1616

17-
`sudo btrfs scrub cancel {{path/to/btrfs_mount}}`
17+
`sudo btrfs {{[sc|scrub]}} {{[c|cancel]}} {{path/to/btrfs_mount}}`
1818

1919
- Resume a previously cancelled scrub:
2020

21-
`sudo btrfs scrub resume {{path/to/btrfs_mount}}`
21+
`sudo btrfs {{[sc|scrub]}} {{[r|resume]}} {{path/to/btrfs_mount}}`
2222

2323
- Start a scrub, but do not put the program in the [B]ackground:
2424

25-
`sudo btrfs scrub start -B {{path/to/btrfs_mount}}`
25+
`sudo btrfs {{[sc|scrub]}} start -B {{path/to/btrfs_mount}}`
2626

2727
- Start a scrub in quiet mode (does not print errors or statistics):
2828

29-
`sudo btrfs scrub start {{[-q|--quiet]}} {{path/to/btrfs_mount}}`
29+
`sudo btrfs {{[sc|scrub]}} start {{[-q|--quiet]}} {{path/to/btrfs_mount}}`

pages/linux/btrfs-subvolume.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
66
- Create a new empty subvolume:
77

8-
`sudo btrfs subvolume create {{path/to/new_subvolume}}`
8+
`sudo btrfs {{[su|subvolume]}} {{[c|create]}} {{path/to/new_subvolume}}`
99

1010
- List all subvolumes and snapshots in the specified filesystem:
1111

12-
`sudo btrfs subvolume list {{path/to/btrfs_filesystem}}`
12+
`sudo btrfs {{[su|subvolume]}} {{[l|list]}} {{path/to/btrfs_filesystem}}`
1313

1414
- Delete a subvolume:
1515

16-
`sudo btrfs subvolume delete {{path/to/subvolume}}`
16+
`sudo btrfs {{[su|subvolume]}} {{[d|delete]}} {{path/to/subvolume}}`
1717

1818
- Create a [r]ead-only snapshot of an existing subvolume:
1919

20-
`sudo btrfs subvolume snapshot -r {{path/to/source_subvolume}} {{path/to/target}}`
20+
`sudo btrfs {{[su|subvolume]}} {{[sn|snapshot]}} -r {{path/to/source_subvolume}} {{path/to/target}}`
2121

2222
- Create a read-write snapshot of an existing subvolume:
2323

24-
`sudo btrfs subvolume snapshot {{path/to/source_subvolume}} {{path/to/target}}`
24+
`sudo btrfs {{[su|subvolume]}} {{[sn|snapshot]}} {{path/to/source_subvolume}} {{path/to/target}}`
2525

2626
- Show detailed information about a subvolume:
2727

28-
`sudo btrfs subvolume show {{path/to/subvolume}}`
28+
`sudo btrfs {{[su|subvolume]}} {{[sh|show]}} {{path/to/subvolume}}`

0 commit comments

Comments
 (0)