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
(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
(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
7 Replies
:wave: Hey @hobospy,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:Don't put the database on a usb drive, keep it internal
library is fine, but not the db
As for the error you're getting, it simply means the database container has no permission to edit the files
The problem is that the drive has an ntfs filesystem
Ah wow, why even on ubuntu 🙃
Ahhhhh keeping the DB local sorted it (so I was pushing it onto a separate HDD in the same machine, guessing that isn't supported?).
NTFS: This is a dual boot old HTPC, think the NTFS was a hangover from original installation with Windows
Thanks for sorting that
It is supported though not recommended, but database not on NTFS is not
Thank you