© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
ImmichI
Immich•9mo ago•
11 replies
hobospy

Ubuntu problems with DB and Postgres on mounted drive

Hey,
I'm trying to get Immich up and running on my Ubuntu machine, disclaimer I'm relatively new to all things Linux/Ubuntu so this could be a completly noob question but I've been banging my head against a wall for two days now.

I have Immich running from my main OS drive but want to push the library and DB entries in the .env file point to a location on my media drive (separate HDD). When the entries were pointing to a local file I managed to get the system up and running and upload photos from my phone. After updating the .env file to point to the mounted drive I can't get Immich to run and from the logs it looks permission related, there is an entry that states that the chmod command for postgres failed. Can anyone with this (what I think is relatively simple) config point me to what I need to do. I have updated /etc/fstab to auto mount the drive on startup, if I delete the library and postgres folders before running Immich I can see them recreated so I feel I am pretty close.

(Originally posted to focus-discussion but moved)

/etc/fstab:

/dev/sdc2 /media/hobospy/Data ntfs rw,auto,user,fmask=000,dmask=000,uid=1000,gid=1000,exec 0 2
/dev/sdc2 /media/hobospy/Data ntfs rw,auto,user,fmask=000,dmask=000,uid=1000,gid=1000,exec 0 2


(This is the second attempt at the fstab file, originally I had defaults on the permissions section, the current values are copied from a StackOverflow suggestion but for Plex access)


.env:

UPLOAD_LOCATION=/media/hobospy/Data/Media/Immich/library
UPLOAD_LOCATION=/media/hobospy/Data/Media/Immich/library
(DB location the same except postgres instead of library)


Docker log:

initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
ImmichJoin
A place to hang out, get support, discuss Immich, get announcements about releases and anything else going on.
36,590Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Mounted drive keeps changing
ImmichIImmich / help-desk-support
2mo ago
Setting up new instance using external mounted drive on Mac
ImmichIImmich / help-desk-support
2y ago
Postgres DB Corrupted
ImmichIImmich / help-desk-support
9mo ago
Issue with Restore on ubuntu
ImmichIImmich / help-desk-support
3y ago