HowTo Reset my ipfs storage? go-ipfs CLI and Companion IPFS doesn't show same data

Wishing to reset my ipfs storage, I used:

ipfs pin ls -q --type recursive | xargs ipfs pin rm

When I open web companion in firefox
http://127.0.0.1:8080/ipfs/Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip/#/

It tells I am

Hosting [164.7 MB of files](http://127.0.0.1:8080/ipfs/Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip/#/files)

Should I remove ā€œ~/.ipfs/blocksā€ to empty ?
What would be the command line for it, hash by hash?

Files and pins are not the same thing. Files are basically named CIDs which are organized in a folder/file structure.

Do a ā€˜ipfs files ls /ā€™ to get a listing.of all files you currently hold.

You can remove them with ā€˜ipfs files rm $pathā€™.

Also make sure to run a ā€˜ipfs repo gcā€™ afterwards. Removing files or unpin CIDs doesnā€™t actually remove them from your storage. You might still provide those files from your cache to the network, if you havenā€™t run a gc.

It just releases the ā€œlockā€ on them, so if youā€™re running low on storage, the garbage collector is able to purge them.

To see how much is currently in your cache, take a look at ā€˜ipfs repo stat --humanā€™. The NumObjects and RepoSize will show you how much thereā€™s in the cache which might be pinned/added as file or not.

1 Like