Synology photos use existing folder structure outside /home/Photos

40
4
NAS
DS1819+ DS1817+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. iOS
Last edited:
Hi.

I have a shared folder (called "Photo Gallery") which holds all my photos accumulated during the years.

Now, I would like to use the Synology Photos app to present those photos. However I would not like to copy (=duplicate) all the photos (there are a lot!) from the existing shared folder to /home/Photos (Personal Space).

Can I tell Synology Photos to use an existing shared folder or any other folder as source for my photos (i.s.o. the standard /home/Photos)?

Thanks,
 
The short answer is: no.

How is your shared folder used? Who accesses it, with what means (e.g. SMB, desktop application, NAS package, Docker container), do they have read and write access?

Just trying to understand your reluctance to placing your photo folders into a location that Synology Photos can access it. There is also the Shared Space in Photos that uses shared folder 'photo'. Maybe this would be acceptable as a new location for your photo folders?
 
The point is that I have different sources of photos (digital camera(s), mobile phones of family members, screenshots, processed pictures, ...) and they are structured in different locations and different shared folders. They also have different permissions across the users. Theoretically, I could conglomerate all together in /home/<user>/Photos, but this would imply quite a lot of reconfiguration, basically making out of an ordered ordered structure a bit of a mess.

First I would like to exploit all other potential options - hence present post.

Is there no possibility using ...
  • btrfs deduplication
  • symbolic links, hardlinks (ln (-s))
  • ... ?
 
I've not heard of a successful hacking of Photo Station, Moments, or Photos use of the default locations. If you did manage to hack the package to direct it to the name of you shared folder then you'd have to be certain that permissions are maintained. Then there's ensuring that indexing works when new images are uploaded.

Within the default locations you have more flexibility to organise by folder if you like, it depends how new photos get added (Photos Mobile can upload to a custom folder within the Personal or Shared Space and then year/month folders). I kept the MobileBackup folder approach from, was it?, Moments and have a folder per mobile device.

For cameras, I created a subfolder called CameraBackup within my /home/Photos where I upload images from my camera, via Nikon Transfer 2 on my MacBook: there're two folders, one for untouched originals and another other for worked images. Then I have other subfolders for things like an export of Mac Photos library up to the point I sort of stopped using it, and a subfolder for other stuff.

I found it was easier not to fight where Photos (and the two previous packages) wanted to store files. Though it is possible to edit the access permissions on /photo so that you might directly managed content in the Shared Space, maybe this is something you could investigate... using /photo instead of your bespoke /Photo Gallery shared folder.
 
My idea for the solution would not really be a "hack" of the package (id est changing binary), but rather a simple symbolic link to existing folders.

Your solution is of course fine if it works for you, but I have different needs regarding photo structuring. Symlinks are something DSM doesn't support, which is a pity.
Code:
root@ds1819:/volume1/homes/gh/Photos# ls -l
total 4
lrwxrwxrwx+ 1 gh users 27 Jul  5 10:29 Test5 -> '../testfolderwithphotos/'
drwx--x--x+ 1 gh users  0 Jul  5 10:24 testfolderbyDSM
drwx--x--x+ 1 gh users  0 Jul  5 10:06 testfolderbySH
The "testfolderwithphotos" does neither appear in DSM (File Station), nor in "Synology Photos". The other 2 folders show up.
 
Hacking was meant to cover anything that changed the default installation and operation: use of sym-links, editing configuration and other files in /var/packages/SynologyPhotos, etc. would fall under hacking and doing this cannot be guaranteed to work when the package or DSM is next updated. I have updates in Mail Server, Mail Station, and Web Station that all have to be reapplied after updates.

If you want to use Synology Photos then you'll have to work out how your current process has to be adapted, or don't use it and find an alternative image management approach: I chose to adapt and use. Maybe someone else can suggest something.
 
Last edited:
The following seems to work as expected/desired:
  • Create a new folder inside "$HOME/Photos". It serves as mount destination for the source data (files and folders).
  • "mount --bind" the source folder to the destination folder. To make it reboot persistent, use "/etc/rc.local". "/etc/rc.local" even survives a DSM update.
  • Add other folders as desired.
  • Manual "Re-index" is required after changes above.
