1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-02 08:55:31 +02:00
tldr/pages/linux/btrfs-rescue.md

25 lines
925 B
Markdown
Raw Normal View History

2021-10-25 21:14:30 +00:00
# btrfs rescue
> Try to recover a damaged btrfs filesystem.
> More information: <https://btrfs.readthedocs.io/en/latest/btrfs-rescue.html>.
2021-10-25 21:14:30 +00:00
- Rebuild the filesystem metadata tree (very slow):
2025-07-20 01:28:02 +03:00
`sudo btrfs {{[resc|rescue]}} {{[ch|chunk-recover]}} {{path/to/partition}}`
2021-10-25 21:14:30 +00:00
- Fix device size alignment related problems (e.g. unable to mount the filesystem with super total bytes mismatch):
2025-07-20 01:28:02 +03:00
`sudo btrfs {{[resc|rescue]}} {{[fix-de|fix-device-size]}} {{path/to/partition}}`
2021-10-25 21:14:30 +00:00
- Recover a corrupted superblock from correct copies (recover the root of filesystem tree):
2025-07-20 01:28:02 +03:00
`sudo btrfs {{[resc|rescue]}} {{[s|super-recover]}} {{path/to/partition}}`
2021-10-25 21:14:30 +00:00
- Recover from an interrupted transactions (fixes log replay problems):
2025-07-20 01:28:02 +03:00
`sudo btrfs {{[resc|rescue]}} {{[z|zero-log]}} {{path/to/partition}}`
2021-10-25 21:14:30 +00:00
- Create a `/dev/btrfs-control` control device when `mknod` is not installed:
2025-07-20 01:28:02 +03:00
`sudo btrfs {{[resc|rescue]}} {{[c|create-control-device]}}`