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

It tells I am

Hosting [164.7 MB of 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