What is the right way to move transmission settings folder?

62 views
Skip to first unread message

Prototype

unread,
Nov 15, 2016, 4:18:41 PM11/15/16
to al...@googlegroups.com
Hi, what is the right way to move whole /var/lib/transmission folder to different location? Especially to where "Transmission folder" in alt-F web interface is pointing.  IMHO this is a good practise to keep this folder together with data (finished/inprogress files). So if one will clear alt-F settings or reinstall or even change hdd, just point to this place and one will have all old settings of transmission, and all finished/inprogress torrents up and running. 

João Cardoso

unread,
Nov 17, 2016, 1:35:47 PM11/17/16
to Alt-F


On Tuesday, 15 November 2016 21:18:41 UTC, Prototype wrote:
Hi, what is the right way to move whole /var/lib/transmission folder to different location?

-Transmissions runs under the 'transmission' user, and The 'transmission' user home folder is created at /var/lib/transmission, so that needs to be changed.
-The Transmission init script, /etc/init.d/S81transmission, contains the same path hard coded, so that needs to be changed also.
-the /etc/transmission/transmission.conf configuration file contains also the above path, so it needs to be changed also.
-the /etc/samba/smb.conf file constains a share definition with that path also
-what else?

Instead of changing all the above, perhaps moving just the folder to a new path and creating a symbolic link to it will work? Don't know

# tentative, untested
rctransmission stop
mv
/var/lib/transmission /var/lib/transmission-safe # if it works, can be removed, otherwise renamed to the original name
cp
-a /var/lib/transmission-safe/ /mnt/xxx/whatever
ln
-sf /mnt/xxx/whatever /var/lib/transmission
rctransmission start

Prototype

unread,
Nov 18, 2016, 1:27:35 AM11/18/16
to Alt-F
Actually I'v done it already, it is enough to change path only in startup script, so
aufs.sh -n
cp -/etc/init.d/S81transmission /Alt-F/etc/init.d/S81transmission
aufs.sh -r

edited path in S81transmission

mv /var/lib/transmission /mnt/sda2/torrent/.settings/

But your solution looks smarter will try it. Thank you

четверг, 17 ноября 2016 г., 21:35:47 UTC+3 пользователь João Cardoso написал:

João Cardoso

unread,
Nov 18, 2016, 10:06:42 AM11/18/16
to Alt-F


On Friday, 18 November 2016 06:27:35 UTC, Prototype wrote:
Actually I'v done it already, it is enough to change path only in startup script, so
aufs.sh -n
cp -/etc/init.d/S81transmission /Alt-F/etc/init.d/S81transmission
aufs.sh -r


Actually you don't need that aufs.sh stuff, just edit /etc/init.d/S81transmission, changes will automatically appear at /Alt-F/etc...

As a rule of thumb: use the system normally as if the Alt-F folder did not exists. Changes made on the "normal" tree will be reflected in the Alt-F folder at the proper location.
New files created on the "normal" tree will appear in the Alt-F folder also, as long as the new file parent folder already exists under Alt-F:

[root@DNS-327L]# ls /Alt-F/etc/foobar
ls: /Alt-F/etc/foobar: No such file or directory
 
[root@DNS-327L]# touch /etc/foobar
 
[root@DNS-327L]# ls /Alt-F/etc/foobar 
/Alt-F/etc/foobar
 
[root@DNS-327L]# rm /etc/foobar 
 
[root@DNS-327L]# ls /Alt-F/etc/foobar
ls: /Alt-F/etc/foobar: No such file or directory

Thus, expect in rare cases, you don't/shouldn't need to manipulate anything under the Alt-F folder; only on these corner cases you need to use aufs.sh to inform aufs that its tree is going to be be directly manipulated.

There is a trick to hide the whole Alt-F tree from the users filesystem point of view, but I don't like to hide anything.

Prototype

unread,
Nov 18, 2016, 12:16:53 PM11/18/16
to Alt-F
Thank you for explanation.
I throught I need aufs.sh all the time I create something related to Alt-F folder as you wrote here https://groups.google.com/forum/#!msg/alt-f/Uo86JWogR2k/LGrzOeX6CAAJ
So if i create /etc/some/thing will it reflrct to Alt-F?

пятница, 18 ноября 2016 г., 18:06:42 UTC+3 пользователь João Cardoso написал:

João Cardoso

unread,
Nov 18, 2016, 12:58:27 PM11/18/16
to Alt-F


On Friday, 18 November 2016 17:16:53 UTC, Prototype wrote:
Thank you for explanation.

Ah, now you can start writing the docs :-)
 
I throught I need aufs.sh all the time I create something related to Alt-F folder as you wrote here https://groups.google.com/forum/#!msg/alt-f/Uo86JWogR2k/LGrzOeX6CAAJ

Yes, but in that example, as no packages with initscripts were yet installed, one didn't know if /Alt-F/etc/init.d/ or even /Alt-F/etc/ exists, so I took the direct approach. Generally that is not needed, try first the normal course of action and if it does not reflects under Alt-F use the lengthy approach. Once it works the first time it is not needed a second time.
 
So if i create /etc/some/thing will it reflrct to Alt-F?

Yes, as my command line example in the previous post shows. But only if the parent dir exists. In your example, /etc/some/thing, as folder '/etc/some' does not exists, you have to create if first, 'mkdir /etc/some', and as '/Alt-F/etc' exists, the 'some' folder will be created under it; then as as you create file 'thing', it will also also appear under /Alt-F/etc/some.

All the above is only possible after the Alt-F folder is first discovered in the base of a filesystem. You can check that by using 'aufs.sh -l', which should display all the aufs layers, top priority on top, being it /mnt/whatever/Alt-F.

But (there are many buts and ifs in this matter), when the Alt-F folder is discovered and put on top of the aufs layer, the current box settings loaded from flash memory (and only those) will be copied to the Alt-F folder, overwriting the ones existing there. And the reverse occurs at power-down or when the Alt-F folder filesystem is unmounted ('aufs.sh -u' does that *if* possible). 
This is needed to maintain settings consistency -- the box "identity" is stored on flash memory and not on disk, as disks are (was, in the previous box hardware design) easily swappable.
Reply all
Reply to author
Forward
0 new messages