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