Accessing Photos and Pictures on Synology Diskstation NAS: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
No edit summary
Tag: wikieditor
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Synology]]
== Overview ==
== Overview ==


Line 9: Line 10:
Install '''Photo Station''' via the DSM Package Manager.
Install '''Photo Station''' via the DSM Package Manager.


Photo Station can only access files that are placed under the `/photos` directory. ''N.B. The `/photos` directory is on the same level as the `/shared` directory, not under it.''
Photo Station can only access files that are placed under the `/photo` shared directory. ''N.B. The full path of the `/photo` shared directory in a shell would be something like `/volume1/photo`, depending on the name of the volume where the `photo` directory is located.'


=== Accessing images outside the `/photos` directory ===
=== Making images outside the `/photo` directory available in Photo Station ===


The goal is to access images outside the `/photos` directory without having to resort to copying them into the `/photos` directory.
<div class="alert alert-warning">These methods worked on the DS213 but do not work on the DS916. While some internet discussions make it seem like the current DSM would still allow mounted folders to show up in the Photo Station app, the latest experience was that empty directories would appear as albums in Photo Station, but if anything was mounted onto the directories, they would disappear from Photo Station. I could not find any documentation specific to DS916. In the end, I copied the files that I wanted to appear in Photo Station to the `/photo` directory.</div>


# Create a symbolic link in the `/photos` directory that links to the other directory.
The goal is to have images outside the `/photo` directory appear in the Photo Station and DS Photo apps without having to resort to copying them into the `/photo` directory.
## Enable SSH connections to the NAS.
 
### DSM > Control Panel > Terminal & SNMP > Terminal tab > Enable SSH Service
==== Mounting external directories ====
### Now it's possible to SSH to the DiskStation's IP using login credentials of one of DSM user accounts.
 
### `cd /volume1/photos`
<div class="alert alert-warning">The method of mounting external directories has '''NOT''' yet been confirmed to work.</div>
### `ln -s /volume1/shared/some_other_directory link_alias`
 
