]> git.proxmox.com Git - ceph.git/blame - ceph/doc/cephfs/disaster-recovery.rst
import 15.2.0 Octopus source
[ceph.git] / ceph / doc / cephfs / disaster-recovery.rst
CommitLineData
11fdf7f2 1.. _cephfs-disaster-recovery:
7c673cae
FG
2
3Disaster recovery
4=================
5
11fdf7f2
TL
6Metadata damage and repair
7--------------------------
7c673cae 8
9f95a23c 9If a file system has inconsistent or missing metadata, it is considered
11fdf7f2
TL
10*damaged*. You may find out about damage from a health message, or in some
11unfortunate cases from an assertion in a running MDS daemon.
7c673cae 12
11fdf7f2
TL
13Metadata damage can result either from data loss in the underlying RADOS
14layer (e.g. multiple disk failures that lose all copies of a PG), or from
15software bugs.
7c673cae 16
9f95a23c 17CephFS includes some tools that may be able to recover a damaged file system,
11fdf7f2
TL
18but to use them safely requires a solid understanding of CephFS internals.
19The documentation for these potentially dangerous operations is on a
20separate page: :ref:`disaster-recovery-experts`.
7c673cae 21
11fdf7f2
TL
22Data pool damage (files affected by lost data PGs)
23--------------------------------------------------
7c673cae 24
9f95a23c 25If a PG is lost in a *data* pool, then the file system will continue
11fdf7f2
TL
26to operate normally, but some parts of some files will simply
27be missing (reads will return zeros).
7c673cae
FG
28
29Losing a data PG may affect many files. Files are split into many objects,
30so identifying which files are affected by loss of particular PGs requires
31a full scan over all object IDs that may exist within the size of a file.
32This type of scan may be useful for identifying which files require
33restoring from a backup.
34
35.. danger::
36
37 This command does not repair any metadata, so when restoring files in
38 this case you must *remove* the damaged file, and replace it in order
39 to have a fresh inode. Do not overwrite damaged files in place.
40
41If you know that objects have been lost from PGs, use the ``pg_files``
42subcommand to scan for files that may have been damaged as a result:
43
44::
45
46 cephfs-data-scan pg_files <path> <pg id> [<pg id>...]
47
48For example, if you have lost data from PGs 1.4 and 4.5, and you would like
49to know which files under /home/bob might have been damaged:
50
51::
52
53 cephfs-data-scan pg_files /home/bob 1.4 4.5
54
55The output will be a list of paths to potentially damaged files, one
56per line.
57
58Note that this command acts as a normal CephFS client to find all the
9f95a23c 59files in the file system and read their layouts, so the MDS must be
7c673cae
FG
60up and running.
61