Skip to content

Conversation

@schomatis schomatis self-assigned this Jan 10, 2022
@nlko

This comment was marked as outdated.

@bqv

This comment was marked as outdated.

@schomatis
Copy link
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.

@BigLep

This comment was marked as outdated.

@BigLep BigLep removed the request for review from hsanjuan March 3, 2022 13:39
@BigLep BigLep added this to the Best Effort Track milestone Mar 3, 2022
@schomatis

This comment was marked as outdated.

@bqv

This comment was marked as outdated.

@schomatis

This comment was marked as outdated.

@bqv

This comment was marked as outdated.

@BigLep BigLep marked this pull request as ready for review March 4, 2022 01:25
@BigLep

This comment was marked as outdated.

@schomatis

This comment was marked as outdated.

@lidel lidel requested a review from a team as a code owner October 3, 2024 20:13
Copy link
Member

@lidel lidel left a 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

@lidel lidel marked this pull request as draft October 3, 2024 20:24
@lidel lidel mentioned this pull request Feb 14, 2025
56 tasks
@hsanjuan hsanjuan self-assigned this Feb 17, 2025
@lidel lidel mentioned this pull request Mar 20, 2025
45 tasks
@lidel lidel mentioned this pull request May 21, 2025
46 tasks
@lidel lidel mentioned this pull request Jul 14, 2025
51 tasks
@lidel lidel mentioned this pull request Oct 1, 2025
74 tasks
@lidel lidel mentioned this pull request Nov 27, 2025
56 tasks
@lidel lidel assigned lidel and unassigned hsanjuan and schomatis Jan 13, 2026
@lidel lidel changed the title feat(cmds): files: add new-root command to change the MFS root feat(mfs): chroot command to change the root Jan 13, 2026
…s-cmd/mfs-new-root

# Conflicts:
#	core/node/core.go
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)
Copy link
Member

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).
@lidel lidel force-pushed the schomatis/feat/files-cmd/mfs-new-root branch from ea08931 to 4cf0bbf Compare January 13, 2026 19:47
@lidel lidel marked this pull request as ready for review January 13, 2026 19:47
@lidel lidel requested review from gammazero and removed request for aschmahmann January 13, 2026 19:48
remove LongDescription and keep only ShortDescription with examples,
following the majority pattern in the codebase (81% of commands use
only ShortDescription).
@lidel lidel merged commit 39c609b into master Jan 13, 2026
20 checks passed
@lidel lidel deleted the schomatis/feat/files-cmd/mfs-new-root branch January 13, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment