Gitea problem: enter absolute path

I want to run Gitea as a service, but want to change the location of the database to another drive (not the ZIMA OS drive).
I have no clue what to put in there. And I tried for example:
/media/SSD2TB/SSD2TB/gitea/gitea.db
but it complains:
Failed to create directories: mkdir /media/SSD2TB: permission denied

This isn’t a path issue, it’s permissions.

The Gitea container can’t write to /media/SSD2TB, so mkdir fails.

Do this:

mkdir -p /media/SSD2TB/gitea
chown -R 1000:1000 /media/SSD2TB/gitea
chmod -R 775 /media/SSD2TB/gitea

Then mount it properly in Docker:

-v /media/SSD2TB/gitea:/data

And inside Gitea use:

/data/gitea.db

Never use the host path inside the container.

This command fails (doing that via the web-terminal version)

drwxrwxrwx 4 root root 4096 Feb 13 10:29 AppData
drwxrwxrwx 2 root root 4096 Feb 11 07:02 Backup
drwxrwxrwx 2 root root 4096 Feb 11 07:02 Documents
drwxrwxrwx 2 root root 4096 Feb 11 07:02 Downloads
drwxr-xr-x 4 root root 4096 Feb 13 09:01 Duplicati
drwxrwxrwx 2 root root 4096 Feb 11 07:02 Gallery
drwx------ 2 root root 16384 Feb 11 07:01 lost+found
drwxr-xr-x 5 root root 4096 Feb 11 07:02 Media
marcelloh@ZimaOS:~ ➜ $ mkdir -p /Media/SSD2TB/gitea
mkdir: cannot create directory ‘/Media’: Read-only file system

This is the root of the Zima OS drive.

I did try now with ssh via normal cli terminal: same result.

I found out that /media exists, nut is not visible when I do ls -l.

chown -R 1000:1000 /media/SSD2TB/SSD2TB/gitea
chown: changing ownership of ‘/media/SSD2TB/SSD2TB/gitea’: Operation not permitted
marcelloh@ZimaOS:/media/SSD2TB/SSD2TB ➜ $ chmod -R 775 /media/SSD2TB/SSD2TB/gitea
chmod: changing permissions of ‘/media/SSD2TB/SSD2TB/gitea’: Operation not permitted

So I have this double stuff, because I am not able to share a disk, only can share a directory to samba, so I doubled it (first is disk, 2nd is folder):
SSD2TB/SSD2TB/

That explains it.

You’re trying to create /Media/... on the ZimaOS system drive, which is mounted read-only. That’s why you get:

Read-only file system

On ZimaOS you must not write to /Media (capital M) or the OS root.

First check where the SSD is actually mounted:

mount | grep -i ssd
lsblk -f

It will likely be something like:

/media/SSD2TB

(lowercase /media, not /Media)

Then create the folder there:

mkdir -p /media/SSD2TB/gitea
chown -R 1000:1000 /media/SSD2TB/gitea

If /media/SSD2TB does not exist, the drive is not mounted — and that’s the real issue.

Post:

ls -l /media

and we’ll confirm the correct path.

I did ls - l inside like this:
marcelloh@ZimaOS:/media/SSD2TB/SSD2TB ➜ $ ls -l
drwxr-xr-x 1 root root 688 Feb 13 08:26 data
drwxrwxrwx 1 root root 0 Feb 13 12:42 gitea
drwxr-xr-x 1 root root 720 Feb 13 10:10 ‘Google Photos’
drwxr-xr-x 1 root root 342 Feb 12 18:16 stack

(created the gitea via smb)

Good, that tells us everything.

Your folder exists:

/media/SSD2TB/SSD2TB/gitea

Permissions:

drwxrwxrwx 1 root root gitea

That’s 777, so permissions are fine.

The real issue is this:

You are trying to create folders at /Media/... (capital M, OS root, read-only).

Your drive is mounted at:

/media/SSD2TB/SSD2TB

(lowercase /media and double SSD2TB layer).

So use this exact path in Docker:

/media/SSD2TB/SSD2TB/gitea

And inside the container use:

/data/gitea.db

Make sure your container has this bind mount:

-v /media/SSD2TB/SSD2TB/gitea:/data

You’re very close, just path case + mount mapping.

Where do I put it in. I’ve changed all the /media/SSD2TB/SSD2TB/gitea to /data/gitea in the setup of gitea, but now it created everything in the wrong drive (the ZIMA OS one)

Got it… So in the settings (which was the same problem with duplicati, I now have the correct folder mapping
/media/SSD2TB/SSD2TB/gitea → /gitea
then changed everything in the gitea settings to use that folder.
So the 1st settings are the way the docker container can access the outside :slight_smile:

1 Like

So thanks again. slowly understand the “innerworkings”

Perfect, that’s exactly it.

Host path:

/media/SSD2TB/SSD2TB/gitea

Container path:

/gitea

The left side is what Docker exposes from the host.
The right side is what Gitea sees internally.

Once you understand that separation (host vs container filesystem), everything with ZimaOS + Docker starts to make sense.

You’re on the right track