# Re-index the media files.
Add directories outside of the `/photo` directory by mounting them in that directory. <ref>[https://forum.synology.com/enu/viewtopic.php?f=17&t=61818&sid=37cc48cfeebc9f004c96129c05d934d8&start=15 Point Photo Station to an alternate directory?], Synology Forums</ref>
## DSM > Control Panel > Media Library > Media Library tab > Re-Index button
 
===== Create a new album in Photo Station =====
 
* '''Photo Station''' > '''Albums''' > '''Add''' > '''New Album'''
** Create a new album to serve as the mount point for the external directories.
*** '''Name:''' ''anything that makes sense as a mount point, e.g. same name as the external directory''
*** '''Permission Type:''' private album
*** '''Assign Privileges''' button > ''give permission to the album as needed''
** Wait for the DSM to finish re-indexing the media index.
*** '''DSM''' > '''Control Panel''' > '''Indexing Service''' > '''Media Indexing''' > '''Status:''' `completed`
 
===== Mount the external folders =====
 
* SSH in as `admin`
** <strike>Create mount point within `/photos`, e.g. `mkdir /volume1/photo/my\ photos`</strike>
** Mount the directory outside `/photos`, e.g. `mount --bind /path/to/my\ photos /volume1/photo/my\ photos`
* Re-index the media files.
** '''DSM''' > '''Control panel''' > '''System''' > '''Indexing Service''' > '''Media Indexing''' tab > '''Re-Index''' button
** ''(Optional, perhaps unnecessary)'' '''DSM''' > '''Control panel''' > '''System''' > '''Indexing Service''' > '''File Indexing''' tab > '''Indexed Folder List''' button > select the folder(s) to index and click the '''Re-Index''' button
* Wait for the re-indexing to complete.
 
===== Create scripts to manage mounted directories =====
 
* Add a script to re-mount the directories after reboot. <ref>[https://forum.synology.com/enu/viewtopic.php?t=116174 rc.local auto mount not works [after DSM 6 update], Synology forums</ref>
** Create the script to run.
*** Store the script somewhere accessible to Task Scheduler, e.g. `\volume1\public\tasks`
*** See sample below.
** '''DSM''' > '''Control Panel''' > '''System''' > '''Task Scheduler''' > '''Create''' button > '''Triggered Task'''
*** Give it a name
*** '''User:''' root
*** '''Event:''' boot-up
*** '''Task Settings''' tab > '''User-defined script:''' ''Enter the path to the script defined above''
* (Optional) add script to unmount the external directories on a Shutdown event.
** e.g. `unmount /volume1/photo/my\ photos`
 
The above steps have been verified up to the point of mounting the external folders and re-indexing. It has not been verified that image files in the external folders appear in Photo Station.
 
If all the albums appear, the next step would be mounting the remote folders again to see if then DSM would successfully index the images in the external folders.
 
<syntaxhighlight lang="bash">
#!/bin/sh
mount --bind /volume1/my\ photos /volume1/photo/my\ photos
</syntaxhighlight>
 
==== Using symbolic links ====
 
<div class="alert alert-warning">The documentation on this page originally only referenced using symbolic links (as opposed to mounting the external folders). However, almost all discussions online dismiss this method. It also was not working as documented on a newer NAS.</div>
 
Create a symbolic link in the `/photos` directory that links to the other directory.
 
* Enable SSH connections to the NAS.
** DSM > Control Panel > Terminal & SNMP > Terminal tab > Enable SSH Service
** Now it's possible to SSH (as admin) to the DiskStation's IP using login credentials of one of DSM user accounts.
** `cd /volume1/photos`
** `ln -s /volume1/shared/some_other_directory link_alias` - make sure these symbolic links are owned by `admin`
* Re-index the media files.
** <strike>DSM > Control Panel > Media Library > Media Library tab > Re-Index button</strike><br />'''DSM''' > '''Control Panel''' > '''System''' group > '''Indexing Service''' > '''Media Indexing''' tab > '''Media Indexing''' group > '''Re-Index''' button


=== iPad ===
=== iPad ===
Line 29: Line 86:
# Configure settings to connect to the DiskStation (IP/address, user, password)
# Configure settings to connect to the DiskStation (IP/address, user, password)
# Once logged in, everything under `/photos` on the DiskStation should be accessible.
# Once logged in, everything under `/photos` on the DiskStation should be accessible.
== Verifying media indexing ==
`ssh` to the NAS.
<syntaxhighlight lang="sh">
$ sudo psql mediaserver postgres
</syntaxhighlight>
To view the number of image files that have been indexed:
<syntaxhighlight lang="postgres">
mediaserver=# select count(*) from photo;
</syntaxhighlight>
If the DSM is currently updating the index, running this command multiple times may show the number of indexed files increasing.
Also, after re-indexing the DSM will index the 3 types of media one after the other, e.g. video, music, and photo. If video and music are indexed first, the count for photos will remain at 0 until all the files of those types have been indexed.
To view stats about specific files that have been indexed:
<syntaxhighlight lang="postgres">
mediaserver=# select * from photo where path like '/[VOLUME_NAME]/photo/path/to/subdirectory%' order by id desc limit 10;
</syntaxhighlight>
== Notes ==
<references />


== Keywords ==
== Keywords ==


photos, photographs, picture reference, images, pictures, cloud, synology, diskstation, NAS, DSM, Photo Station, iPad
photos, photographs, picture reference, images, pictures, cloud, synology, diskstation, NAS, DSM, Photo Station, iPad
[[Category:NAS]]

Latest revision as of 14:04, 24 September 2022

Overview[edit]

Information and configuration about accessing and viewing image files on Synology DiskStation NAS.

Configuration[edit]

Photo Station[edit]

Install Photo Station via the DSM Package Manager.

Photo Station can only access files that are placed under the /photo shared directory. N.B. The full path of the /photo shared directory in a shell would be something like /volume1/photo, depending on the name of the volume where the photo directory is located.'

Making images outside the /photo directory available in Photo Station[edit]

These methods worked on the DS213 but do not work on the DS916. While some internet discussions make it seem like the current DSM would still allow mounted folders to show up in the Photo Station app, the latest experience was that empty directories would appear as albums in Photo Station, but if anything was mounted onto the directories, they would disappear from Photo Station. I could not find any documentation specific to DS916. In the end, I copied the files that I wanted to appear in Photo Station to the /photo directory.

The goal is to have images outside the /photo directory appear in the Photo Station and DS Photo apps without having to resort to copying them into the /photo directory.

Mounting external directories[edit]

The method of mounting external directories has NOT yet been confirmed to work.

Add directories outside of the /photo directory by mounting them in that directory. [1]

Create a new album in Photo Station[edit]
  • Photo Station > Albums > Add > New Album
    • Create a new album to serve as the mount point for the external directories.
      • Name: anything that makes sense as a mount point, e.g. same name as the external directory
      • Permission Type: private album
      • Assign Privileges button > give permission to the album as needed
    • Wait for the DSM to finish re-indexing the media index.
      • DSM > Control Panel > Indexing Service > Media Indexing > Status: completed
Mount the external folders[edit]
  • SSH in as admin
    • Create mount point within /photos, e.g. mkdir /volume1/photo/my\ photos
    • Mount the directory outside /photos, e.g. mount --bind /path/to/my\ photos /volume1/photo/my\ photos
  • Re-index the media files.
    • DSM > Control panel > System > Indexing Service > Media Indexing tab > Re-Index button
    • (Optional, perhaps unnecessary) DSM > Control panel > System > Indexing Service > File Indexing tab > Indexed Folder List button > select the folder(s) to index and click the Re-Index button
  • Wait for the re-indexing to complete.
Create scripts to manage mounted directories[edit]
  • Add a script to re-mount the directories after reboot. [2]
    • Create the script to run.
      • Store the script somewhere accessible to Task Scheduler, e.g. \volume1\public\tasks
      • See sample below.
    • DSM > Control Panel > System > Task Scheduler > Create button > Triggered Task
      • Give it a name
      • User: root
      • Event: boot-up
      • Task Settings tab > User-defined script: Enter the path to the script defined above
  • (Optional) add script to unmount the external directories on a Shutdown event.
    • e.g. unmount /volume1/photo/my\ photos

The above steps have been verified up to the point of mounting the external folders and re-indexing. It has not been verified that image files in the external folders appear in Photo Station.

If all the albums appear, the next step would be mounting the remote folders again to see if then DSM would successfully index the images in the external folders.

#!/bin/sh
mount --bind /volume1/my\ photos /volume1/photo/my\ photos

Using symbolic links[edit]

The documentation on this page originally only referenced using symbolic links (as opposed to mounting the external folders). However, almost all discussions online dismiss this method. It also was not working as documented on a newer NAS.

Create a symbolic link in the /photos directory that links to the other directory.

  • Enable SSH connections to the NAS.
    • DSM > Control Panel > Terminal & SNMP > Terminal tab > Enable SSH Service
    • Now it's possible to SSH (as admin) to the DiskStation's IP using login credentials of one of DSM user accounts.
    • cd /volume1/photos
    • ln -s /volume1/shared/some_other_directory link_alias - make sure these symbolic links are owned by admin
  • Re-index the media files.
    • DSM > Control Panel > Media Library > Media Library tab > Re-Index button
      DSM > Control Panel > System group > Indexing Service > Media Indexing tab > Media Indexing group > Re-Index button

iPad[edit]

  1. Install the DS Photo+ app.
  2. Configure settings to connect to the DiskStation (IP/address, user, password)
  3. Once logged in, everything under /photos on the DiskStation should be accessible.

Verifying media indexing[edit]

ssh to the NAS.

$ sudo psql mediaserver postgres

To view the number of image files that have been indexed:

mediaserver=# select count(*) from photo;

If the DSM is currently updating the index, running this command multiple times may show the number of indexed files increasing.

Also, after re-indexing the DSM will index the 3 types of media one after the other, e.g. video, music, and photo. If video and music are indexed first, the count for photos will remain at 0 until all the files of those types have been indexed.

To view stats about specific files that have been indexed:

mediaserver=# select * from photo where path like '/[VOLUME_NAME]/photo/path/to/subdirectory%' order by id desc limit 10;

Notes[edit]

Keywords[edit]

photos, photographs, picture reference, images, pictures, cloud, synology, diskstation, NAS, DSM, Photo Station, iPad