# man > cache_restore(8)

---
type: CommandReference
command: cache_restore
mode: man
section: 8
source: man-pages
---

## Quick Reference

- `cache_restore -i metadata.xml -o /dev/vg/metadata` — restore from XML to device
- `cache_restore -i metadata.xml -o metadata.bin` — restore to file
- `cache_restore -i metadata.xml -o /dev/vg/metadata --metadata-version 2` — specify metadata version
- `cache_restore -i metadata.xml -o /dev/vg/metadata -q` — quiet mode
- `cache_restore --help` — print help and exit
- `cache_restore --version` — print version information
- `cache_restore -i metadata.xml -o /dev/vg/metadata --omit-clean-shutdown` — omit clean shutdown flag
- `cache_restore -i metadata.xml -o /dev/vg/metadata --debug-override-metadata-version 1` — override metadata version

## Name

`cache_restore` — restore cache metadata file to device or file.

## Synopsis

`cache_restore` [options] `-i` xml_file `-o` device|file

This tool cannot be run on live metadata.

## Options

- `-h, --help` — Print help and exit.
- `-V, --version` — Print version information and exit.
- `-q, --quiet` — Don't print any output. Check the exit code to test for success.
- `-i, --input` {xml file} — Input xml.
- `-o, --output` {device|file} — Output file or device for restored binary metadata. If a file is used, it must be preallocated and large enough to hold the metadata.
- `--metadata-version` {1|2} — Choose a metadata version.
- `--debug-override-metadata-version` {integer} — Override the version stored in the metadata. (Debugging option)
- `--omit-clean-shutdown` — Don't set the clean shutdown flag. (Debugging option)

## Examples

Restore XML formatted cache metadata from file `metadata` to logical volume `/dev/vg/metadata`:

shell
$ cache_restore -i metadata -o /dev/vg/metadata
## Exit Codes

- 0 — success
- 1 — error

## See Also

- [cache_dump(8)](https://www.chedong.com/phpMan.php/man/dump/8/markdown)
- [cache_check(8)](https://www.chedong.com/phpMan.php/man/check/8/markdown)
- [cache_repair(8)](https://www.chedong.com/phpMan.php/man/repair/8/markdown)