How to update the storage location?

I’ve tried to change the storage location of my Kudo node by altering the config file, adding the new location to under Datastore/child/path". It was “path”: “/blocks”, and I simply changed to “path”: “/location/ipfs”`.

  "Datastore": {
    "StorageMax": "10GB",
    "StorageGCWatermark": 90,
    "GCPeriod": "1h",
    "Spec": {
      "mounts": [
          "child": {
            "path": "/media/<user>/<ssddisk>/ipfs", #CHANGES HERE
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"

After that, when trying to start the daemon, I get an error saying that the datastore configuration of <...> does not match what is on disk <...>

Then I got back to the config file and tried to revert the changes back to "path": "'/blocks" but I still get the same error, as seen below:

Error: datastore configuration of ‘{“mounts”:[{“mountpoint”:“/blocks”,“path”:“blocks”,“shardFunc”:“/repo/flatfs/shard/v1/next-to-last/2”,“type”:“flatfs”},{“mountpoint”:“/”,“path”:“datastore”,“type”:“levelds”}],“type”:“mount”}’ does not match what is on disk ‘{“mounts”:[{“mountpoint”:“/blocks”,“path”:“/blocks”,“shardFunc”:“/repo/flatfs/shard/v1/next-to-last/2”,“type”:“flatfs”},{“mountpoint”:“/”,“path”:“datastore”,“type”:“levelds”}],“type”:“mount”}’

How could I fix the problem, and how can I set the new storage location?

Thanks in advance!

Now I suppose I could have simply

ipfs config Datastore.Path <newpath>

But if I try this at the current state, ir returns the same error above.

Solved! In fact, all I needed was to reboot the device (I had restarted the service but it wasn’t enough).

Well, now suddenly a new error:

~$ ipfs swarm peers
Error: old style datatstore config detected

I tried to find solutions in the forum, but TBH I’m lost atm and I’d appreciate your advice.

For context, I’m running Kobo over Ubuntu over a RPi4, and I’m trying to set the storage to an attached SSD drive.


The datastore configuration in:

  • The .ipfs/config file
  • The .ipfs/datastore_spec
  • In flatfs, the .ipfs/blocks/SHARDING

must match or result in errors. You cannot ipfs config set to change the datastore location.

However you can:

  • Move blocks to a separate drive and create a symlink (ln -s /path/to/blocks blocks) (OK-ish)
  • Set IPFS_PATH=/mnt/mydrive/ipfs before running ipfs so that the ipfs configuration and datastore is on the custom location of choice (BEST). The env-var needs to be set for everything (running the daemon and running other commands).

The latter works best when deciding to use a different datastore etc.

1 Like

Thank you for the help, Hector. I appreciate you taking the time :pray:t4:

And I’m sorry in advance for the super noobie question, but where should I set IPFS_PATH=?

Besides, when you say " before running ipfs", do you mean before initializing ipfs (ipfs init) or when exactly?

If you’re using bash: export IPFS_PATH="/your/path". It’s an environment variable (you can google that).

I mean before running any ipfs commands, including init and daemon.

1 Like

I thought I got it but it seems it’s not as simple as it sounded like, though :sweat_smile:

You forgot to put export: export IPFS_PATH=......

1 Like

Thank you very much for your patience, @hector :pray:t4: