On MX23 Linux how can I move Ollama with all the models to another disk and still use them on MX23 Linux

On MX23 Linux how can I move Ollama with all the models to another disk and still use them on MX23 Linux

On MX23 Linux how can I move Ollama with all the models to another disk and still use them on MX23 Linux

On MX23 Linux, to move Ollama and all its models to another disk and keep using them, the best approach is to:

  1. Choose or create a new directory on the other disk where you want to store Ollama models, for example, /mnt/data/ollama-models.
  2. Stop the Ollama service to prevent file conflicts.
  3. Move the existing models from the default location (usually ~/.ollama/models or /usr/share/ollama/.ollama/models) to the new directory.
  4. Change the environment setting for Ollama to look for models in the new location by setting the environment variable OLLAMA_MODELS to the new directory path.
  5. On MX23 Linux (systemd-based), you do this by editing the Ollama systemd service configuration with sudo systemctl edit ollama.service and adding:
[Service]
Environment="OLLAMA_MODELS=/mnt/data/ollama-models"
  1. Save the file, reload systemd with sudo systemctl daemon-reload, then restart Ollama with sudo systemctl restart ollama.
  2. Ensure ownership and permissions of the new directory allow the Ollama user to access and modify the files.

This allows Ollama to transparently operate using the models stored on the other disk without issues and keeps your root disk free from large model files. It is advised to copy first for safety and verify operation before removing originals.

This approach is confirmed by recent reliable guides from 2025 and community experience with Ollama on Linux systems.byteplus+3

Related

Create a systemd service that points Ollama to models on a new disk

Best safe rsync command to move ~/.ollama/models to another partition

How to set OLLAMA_MODELS environment persistently for all users

Steps to mount a secondary disk at ~/.ollama/models without losing data

How to verify Ollama recognizes models after moving them