Move data dir on Ubuntu ?

Message boards : Questions and problems : Move data dir on Ubuntu ?
Message board moderation

To post messages, you must log in.

AuthorMessage
manu

Send message
Joined: 25 Nov 19
Posts: 1
France
Message 93898 - Posted: 25 Nov 2019, 7:50:15 UTC

Hi all, I've been searching for a solution, with no success so far.

On an Ubuntu 18.04 server with boinc-client 7.9.3+dfsg-5ubuntu2 installed, I do not want the boinc data dir to be on /var/lib/boinc-client but somewhere else, on another partition, say /home/boinc-client where there's far more free space.

There's no installation menu, like in Windows from what I could read, no easy way to specify where this expanding directory should be stored.

Changing the BOINC_DIR value in /etc/default/boinc-client is not enough, even with a symlink in /var/lib to the new location.

Changing the WorkingDirectory variable in /lib/systemd/system/boinc-client.service neither (yes, with systemctl daemon-reload...)

Replacing the home dir in /etc/passwd for boinc from /var/lib/boinc-client to /home/boinc-client ? Not working better...

Whatever I've been trying so far, I get this sort of logs in syslog:
Nov 23 11:46:54 sd-157532 systemd[1]: Started Berkeley Open Infrastructure Network Computing Client.
Nov 23 11:46:54 sd-157532 systemd[15221]: boinc-client.service: Changing to the requested working directory failed: No such file or directory
Nov 23 11:46:54 sd-157532 systemd[15221]: boinc-client.service: Failed at step CHDIR spawning /usr/bin/boinc: No such file or directory
Nov 23 11:46:54 sd-157532 systemd[1]: boinc-client.service: Main process exited, code=exited, status=200/CHDIR
Nov 23 11:46:54 sd-157532 systemd[15229]: boinc-client.service: Changing to the requested working directory failed: No such file or directory
Nov 23 11:46:54 sd-157532 systemd[15229]: boinc-client.service: Failed at step CHDIR spawning /bin/rm: No such file or directory
Nov 23 11:46:54 sd-157532 systemd[1]: boinc-client.service: Control process exited, code=exited status=200
Nov 23 11:46:54 sd-157532 systemd[1]: boinc-client.service: Failed with result 'exit-code'.

Has anyone ever been able to move this boinc-client directory somewhere else /var/lib on a Ubuntu's installation? And how?
Thanks for reading.
manu
ID: 93898 · Report as offensive
Profile Dave

Send message
Joined: 28 Jun 10
Posts: 877
United Kingdom
Message 93900 - Posted: 25 Nov 2019, 8:42:47 UTC - in response to Message 93898.  

The easiest way to do this is prior to installing BOINC set up a partition just for BOINC. So long as it is only not wanting it on the same partition as the OS giving it it's own partition and labelling it as /var/lib/boinc-client lets you put it on whichever disk you want without any of the security issues I have been told about (but not looked into so I don't know how valid they are) of using your home directory.
ID: 93900 · Report as offensive
floyd

Send message
Joined: 23 Apr 12
Posts: 58
Message 93901 - Posted: 25 Nov 2019, 9:23:11 UTC - in response to Message 93898.  

Disclaimer: I haven't done this myself and I'm writing this as a Debian user. Ubuntu is very similar I suppose.

On an Ubuntu 18.04 server with boinc-client 7.9.3+dfsg-5ubuntu2 installed, I do not want the boinc data dir to be on /var/lib/boinc-client but somewhere else, on another partition, say /home/boinc-client where there's far more free space.
Note /home/boinc-client.

Changing the BOINC_DIR value in /etc/default/boinc-client is not enough, even with a symlink in /var/lib to the new location.
/etc/default/boinc-client is only for the sysvinit startup script. Creating the symlink(s) is a good idea in case the path is hard-coded somewhere.

Changing the WorkingDirectory variable in /lib/systemd/system/boinc-client.service neither (yes, with systemctl daemon-reload...)
That looks like the way to go. Let's check the service file:

