Module 7 Lesson 2: Disk Space Management
·AI & LLMs

Module 7 Lesson 2: Disk Space Management

Managing the gigabytes. How to clear space and move your Ollama model library to a larger drive.

Disk Space: Managing the AI Library

If you catch the "Ollama Fever," you will soon find yourself pulling every model in the registry. Llama 3 (5GB), Mistral (4GB), Command R (24GB)... suddenly, your 512GB SSD is full.

Here is how to manage the "Bloat."

1. Finding the Bloat

Run ollama list. This is your primary inventory. Look for models you haven't used in weeks.

To delete a model and instantly reclaim space: ollama rm model-name


2. Where are the files stored?

Ollama stores models in a hidden folder.

  • macOS/Linux: ~/.ollama/models
  • Windows: C:\Users\<username>\.ollama\models

Note: You won't see "Llama-3" files in there. Ollama uses a content-addressed storage (blobs). Do not try to delete files manually from these folders; always use ollama rm.


3. Moving the Library to an External Drive

If your main laptop drive is small, you can move your models to a larger external SSD or a second internal drive.

On Windows:

  1. Close Ollama.
  2. Set a system-wide Environment Variable: OLLAMA_MODELS to your new path (e.g., D:\OllamaModels).
  3. Restart Ollama.

On macOS/Linux:

  1. Stop the Ollama service.
  2. Export the variable in your shell profile (.zshrc or .bashrc): export OLLAMA_MODELS=/Volumes/ExternalSSD/ollama/models.
  3. Restart the service.

4. Pruning the Registry

Over time, Ollama might have "dangling" manifest files if a download was interrupted. While rare, you can usually fix this by running ollama pull [model] again to ensure the file is complete, or ollama rm to purge it.


Summary Checklist

  1. Inventory: Run ollama list weekly.
  2. Removal: Delete models that were just for "testing."
  3. Expansion: Use OLLAMA_MODELS to point to a high-capacity drive.
  4. Health Check: Ensure you have at least 10% free space on your system drive for the OS to run smoothly.

Key Takeaways

  • Models are large and consume disk space rapidly.
  • Use ollama rm as the only safe way to delete models.
  • The OLLAMA_MODELS environment variable allows you to host models on any drive.
  • Avoid using slow external HDDs (Hard Drives); only use external SSDs for model storage.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn