Ubuntu 24.04 new install
Gnome, X11, dash to panel plugin
I’ve installed Ollama on my pc, after install, I checked and it’s working, after few times changing the model’s folder to my separate HD, I can’t activate ollama any longer, what’s the correct procedure? The steps I took: open terminal
sudo systemctl status ollama
sudo systemctl stop ollama
sudo geany /etc/systemd/system/ollama.service
add Environment=“OLLAMA_MODELS=/media/data/backup/user/AI/Ollama_models/” at the end of [Service] entry, then save and exit
sudo systemctl daemon-reload
sudo systemctl restart ollama.service
I remembered doing the same procedure in my previous MX Linux, it was working fine, but this time I got the error Process: 8334 ExecStart=/usr/local/bin/ollama serve (code=exited, status=1/FAILURE) What I’m missing?
Does the user Ollama is running as have permission to
read, write, and navigate your custom Ollama models directory (rwx permissions);
navigate (at least x permission) all parent/ancestor directories of your custom Ollama models directory, so that it can reach your custom Ollama models directory:
@halogen2 yes, this is the message Loaded: loaded (/etc/systemd/system/ollama.service; enabled; preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2025-03-23 14:29:46 > Process: 24698 ExecStart=/usr/local/bin/ollama serve (code=exited, status=1/FAILURE) Main PID: 24698 (code=exited, status=1/FAILURE)
and the log shows permission error Mar 23 14:29:49 UbuntuMini systemd[1]: Started ollama.service - Ollama Service. Mar 23 14:29:49 UbuntuMini ollama[24712]: 2025/03/23 14:29:49 routes.go:1230: INFO server> Mar 23 14:29:49 UbuntuMini ollama[24712]: Error: mkdir /media/data: permission denied Mar 23 14:29:49 UbuntuMini systemd[1]: ollama.service: Main process exited, code=exited, > Mar 23 14:29:49 UbuntuMini systemd[1]: ollama.service: Failed with result 'exit-code'. Mar 23 14:29:52 UbuntuMini systemd[1]: ollama.service: Scheduled restart job, restart cou>
and my Ollama_models folder is wide open drwxrwxrwx 1 root root 0 Mar 23 08:53 Ollama_models
do I need to change the owner?
Does the /media/data directory exist?
Are you running Ollama with some kind of sandboxing (e.g. AppArmor, bubblewrap, or systemd-based sandboxing)?
Could you please post the full contents of your /etc/systemd/system/ollama.service file?
@halogen2 yes, /media/data directory exist
no, I’m not running in sandboxing, which one do you use/recommend?
here’s the output:
`[Unit]
Description=Ollama Service
After=network-online.target