Search code examples
google-colaboratorydiskspace

How do I empty the disk on colab?


I'm had to use multiple notebooks for reasons and I don't need them anymore. My disk is more than half full and I cant figure what files I need to delete inorder to clear the disk.


Solution

  • Files that you save in Google Colab are there only for the duration of the session - they will all get deleted when you end it.

    That's why it's common to move the files outside of this space. This is done either through your local file system or via some other online service - especially popular is using Google Drive for that purpose, as it's free and Google even already uses it to save your colabolatory notebooks. So I'm assuming this is what you meant.

    However, the location of the files there depends only on the notebooks you run. You need to look at their code to determine where on your drive they saved the files - some might just save them to the root of your Google Drive, others will create directories for their files.

    If what you're looking for is just the location of the notebooks, they are in a folder called "Colab Notebooks" - but they themselves shouldn't take too much space. Most of the space will probably be taken by data they needed or saved.

    If you want to look for where these files are saved, search for paths containing My Drive - when mounting the drive (often to /content/drive) this folder will represent the root folder of your Google Drive. The path following My Drive is the actual path to the file on your drive.

    So for example /content/drive/My Drive/foo.txt means a file foo.txt that isn't in any folder on your drive.