Code:
root@ds1819:~# mkdir /volume1/homes/gh/Photos/Data
root@ds1819:~# mount --bind '/volume1/Data/DVD Backups/Photos' '/volume1/homes/gh/Photos/Data'
 
You could probably script the mount and re-index then set it up as a scheduled task. I wonder if adding the original or mounted folder to Indexing Service does anything useful, but probably not.

Looking for a known file in the mounted folder would indicate that the mount needs redoing when the file isn’t found. Then you won’t have to rely 100% on rc.local being untouched.
 
The mounting option is what I did and I haven't had any problems with it.

I have it scheduled as a task to run on Boot Up.

Bash:
mount --bind /volume1/homes/jmathai/Dropbox/Photos /volume1/homes/jmathai/Photos
 
Not sure if this is your question, but all my photo's in a separate shared folder /photo, ordered in subfolders.

I've setup a shared space, and do not use the personal folders at all (so no home folders).
You might do the same to your folder Photo Gallery (in settings top right).
You also might want to setup the permissions for other users in the same screen.

Hope that helps. No hacking or scripting, just standard.
 
I would say it was with Task Scheduler...
1688805383410.png


You could also have a Scheduled Task that periodically tests the mount is still there and recreate it if not.
 
@jmathai
How did you schedule the task?
  • as boot script (/etc/rc.local)?
  • using another location (e.g. HOME$) in conjunction with crontab?
  • or via DSM?
As @fredbert suggested - it's a user defined script scheduled via Task Scheduler that runs on boot. It seems to work okay except for the indexing. It's really unpredictable and sometimes can take weeks before photos I've added to the folder show up in Synology Photos.

I'm not sure if mounting it the way I do, the age of my NAS (perhaps under powered for this), or bypassing the web UI for uploading might be the culprit.
 
Last edited:
I put everything now together now. Hope that's the right way. At least it seems to work so far, but I keep an eye on it and will report any deviations from the expected behavior.

CP > Task Scheduler > Triggered Task
  • General > User : root
  • General > Event : Boot-up
  • Task Settings > Run Command : /bin/bash /volume1/homes/gh/Synology_Photos_symlinks.sh
Note : the user must be root, otherwise the script doesn't execute since mount requires root permissions. sudo in front of mount doesn't do it.
Code:
root@ds1819:~# ls -l /volume1/homes/gh/Synology_Photos_symlinks.sh
-rwx------ 1 root root 108 Jul  9 11:41 /volume1/homes/gh/Synology_Photos_symlinks.sh
root@ds1819:~# cat /volume1/homes/gh/Synology_Photos_symlinks.sh
#!/bin/sh
mount --bind '/volume1/Data/DVD Backups/Photos' '/volume1/homes/gh/Photos/Data'
I removed the previous /etc/rc.local script.
 
The following seems to work as expected/desired:
  • Create a new folder inside "$HOME/Photos". It serves as mount destination for the source data (files and folders).
  • "mount --bind" the source folder to the destination folder. To make it reboot persistent, use "/etc/rc.local". "/etc/rc.local" even survives a DSM update.
  • Add other folders as desired.
  • Manual "Re-index" is required after changes above.
Code:
root@ds1819:~# mkdir /volume1/homes/gh/Photos/Data
root@ds1819:~# mount --bind '/volume1/Data/DVD Backups/Photos' '/volume1/homes/gh/Photos/Data'
Hi,

I seem to want to do the same thing. I've recently set up 2 new Synology DS224+ boxes and restored all my old Netgear files. Everything is working hurrah. But I have restored all my photos to a new shared folder at 'volume1/Photos'

I have about 493Gb of photos in many 1866 subdirectories so the prospect of importing everything to the Synology shared photos with the tool is not really feasible. So I was keen to repoint where the Synology photos looks for the shared library.

I've followed your mount bind command structure;

sudo mount --bind '/volume1/Photos' '/volume1/photo/PhotoLibrary'

to point the Synology Photos shared folder to the location of my own photo data.

