feat(mfs): chroot command to change the root#8648
Merged
Merged
Conversation
5aa084e to
247816a
Compare
This was referenced Jan 10, 2022
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
Author
|
Correct, thanks. Right now the idea is for this command to be used when the MFS filesystem is corrupted and the daemon fails to start (either hangs or refuses) and you need to run this standalone to fix it. If you run it alongside the daemon it will fail as it will try to get a lock on the repo which is already in use. Will add some more documentation around that. |
lidel
reviewed
Jan 11, 2022
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
lidel
reviewed
Oct 3, 2024
…s-cmd/mfs-new-root # Conflicts: # core/node/core.go
lidel
reviewed
Jan 13, 2026
Comment on lines
+248
to
+249
| return nil, fmt.Errorf("failed to initialize MFS root from %s stored at %s: %w. "+ | ||
| "If corrupted, use 'ipfs files chroot' to reset (see --help)", nd.Cid(), FilesRootDatastoreKey, err) |
Member
There was a problem hiding this comment.
ℹ️ this will help users like #10762 to be able to get useful error message and self-fix the problem
adds recovery command for corrupted MFS root (issue #10762): - `ipfs files chroot [--confirm] [<cid>]` replaces the MFS root CID - defaults to empty directory if no CID specified - validates new CID exists locally and is a directory - exports FilesRootDatastoreKey constant for reuse - improved error message shows CID and suggests recovery replaces the previous `replace-root` approach with renamed command following the `ch*` pattern (chcid, chmod, chroot).
ea08931 to
4cf0bbf
Compare
gammazero
approved these changes
Jan 13, 2026
remove LongDescription and keep only ShortDescription with examples, following the majority pattern in the codebase (81% of commands use only ShortDescription).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some minor fixes pending but it should get a review at this point.
(Sharness test also pending.)