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:
- Choose or create a new directory on the other disk where you want to store Ollama models, for example,
/mnt/data/ollama-models. - Stop the Ollama service to prevent file conflicts.
- Move the existing models from the default location (usually
~/.ollama/modelsor/usr/share/ollama/.ollama/models) to the new directory. - Change the environment setting for Ollama to look for models in the new location by setting the environment variable
OLLAMA_MODELSto the new directory path. - On MX23 Linux (systemd-based), you do this by editing the Ollama systemd service configuration with
sudo systemctl edit ollama.serviceand adding:
[Service]
Environment="OLLAMA_MODELS=/mnt/data/ollama-models"
- Save the file, reload systemd with
sudo systemctl daemon-reload, then restart Ollama withsudo systemctl restart ollama. - 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