GrepBoard/Manuals
605 manuals ·

cephfs-journal-tool EPERM: Cannot run on an active file system

·Tested on Ceph Reef 18.2 · Squid 19.2 official docs, source and PRs · 2026-10·Test scope ↓·6 steps

Why cephfs-journal-tool fails with EPERM on an active file system: the documented condition, where the source checks it, which releases do, another EPERM cause.

output
Cannot run cephfs-journal-tool on an active file system!

When cephfs-journal-tool prints this and ends with EPERM (Operation not permitted), the rank you named is in the up:active state. The tool is refusing on purpose; it is not a permissions problem. This article explains why and does not give a recovery procedure. The tool edits internal file system structures directly and can lose data.

[1] Check the documented condition. The warning box in the cephfs-journal-tool doc says: "As a precaution, cephfs-journal-tool doesn't work on an active filesystem." (Squid 19.2.3 doc L12-L19). "Active" refers to the MDS state of the target rank.

[2] Find the check in the source. After JournalTool::main parses its arguments and connects to RADOS, and before it splits into the journal, header and event modes, it does this ([JournalTool.cc L143-L146](https://github.com/ceph/ceph/blob/v19.2.3/src/tools/cephfs/JournalTool.cc#L143-L146)).

output
  if (fs.get_mds_map().is_active(rank)) {    derr << "Cannot run cephfs-journal-tool on an active file system!" << dendl;    return -EPERM;  }

Two things follow. The check sits before the mode split, so even the read-only journal inspect is refused for the same reason. And is_active(rank) only compares the rank's state with STATE_ACTIVE ([MDSMap.h L534](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSMap.h#L534)). When the check returns -EPERM, the caller main receives it and prints one more line, Error ( plus the cpp_strerror string ([cephfs-journal-tool.cc L50-L53](https://github.com/ceph/ceph/blob/v19.2.3/src/tools/cephfs/cephfs-journal-tool.cc#L50-L53)). So the message above is followed by a line of the form Error ((1) Operation not permitted) (cpp_strerror builds (number) message: [errno.cc L8-L22](https://github.com/ceph/ceph/blob/v19.2.3/src/common/errno.cc#L8-L22)). Passing the check does not make the tool safe to use; the docs' warning still stands.

[3] Read the rank's state with read-only commands. In these releases --rank is mandatory (missing mandatory "--rank" argument) and has the form <fs_name>:<rank>.

console
$ ceph fs status$ ceph fs dump

ceph fs dump shows per-rank state, and the docs explain the states in MDS States. For example, a rank no MDS holds is in the failed set and shown as down:failed.

[4] See which releases refuse. The check came in with commit 57f7d8b70f ("cephfs-journal-tool: Add warning messages during 'journal reset' and prevent execution on active fs", 2024-02-22), through PR #55758 ("cephfs-journal-tool: Add preventive measures to avoid fs corruption", merged to main 2024-05-29) and issue #62925. The issue gives as its reason people using the tool without internals knowledge, ending in an MDS crash. Checking the source at each tag:

ReleaseMessage Cannot run cephfs-journal-tool
Quincy 17.2.8 · 17.2.9absent
Reef 18.2.4absent
Reef 18.2.5 · 18.2.6 · 18.2.7present
Squid 19.2.0 · 19.2.3present

So if the refusal showed up only after you upgraded from 18.2.4 or older to 18.2.5, this change is why. The doc warning line is also present from 18.2.5. Evidence: [18.2.5 JournalTool.cc L144](https://github.com/ceph/ceph/blob/v18.2.5/src/tools/cephfs/JournalTool.cc#L144) and 19.2.0 L144 (18.2.4 has no such line), plus the backport issues: reef #66278 (PR 57761, released in v18.2.5) and squid #66277 (PR 57760, released in v19.2.0) are Resolved, and quincy #66280 is Rejected.

[5] Tell apart the other cause of EPERM. In the same tool, a --journal value other than mdlog or purge_queue makes validate_type return -EPERM after printing journal type is not correct. ([JournalTool.cc L200-L206](https://github.com/ceph/ceph/blob/v19.2.3/src/tools/cephfs/JournalTool.cc#L200-L206)). Check for a typo first. The message from step [2] means the state check; this message means a bad --journal value.

[6] Follow the documented order. How to take a rank out of the active state, and what comes after, is not covered here. If you need it, read that part of the docs in sequence. The docs say to copy the journal with journal export before any dangerous operation (the "Journal export" section) and give each later step with its own warnings. Do not skip steps or cherry-pick one.

#ceph#cephfs#cephfs-journal-tool#EPERM#mds