最近购入了一台天钡 Wtr pro amd 版,安装 unraid 后部署了最新版 immich,但是发现每次重启 unraid 后 immich 的账户都会丢失。经排查发现是 env 文件中 DB_DATA_LOCATION 设置错误导致的。

错误设置为:

1
2
3
4
# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/user/immich
# The location where your database files are stored
DB_DATA_LOCATION=/volumn1/...

正确设置为

1
2
3
4
# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/user/immich
# The location where your database files are stored
DB_DATA_LOCATION=/mnt/user/appdata/immich/postgres

由于 volumn1 卷为虚拟位置,postgres 可以正确启动,但是断电后数据会全部丢失,导致上传的文件还在但是包括账号、图片索引在内的数据库记录丢失,将 DB_DATA_LOCATION 设置为一个实际存在的位置即可。