Failed to move data directory in Ubuntu

Message boards : Questions and problems : Failed to move data directory in Ubuntu
Message board moderation

To post messages, you must log in.

AuthorMessage
foobar123

Send message
Joined: 24 Jun 17
Posts: 1
United States
Message 79256 - Posted: 24 Jun 2017, 4:36:14 UTC

I am running Ubuntu 16.04 and I hope to move data directory from /var/lib/boinc-client, which is on my SSD, to somewhere on my HDD. I created a dir on HDD and copied everything from /var/lib/boinc-client. I then changed
BOINC_DIR=/var/lib/boinc-client
in both /etc/init.d/boinc-client and /etc/default/boinc-client. However, BOINC log still shows data directory is /var/lib/boinc-client. What am I missing? Is there something else that needs to be changed?
ID: 79256 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 801
Finland
Message 79302 - Posted: 25 Jun 2017, 20:49:23 UTC - in response to Message 79256.  

I'm not sure how things were in 16.04 but currently BOINC_DIR or the whole config file for that matter is not used. Instead of trying to tell BOINC to use some other data directory just make /var/lib/boinc-client a symlink to the real directory.

Remember that the HDD must be mounted at boot time before BOINC starts and you must have permissions set so that 'boinc' user can access the new location.
ID: 79302 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 79314 - Posted: 26 Jun 2017, 6:41:21 UTC

Ubuntu 16.04 is using systemd not initv so you might have more luck changing the directory in /lib/systemd/system/boinc-client.service. You need to reload the systemd config (systemctl daemon-reload) and restart boinc-client (systemctl restart boinc-client.service) after that. Be aware that any package update will overwrite your changes again. If you don't want this please open a bug report with Ubuntu so the package maintainer may make this configurable.

A symlink as Juha described is also possible but you then need to make sure all filesystems are mounted before systemd starts BOINC.
ID: 79314 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 801
Finland
Message 79382 - Posted: 28 Jun 2017, 20:34:45 UTC - in response to Message 79314.  

I think it would be necessary to make sure the filesystem is mounted in systemd service option as well. Looking at the systemd.unit manual page I think the correct option to use is RequiresMountsFor. Example 2 in the manual page also describes how to override unit files.

What I don't like about changing the directory via config file is that the change is not made everywhere. /var/lib/boinc-client will still be boinc user's home directory and at least NVIDIA's drivers like to write some cache data in users' home directories. The directory is also in Manager's .desktop file and changing the directory may complicate launching the Manager.
ID: 79382 · Report as offensive

Message boards : Questions and problems : Failed to move data directory in Ubuntu

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.