]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/cephfs: document first-damage.py 63977/head
authorZac Dover <zac.dover@proton.me>
Mon, 16 Jun 2025 08:02:49 +0000 (18:02 +1000)
committerZac Dover <zac.dover@proton.me>
Tue, 17 Jun 2025 10:28:08 +0000 (20:28 +1000)
Document the use of first-damage.py.

Fixes: https://tracker.ceph.com/issues/71628
Signed-off-by: Zac Dover <zac.dover@proton.me>
(cherry picked from commit d88cdf039d02055d3379eb91a5a9bab655d40d2d)

doc/cephfs/disaster-recovery.rst

index a728feb55d097cf5e0721f23df92904d2e2e8068..0e754160403d2c7052aa958938ad00594ce07b4c 100644 (file)
@@ -59,3 +59,53 @@ Note that this command acts as a normal CephFS client to find all the
 files in the file system and read their layouts, so the MDS must be
 up and running.
 
+Using first-damage.py
+---------------------
+
+#. Unmount all clients.
+
+#. Flush the journal if possible:
+
+   .. prompt:: bash #
+      
+      ceph tell mds.<fs_name>:0 flush journal
+
+#. Fail the file system:
+
+   .. prompt:: bash #
+
+      ceph fs fail <fs_name>
+
+#. Recover dentries from the journal. If the MDS flushed the journal
+   successfully, this will be a no-op:
+
+   .. prompt:: bash #
+
+      cephfs-journal-tool --rank=<fs_name>:0 event recover_dentries summary
+
+#. Reset the journal:
+   
+   .. prompt:: bash #
+
+      cephfs-journal-tool --rank=<fs_name>:0 journal reset --yes-i-really-mean-it
+
+#. Run ``first-damage.py`` to list damaged dentries:
+
+   .. prompt:: bash #
+
+      python3 first-damage.py --memo run.1 <pool>
+
+#. Optionally, remove the damaged dentries:
+
+   .. prompt:: bash #
+
+      python3 first-damage.py --memo run.2 --remove <pool>
+
+   .. note:: use ``--memo`` to specify a different file to save objects that
+      have already been traversed. This makes it possible to separate data made
+      during different, independent runs.
+
+      This command has the effect of removing a dentry from the snapshot or
+      head (in the current hierarchy). The inode's linkage will be lost. The
+      inode may however be recoverable in ``lost+found`` during a future
+      data-scan recovery.