When I access '/volume1/photo/PhotoLibrary' using Windows file mananger this now displays my full folders and files ok, but I can't seem to get Synology Photos to re-index, so I don't get any files in the Synology Photos app when displaying the shared folder.

Any ideas what I'm doing wrong?

cheers

Rob
 
You are overcomplicating....

(I would rename your Photos to Photo, to remain standard in Synology indexing etc).
Setup a shared space, (top right, settings, shared space) on the shared folder /photo

and do not use the personal folders at all (so no home/photolibrary folders).

You also might want to setup the permissions for other users in the same screen.
 
You are overcomplicating....

(I would rename your Photos to Photo, to remain standard in Synology indexing etc).
Setup a shared space, (top right, settings, shared space) on the shared folder /photo

and do not use the personal folders at all (so no home/photolibrary folders).

You also might want to setup the permissions for other users in the same screen.

Thanks for you reply, sounds plausible, I like the simpler approach.

ok I've tried it, set the permissions on the the share for appropriate users and the internal user of Synology Photos all to RW.

When I renamed my "Photos" folder to "photo" using the mv command it moved the folder inside the system default shared /photo folder. So I then changed directory into /photo and renamed the Photos folder to /photo, thinking that complies with what you suggested

I ran a "Re-Index" in Control Panel >Media Indexing and waited for it to complete, but on checking the Synology Photos app and Shared Space there are still no files / photos showing.

Using a windows pc I can browse and edit the photo files in the new location with any issue so it seems the permissions for the users are ok.

thanks
Rob
 
I’m not sure that renaming a manually created shared folder to the same name as an auto-created shared folder might be the problem.

When installing the Synology Photos package it should also create the /Photo shared folder, with all the necessary access permissions. You also have to enable the ‘shared space’.
 
When I renamed my "Photos" folder to "photo" using the mv command it moved the folder inside the system default shared /photo folder. So I then changed directory into /photo and renamed the Photos folder to /photo, thinking that complies with what you suggested
Not sure if I meant that. I hoped there would be the system folder /Photo and below that all your subfolders with the photo's. You could have moved the subfolders in the photos folder to photo. But happy to hear that they are all there.
Can you confirm: inside synology photos:
1) You have switched to shared space (top left?) and do you see a full list of your subfolders in the left column?
2) best to change to folder view (right icon just below top)
3) In settings top right the shared space points to /photo
4) In settings top right you did run re-index

let me know if it works.
 
Not sure if I meant that. I hoped there would be the system folder /Photo and below that all your subfolders with the photo's. You could have moved the subfolders in the photos folder to photo. But happy to hear that they are all there.
Can you confirm: inside synology photos:
1) You have switched to shared space (top left?) and do you see a full list of your subfolders in the left column?
2) best to change to folder view (right icon just below top)
3) In settings top right the shared space points to /photo
4) In settings top right you did run re-index

let me know if it works.

1) I did
2) yep
3) it does
4) I can't find the "settings top right" re-index in Synology photos so I've gone into control panel and "Media Indexing" theres a button there to Re-index

However I've moved all the subfolders up to reside directly below /photo (system folder) and BINGO they have started to appear in the synoloy photos app. Wonderful...... what a great piece of advice.

Youve made my night....

Thanks so much
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Thank you for sharing, the CN apk worked well for me, as I am in China right now. on a side note: it...
Replies
2
Views
115
  • Question
In that case, files for each user are in your home/photo folder An admin can view the files of each user...
Replies
3
Views
421
Yes Indeed this has been an issue since the old photo station, there is even a thread about it on here...
Replies
1
Views
541
I struggled with larger video files (even if it's only 90 MB) that haven't backed up to my NAS via the...
Replies
0
Views
1,160
https://www.reddit.com/r/synology/comments/1b5mjm2/problem_adding_new_user_permissions_to_synology/
Replies
1
Views
941
  • Question
Having Problem with External User Access to Synology Photos: - I have set Shared Permission to...
Replies
0
Views
1,411
My Synology DS220+ contains a large number of photos, mainly .JPG format which I have tagged on my PC over...
Replies
0
Views
2,228

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top