Skip to content

Commit d88cdf0

Browse files
committed
doc/cephfs: document first-damage.py
Document the use of first-damage.py. Fixes: https://tracker.ceph.com/issues/71628 Signed-off-by: Zac Dover <[email protected]>
1 parent 23beffb commit d88cdf0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

doc/cephfs/disaster-recovery.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,53 @@ Note that this command acts as a normal CephFS client to find all the
5959
files in the file system and read their layouts, so the MDS must be
6060
up and running.
6161

62+
Using first-damage.py
63+
---------------------
64+
65+
#. Unmount all clients.
66+
67+
#. Flush the journal if possible:
68+
69+
.. prompt:: bash #
70+
71+
ceph tell mds.<fs_name>:0 flush journal
72+
73+
#. Fail the file system:
74+
75+
.. prompt:: bash #
76+
77+
ceph fs fail <fs_name>
78+
79+
#. Recover dentries from the journal. If the MDS flushed the journal
80+
successfully, this will be a no-op:
81+
82+
.. prompt:: bash #
83+
84+
cephfs-journal-tool --rank=<fs_name>:0 event recover_dentries summary
85+
86+
#. Reset the journal:
87+
88+
.. prompt:: bash #
89+
90+
cephfs-journal-tool --rank=<fs_name>:0 journal reset --yes-i-really-mean-it
91+
92+
#. Run ``first-damage.py`` to list damaged dentries:
93+
94+
.. prompt:: bash #
95+
96+
python3 first-damage.py --memo run.1 <pool>
97+
98+
#. Optionally, remove the damaged dentries:
99+
100+
.. prompt:: bash #
101+
102+
python3 first-damage.py --memo run.2 --remove <pool>
103+
104+
.. note:: use ``--memo`` to specify a different file to save objects that
105+
have already been traversed. This makes it possible to separate data made
106+
during different, independent runs.
107+
108+
This command has the effect of removing a dentry from the snapshot or
109+
head (in the current hierarchy). The inode's linkage will be lost. The
110+
inode may however be recoverable in ``lost+found`` during a future
111+
data-scan recovery.

0 commit comments

Comments
 (0)