-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(mfs): chroot command to change the root #8648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5aa084e to
247816a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
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. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to latest master and resolved conflicts.
Needs final polish:
- agree on name (maybe
set-root?) - remove / resolve TODOs inline
- add new command to changelog
- tests pass, CI green
…s-cmd/mfs-new-root # Conflicts: # core/node/core.go
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ 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
remove LongDescription and keep only ShortDescription with examples, following the majority pattern in the codebase (81% of commands use only ShortDescription).
Some minor fixes pending but it should get a review at this point.
(Sharness test also pending.)