1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Storage Help with Synology CloudStation

Discussion in 'Tech Support' started by Sentinel-R1, 9 Mar 2017.

  1. Sentinel-R1

    Sentinel-R1 Chaircrew

    Joined:
    13 Oct 2010
    Posts:
    2,395
    Likes Received:
    409
    Whilst pretty straight forward to set up and get working, I'm having a bit of difficulty getting CloudStation Drive to put the files exactly where I want them on the NAS. Essentially, what I want to achieve is multiple folder syncs between the NAS and my Media HDD on the PC. Videos on the HDD to the Video folder on the NAS, Photos to the photo folder and so on, so I can use DS Video, Photo and Music over the www.

    CloudStation Drive does do folder syncs but instead of putting them into NAS/Video or NAS/Photo, it's putting everything into NAS/User/<username>/CloudStation/<synced folder name>

    I can do a manual move from the CloudStation folder sync once on the NAS, but the issue then is it will re-sync the missing files and replicate the data that's just been moved.

    Any help appreciated. The Synology KB doesn't seem to have any guidance with this.
     
  2. Sentinel-R1

    Sentinel-R1 Chaircrew

    Joined:
    13 Oct 2010
    Posts:
    2,395
    Likes Received:
    409
    There must be some Synology power users in here??
     
  3. faugusztin

    faugusztin I *am* the guy with two left hands

    Joined:
    11 Aug 2008
    Posts:
    6,953
    Likes Received:
    270
    It is not meant for that kind of synchronization, but you could "hack it" by using symbolic links. Not exactly what you want, but close enough. You can that way link specific subfolders of one share into a subfolder of a target share. Please read through first to decide if it is what you want or not.

    Howto (if you don't know how to make symbolic links in Linux) :
    1. For this whole thing to work, we need to enable few things in configuration. First you need to go to Control Panel>File services and click on Advanced Settings in SMB section :
      [​IMG]
      There you need to enable the two options called "Allow symbolic links". The second one will show a warning, you need to accept it :
      [​IMG]
      You also need to enable SSH service, so we can execute the required commands :
      [​IMG]
    2. Then figure out our paths. My example is going to be that you want to put contents of Users>sentinel>CloudStation>Photos folder in a Photos share. So you will have this as your source folder :
      [​IMG]
      And this is your folder where you want to have your pictures :
      [​IMG]
    3. download an SSH client (Putty is a good start : http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html )
    4. start your ssh client and enter the host name of your Synology NAS, leave port at 22
    5. you should be able to log in with any user name and password of an Synology user belonging to administrators group.
    6. then type his command to gain superuser shell (it will ask you for your user password again) :
      Code:
      sudo -s
    7. The shell should display this now, keep the SSH client open after this :
      Code:
      sh-4.3#
    8. now we need to figure out where your disk volume is, so type this command and press enter :
      Code:
      mount | grep volume
      It should output something like :
      Code:
      /dev/mapper/vg1000-lv on /volume1 type ext4 (rw,relatime,journal_checksum,synoacl,data=writeback,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group)
      What interests us is the " on /volume1" value. That means our disk volume is /volume1 folder on disk.
    9. now let's change to that directory :
      Code:
      cd /volume1
    10. now let's see what is in that folder. Type :
      Code:
      ls -al
      It will output something like :
      Code:
      ls -al
      total 127880
      drwxr-xr-x  22 root            root                 4096 Mar 22 13:06 .
      drwxr-xr-x  21 root            root                 4096 Mar 15 12:19 ..
      drwxrwxrwx  18 root            root                 4096 Mar  5 10:46 @appstore
      -rw-------   1 root            root                14336 Mar 15 12:17 aquota.group
      -rw-------   1 root            root                16384 Mar 15 12:17 aquota.user
      drwx------   2 root            root                 4096 Feb 23 06:34 @autoupdate
      d---------+  4 root            root                 4096 Mar 18 19:45 Cloud
      drwxr-xr-x   5 root            root                 4096 Nov 23 08:35 @cloudstation
      drwxr-xr-x   6 root            root                 4096 Nov 14 16:05 @cloudsync
      d---------+  5 root            root                 4096 Mar 18 19:45 Data
      drwxr-xr-x   7 admin           users                4096 Feb 23 06:40 @database
      drwxr-xr-x   3 DownloadStation DownloadStation      4096 Nov 14 15:51 @download
      drw-rw----+ 19 root            users                4096 Mar 22 12:47 Downloads
      drwxrwxrwx+ 11 root            root                 4096 Mar 22 13:06 @eaDir
      drwx--x--x+  6 root            root                 4096 Dec  7 14:13 homes
      drwx------   2 root            root                 4096 Feb 23 06:40 @iSCSI
      drwx------   2 root            root                16384 Nov 14 15:36 lost+found
      d---------+  3 root            root                 4096 Nov 15 13:21 NetBackup
      d---------+  4 root            root                 4096 Mar 22 13:06 Photos
      drwxr-xr-x   2 root            root                 4096 Nov 14 15:36 @S2S
      -rw-------   1 root            root            294506496 Dec 20 08:31 @syno-cloud-sync.core
      -rw-------   1 root            root             12337152 Jan  3 02:16 @synopkg.core
      -rw-------   1 root            root                 5120 Dec  7 14:13 synoquota.db
      -rw-------   1 root            root              2289664 Nov 14 17:26 @syslog-ng.core
      d---------+  4 root            root                 4096 Mar 17 19:15 Time Machine
      drwxrwxrwt   7 root            root                 4096 Mar 22 12:49 @tmp
      d---------+  5 root            root                 4096 Mar 22 13:02 Users
      d---------+  4 root            root                 4096 Nov 15 03:20 web
      You notice it matches what you see in File Station, plus some few folders which are not interesting for us right now.
    11. You could dig further in those folders, but they have identical structure to what you see in file station. You only need to replace > characters you see in File station for / characters in Linux.
    12. Now what this all leads to is that you can use a command called ln, which allows you to create symbolic links on a file system. Symbolic link is a "placeholder" in one folder, which points to another folder. That way we can tell the filesystem that we want a folder called sentinel in folder Photos, which should point to Users/sentinel/CloudStation/Photos. How do we that ? Simple :
      Code:
      ln -s /volume1/Users/sentinel/CloudStation/Photos /volume1/Photos/sentinel
      What does that mean ? "ln -s" says "create a symbolic link". First parameter is "where should the link point to" (our source folder) and the second parameter is "where should i create this link and what should it be called" (our target, that is sentinel folder inside Photos folder).
    13. Sadly file station won't show symbolic links, but when you go to the share through Explorer on Windows, you will see the linked folders. So let's take a look :
      • Source folder :
        [​IMG]
      • Photos share, showing our folder for Photos from sentinel (the symbolic link we created) :
        [​IMG]
      • Contents of Photos/sentinel folder (which is actually the content of Users/sentinel/CloudStation/Photos)
        [​IMG]
      • What happens when we create a file in source folder :
        [​IMG]
        Obviously it immediately shows up in our symbolic link folder :
        [​IMG]

    Obviously it has limitations - you cannot put contents of multiple folders as one folder name, so you have to create a symbolic link per each source folder, which will show up as a subfolder in Explorer). But it is the closest thing you can do with tools given.

    Hope it is useful.
     
  4. Sentinel-R1

    Sentinel-R1 Chaircrew

    Joined:
    13 Oct 2010
    Posts:
    2,395
    Likes Received:
    409
    Thanks for the comprehensive reply! I'll look at this in great detail tonight and let you know how I get on.

    Much appreciated!
     

Share This Page