[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
Documentation=man:boinc(1)
After=network-online.target

[Service]
ProtectHome=true
Type=simple
Nice=10
User=boinc
WorkingDirectory=/var/lib/boinc
ExecStart=/usr/bin/boinc
ExecStop=/usr/bin/boinccmd --quit
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f lockfile
IOSchedulingClass=idle

[Install]
WantedBy=multi-user.target

And now man 5 systemd.exec:

[...]
       ProtectHome=
           Takes a boolean argument or the special values "read-only" or
           "tmpfs". If true, the directories /home, /root and /run/user are
           made inaccessible and empty for processes invoked by this unit.
[...]

Hm, have you tried any other place?
ID: 93901 · Report as offensive
Profile Keith Myers
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 17 Nov 16
Posts: 397
United States
Message 93917 - Posted: 27 Nov 2019, 1:44:12 UTC

I have moved my BOINC distro version on my Jetson Nano to /home for simplicity but it was a lot of work. If I could have used the much simpler TBar AIO BOINC installer I would have. But that is for x86 platform only.
Since you just have Ubuntu, I would highly recommend using the TBar AIO installer which is a pre-packaged version of BOINC 7.14.2 for Ubuntu 14.04 - 19.04. You just unpack it somewhere in your /home folder. No permissions issues since you own /home. It has the Nvidia special gpu app and the optimized apps for Seti with the Seti project already installed. But you can just use the BOINC part of it and delete the Seti directory if you don't run Seti. Then add whatever your projects are using the normal method via the Manager.
http://www.arkayn.us/lunatics/BOINC.7z
ID: 93917 · Report as offensive
Jeff

Send message
Joined: 14 Jan 20
Posts: 1
United States
Message 94987 - Posted: 14 Jan 2020, 15:20:06 UTC - in response to Message 93898.  
Last modified: 14 Jan 2020, 15:20:31 UTC

Right there with you Manu... seems like a rather obvious oversight to not be able to assign a data location of our own choosing. I've been working on this for a couple weeks now with no success.
ID: 94987 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 14156
Netherlands
Message 94988 - Posted: 14 Jan 2020, 15:28:02 UTC - in response to Message 94987.  

BOINC has the option to assign a data directory of your own choosing.
To do so, start the client with <code>boinc --dir path-to-home-directory</code>, e.g. boinc --dir ./home/boinc

I'm about sure this was an option in cc_config.xml as well, but I can't find it there any longer.

Of course make sure that there is a directory there where you point. Copy everything over from the original directory.
Please do not private message me for tech support, these will be ignored!
ID: 94988 · Report as offensive
Profile Dave

Send message
Joined: 28 Jun 10
Posts: 877
United Kingdom
Message 94993 - Posted: 14 Jan 2020, 15:50:55 UTC

Is there any reason you can't just make a partition /var/lib/boinc/ and then it will instal there? Assuming it works you can put the partition on any physical disk you like.
ID: 94993 · Report as offensive
Profile Joseph Stateson
Volunteer tester
Avatar

Send message
Joined: 27 Jun 08
Posts: 538
United States
Message 95168 - Posted: 15 Jan 2020, 23:28:57 UTC

You might want to add the "ReadWritePath" and also the "EnvironmentFile" as shown below. Change the paths "/var/lib/boinc" to what you want and move the filles there.
After editing "/lib/systemd/system/boinc-client.service" you will have to run "systemctl daemon-reload"
A discussion of systemctl is here
https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

if something goes wrong use this for debugging
journalctl -xe

I have not moved my files but I have used the environment file at "etc/default/boinc-client" to pass parameters to boinc.
Post if problems and also confirm if you got it working.

[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
Documentation=man:boinc(1)
After=network-online.target

[Service]
Type=simple
ProtectHome=true
PrivateTmp=true
ProtectSystem=strict
ProtectControlGroups=true
ReadWritePaths=-/var/lib/boinc -/etc/boinc-client
Nice=10
User=boinc
WorkingDirectory=/var/lib/boinc
ExecStart=/usr/bin/boinc 
EnvironmentFile=/etc/default/boinc-client
ExecStop=/usr/bin/boinccmd --quit
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f lockfile
IOSchedulingClass=idle

ID: 95168 · Report as offensive

Message boards : Questions and problems : Move data dir on Ubuntu ?

Copyright © 2020 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.