Montag, 3. Februar 2014

Synology - Move packets from volume2 to volume1


I have a DS211j and currently two HDDs, both set to basic. Now I wanted to use two larger disks and use RAID1 for them. So from having two volumes (volume1 and volume2) I would only have one volume (volume1). One problem is that there are some packets and system services installed on volume2 (e.g. PostgreSQL, Mail Server etc.). These need to be moved to volume1 before I do the disk change. Unfortunately the DSM web page doesn't offer you any settings to move packets and system services from one volume to another. So I had to do it manually.

For PostgreSQL (which is used internally by the DSM for e.g. media indexing) the following was successful:


The information on which volume PostgreSQL resides seems to be in the symbolic link /var/services/pgsql. On my system it points to /volume2 ( /var/services/pgsql -> /volume2/@database/pgsql ). So all I had to do is to change that link.

Stop PostgreSQL:
/usr/syno/etc/rc.d/S20pgsql.sh stop

Copy all data from volume2 to volume1:
rsync -av /volume2/@database/pgsql /volume1/@database/

Disable the original link:
mv /var/services/pgsql /var/services/pgsql-vol2

Create the new link pointing to volume1:
ln -s /volume1/@database/pgsql /var/services/pgsql

Be sure that no one is using the data on volume2 any more (I had only pgsql inside /volume2/@database):
mv /volume2/@database /volume2/@database-deleteme

Restart PostgreSQL:
/usr/syno/etc/rc.d/S20pgsql.sh start


Still have some packets and system services on volume2. Need to look into each and find a way to move it to volume1.

For "printer/spool" (startup script: /usr/syno/etc/rc.d/S55cupsd.sh) the information which volume is used is retrieved as follows:
ds211j> /usr/syno/bin/servicetool --get-service-path printer
/volume2
ds211j>

But how gets the "servicetool" this information ??

Keine Kommentare:

Kommentar veröffentlichen