Troubleshooting FileCoin No Space Left on Device

Ethan Wu
Numbers Protocol
Published in
2 min readMar 15, 2021

--

Having worked with FileCoin as a client since Mainnet launch, there are a number of things that can happen while working with it. One such issue is the following:

│2020-11-23T01:21:48.245Z        ERROR   badger  v2@v2.2007.2/db.go:1130 Failure while flushing memtable to disk: write /home/ubuntu/.lotus/datastore/chain/022296.sst: no space left on device. Retrying...

no space left on device is something that will inevitably happen when you have limited disk space. FileCoin chain continues to grow larger and larger and disk space is not unlimited. So how do you resolve this issue painlessly? In this quick tutorial, we will walk you through the steps to resolve this issue.

Prerequisites

This tutorial assumes that you have a machine with lotus set up properly and running. If you have questions about this please refer to FileCoin Documentation on how this is done.

Stopping Lotus

Fixing no space left on device is very simple but steps must be followed exactly in order to avoid losing key information. First you must stop lotus by running:

lotus daemon stop

Verify that the daemon is no longer running by running:

ps fuxa | grep lotus

If you see the following output than you are good to go onto the next step:

xxxx      93863  0.0  0.0   9340   732 pts/4    S+   09:44   0:00      \_ grep --color=auto lotus

Otherwise you may need to run to the following to stop the process:

kill -9 <process ID>

Verify Lotus version

The next step would be to check to see if lotus is on the current released version. To do this run lotus -v to check the version number and compare it to the one listed under Releases on the Lotus GitHub Project page.

If lotus is the correct version then you can go onto the next step otherwise go through the steps to update lotus .

Remake Chain

The final step is to rebuild the chain by executing the following:

rm ~/.lotus/datastore/chain/*

Start daemon back up

Once you have completed remaking chain you can go ahead and fire the daemon back and you should be back up and running in 20 minutes depending on your system!

lotus daemon --import-snapshot https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car

Final Remarks

That’s it! This is the full walkthrough for troubleshooting no space left on device on lotus . If you have any questions or comments feel free to leave a comment! If interested in more FileCoin content feel free to check out our other Numbers FileCoin content on my Medium Page.

--

--

Ethan Wu
Numbers Protocol

Recent M.S Graduate and Numbers Software Developer & Developer Relations/Community Manager