2021-01-07 11:04:21 +00:00
|
|
|
# btrfs filesystem
|
|
|
|
|
|
|
|
> Manage btrfs filesystems.
|
|
|
|
> More information: <https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-filesystem>.
|
|
|
|
|
|
|
|
- Show filesystem usage (optionally run as root to show detailed information):
|
|
|
|
|
|
|
|
`btrfs filesystem usage {{path/to/btrfs_mount}}`
|
|
|
|
|
|
|
|
- Show usage by individual devices:
|
|
|
|
|
2021-01-25 01:42:06 +00:00
|
|
|
`sudo btrfs filesystem show {{path/to/btrfs_mount}}`
|
2021-01-07 11:04:21 +00:00
|
|
|
|
2021-01-25 01:42:06 +00:00
|
|
|
- Defragment a single file on a btrfs filesystem (avoid while a deduplication agent is running):
|
2021-01-07 11:04:21 +00:00
|
|
|
|
2021-01-25 01:42:06 +00:00
|
|
|
`sudo btrfs filesystem defragment -v {{path/to/file}}`
|
2021-01-07 11:04:21 +00:00
|
|
|
|
|
|
|
- Defragment a directory recursively (does not cross subvolume boundaries):
|
|
|
|
|
2021-01-25 01:42:06 +00:00
|
|
|
`sudo btrfs filesystem defragment -v -r {{path/to/directory}}`
|
2021-01-07 11:04:21 +00:00
|
|
|
|
|
|
|
- Force syncing unwritten data blocks to disk(s):
|
|
|
|
|
|
|
|
`sudo btrfs filesystem sync {{path/to/btrfs_mount}}`
|
|
|
|
|
|
|
|
- Summarize disk usage for the files in a directory recursively:
|
|
|
|
|
2021-01-25 01:42:06 +00:00
|
|
|
`sudo btrfs filesystem du --summarize {{path/to/directory}}`
|