Changing BOINC Data Directory on Fedora Linux 32

Message boards : Questions and problems : Changing BOINC Data Directory on Fedora Linux 32
Message board moderation

To post messages, you must log in.

AuthorMessage
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101046 - Posted: 10 Oct 2020, 19:00:28 UTC

I want to move my BOINC data directory from where it was installed on Fedora 32 (through the repos) to an NTFS volume on a hard drive I have. I found this post by BobCat13 describing the process how to move the data directory on Linux.

However, there are a couple problems with this:
1. /var/lib/boinc-client/ does not exist for me. However, /var/lib/boinc/ does. Checking the event log: Fri 09 Oct 2020 11:40:43 PM CDT | | Data directory: /var/lib/boinc. So, I assume I must substitute the directory I have with the one being referenced in the post.

2. The /etc/default/boinc-client file does not exist. There is no file name that is obviously related to BOINC in /etc/default/.

I would greatly appreciate any help with moving my data directory. Hopefully this thread will help other Fedora users in the future as well.

Requested Information:
BOINC Version: 7.16.6
Project used: Rosetta@Home

Log:
Fri 09 Oct 2020 11:40:43 PM CDT |  | cc_config.xml not found - using defaults
Fri 09 Oct 2020 11:40:43 PM CDT |  | Starting BOINC client version 7.16.6 for x86_64-pc-linux-gnu
Fri 09 Oct 2020 11:40:43 PM CDT |  | Libraries: libcurl/7.69.1 OpenSSL/1.1.1g-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh/0.9.5/openssl/zlib nghttp2/1.41.0
Fri 09 Oct 2020 11:40:43 PM CDT |  | Data directory: /var/lib/boinc
Fri 09 Oct 2020 11:40:44 PM CDT |  | CUDA: NVIDIA GPU 0: GeForce GTX 760 (driver version 450.66, CUDA version 11.0, compute capability 3.0, 1992MB, 1950MB available, 2379 GFLOPS peak)
Fri 09 Oct 2020 11:40:44 PM CDT |  | OpenCL: NVIDIA GPU 0: GeForce GTX 760 (driver version 450.66, device version OpenCL 1.2 CUDA, 1992MB, 1950MB available, 2379 GFLOPS peak)
Fri 09 Oct 2020 11:40:44 PM CDT |  | libc: GNU libc version 2.31
Fri 09 Oct 2020 11:40:44 PM CDT |  | Host name: ben-fedora
Fri 09 Oct 2020 11:40:44 PM CDT |  | Processor: 4 GenuineIntel Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz [Family 6 Model 60 Stepping 3]
Fri 09 Oct 2020 11:40:44 PM CDT |  | Processor features: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
Fri 09 Oct 2020 11:40:44 PM CDT |  | OS: Linux Fedora: Fedora 32 (Workstation Edition) [5.8.13-200.fc32.x86_64|libc 2.31 (GNU libc)]
Fri 09 Oct 2020 11:40:44 PM CDT |  | Memory: 7.69 GB physical, 12.00 GB virtual
Fri 09 Oct 2020 11:40:44 PM CDT |  | Disk: 19.56 GB total, 7.85 GB free
Fri 09 Oct 2020 11:40:44 PM CDT |  | Local time is UTC -5 hours
Fri 09 Oct 2020 11:40:44 PM CDT |  | No general preferences found - using defaults
Fri 09 Oct 2020 11:40:44 PM CDT |  | Preferences:
Fri 09 Oct 2020 11:40:44 PM CDT |  | max memory usage when active: 3936.79 MB
Fri 09 Oct 2020 11:40:44 PM CDT |  | max memory usage when idle: 7086.21 MB
Fri 09 Oct 2020 11:40:44 PM CDT |  | max disk usage: 9.40 GB
Fri 09 Oct 2020 11:40:44 PM CDT |  | don't use GPU while active
Fri 09 Oct 2020 11:40:44 PM CDT |  | suspend work if non-BOINC CPU load exceeds 25%
Fri 09 Oct 2020 11:40:44 PM CDT |  | (to change preferences, visit a project web site or select Preferences in the Manager)
Fri 09 Oct 2020 11:40:44 PM CDT |  | Setting up project and slot directories
Fri 09 Oct 2020 11:40:44 PM CDT |  | Checking active tasks
Fri 09 Oct 2020 11:40:44 PM CDT | Rosetta@home | URL https://boinc.bakerlab.org/rosetta/; Computer ID 5620875; resource share 100
Fri 09 Oct 2020 11:40:44 PM CDT |  | Setting up GUI RPC socket
Fri 09 Oct 2020 11:40:44 PM CDT |  | Checking presence of 4 project files
Sat 10 Oct 2020 01:26:41 PM CDT |  | Re-reading cc_config.xml
Sat 10 Oct 2020 01:26:41 PM CDT |  | cc_config.xml not found - using defaults
Sat 10 Oct 2020 01:26:41 PM CDT |  | log flags: file_xfer, sched_ops, task
Sat 10 Oct 2020 01:26:56 PM CDT |  | No general preferences found - using defaults
Sat 10 Oct 2020 01:26:56 PM CDT |  | Preferences:
Sat 10 Oct 2020 01:26:56 PM CDT |  | max memory usage when active: 3936.79 MB
Sat 10 Oct 2020 01:26:56 PM CDT |  | max memory usage when idle: 7086.21 MB
Sat 10 Oct 2020 01:26:56 PM CDT |  | max disk usage: 8.99 GB
Sat 10 Oct 2020 01:26:56 PM CDT |  | don't use GPU while active
Sat 10 Oct 2020 01:26:56 PM CDT |  | suspend work if non-BOINC CPU load exceeds 25%
Sat 10 Oct 2020 01:26:56 PM CDT |  | (to change preferences, visit a project web site or select Preferences in the Manager)
Sat 10 Oct 2020 01:32:27 PM CDT |  | Suspending computation - CPU is busy
Sat 10 Oct 2020 01:32:37 PM CDT |  | Resuming computation
Sat 10 Oct 2020 01:34:07 PM CDT |  | Suspending computation - CPU is busy
Sat 10 Oct 2020 01:34:17 PM CDT |  | Resuming computation
Sat 10 Oct 2020 01:36:47 PM CDT |  | Suspending computation - CPU is busy
Sat 10 Oct 2020 01:37:07 PM CDT |  | Resuming computation
Sat 10 Oct 2020 01:37:17 PM CDT |  | Suspending computation - CPU is busy
Sat 10 Oct 2020 01:37:27 PM CDT |  | Resuming computation
ID: 101046 · Report as offensive
floyd
Help desk expert

Send message
Joined: 23 Apr 12
Posts: 75
Message 101053 - Posted: 11 Oct 2020, 9:05:53 UTC - in response to Message 101046.  

I want to move my BOINC data directory from where it was installed on Fedora 32 (through the repos) to an NTFS volume on a hard drive I have.
I'm not sure if it will work without issues on NTFS. Some other place could be easier.

I found this post by BobCat13 describing the process how to move the data directory on Linux.
That is outdated. For a start please show the output of
systemctl cat boinc-client.service
ID: 101053 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101056 - Posted: 11 Oct 2020, 16:59:01 UTC - in response to Message 101053.  

Okay, I can always make an ext4 volume on my hard drive and shrink the NTFS volume a bit if there's issues.

Here is the output of
systemctl cat boinc-client.service

# /usr/lib/systemd/system/boinc-client.service
[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
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
# The following options prevent setuid root as they imply NoNewPrivileges=true
# Since Atlas requires setuid root, they break Atlas
# In order to improve security, if you're not using Atlas,
# Add these options to the [Service] section of an override file using
# sudo systemctl edit boinc-client.service
#NoNewPrivileges=true
#ProtectKernelModules=true
#ProtectKernelTunables=true
#RestrictRealtime=true
#RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
#RestrictNamespaces=true
#PrivateUsers=true
#CapabilityBoundingSet=
#MemoryDenyWriteExecute=true

[Install]
WantedBy=multi-user.target
ID: 101056 · Report as offensive
Profile Keith Myers
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 17 Nov 16
Posts: 573
United States
Message 101058 - Posted: 11 Oct 2020, 18:11:39 UTC

Use BobCat's recipe but modify where the BOINC data directory is located. Your cat output shows all the necessary places BOINC is located. In your case /var/lib/boinc.
ID: 101058 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101059 - Posted: 11 Oct 2020, 18:35:01 UTC - in response to Message 101058.  

Use BobCat's recipe but modify where the BOINC data directory is located. Your cat output shows all the necessary places BOINC is located. In your case /var/lib/boinc.

I can't do step #4 though because there is no file named "boinc-client" to edit.
4. Edit the /etc/default/boinc-client file to point to the new data directory = sudo gedit /etc/default/boinc-client and look for the entry that starts with # This is the data directory of the BOINC core client. Add an # in front of the BOINC_DIR="/var/lib/boinc-client" line and then add the following below that line BOINC_DIR="/home/martianstorm/boinc_data" and save the file then exit the text editor.


Am I supposed to edit the boinc-client.service file using the following?
sudo systemctl edit boinc-client.service
If so, which variables must I change?
ID: 101059 · Report as offensive
floyd
Help desk expert

Send message
Joined: 23 Apr 12
Posts: 75
Message 101061 - Posted: 11 Oct 2020, 18:50:23 UTC - in response to Message 101059.  
Last modified: 11 Oct 2020, 18:53:44 UTC

I think it should work like this:

1. (Optional) Suspend BOINC's network activity. Just a precaution so if anything goes wrong the effect is limited to your local machine and you can try again.

2. Stop BOINC.
sudo systemctl stop boinc-client.service

3. Copy the data directory /var/lib/boinc to the new position. Make sure to preserve ownerships, permissions and links. I can't tell you how to do this on NTFS.

4. Create an override file
sudo systemctl edit boinc-client.service
with this content
[Service]
ReadWritePaths=-/my/boinc/dir
WorkingDirectory=/my/boinc/dir
ExecStart=
ExecStart=/usr/bin/boinc --dir /my/boinc/dir

5. Reload the configuration.
sudo systemctl daemon-reload

6. Restart BOINC
sudo systemctl start boinc-client.service

7. After you have verified that all works well resume network activity.
ID: 101061 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101081 - Posted: 12 Oct 2020, 17:35:17 UTC - in response to Message 101061.  

I will try this soon. I decided I'm going to shrink my NTFS volume on my hard drive to make room for a file system that's better supported on Linux. Unfortunately, this means a reformat because there are files at the end of the partition preventing it from being shrinked, so I have to take care of that. I will post an update soon.
ID: 101081 · Report as offensive
robsmith
Volunteer tester
Help desk expert

Send message
Joined: 25 May 09
Posts: 964
United Kingdom
Message 101082 - Posted: 12 Oct 2020, 17:40:57 UTC

Don't forget that many modern Linux actually support and will mount NTFS filling systems.
ID: 101082 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101149 - Posted: 18 Oct 2020, 21:02:19 UTC - in response to Message 101061.  
Last modified: 18 Oct 2020, 21:05:49 UTC

Floyd, I followed your instructions (with an ext4 partition instead of ntfs) and I was able to move the files and preserve ownership, permissions, and links. However, boinc-client.service now fails:
● boinc-client.service - Berkeley Open Infrastructure Network Computing Client
     Loaded: loaded (/usr/lib/systemd/system/boinc-client.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/boinc-client.service.d
             └─override.conf
     Active: failed (Result: exit-code) since Sun 2020-10-18 15:49:37 CDT; 1min 49s ago
       Docs: man:boinc(1)
    Process: 4267 ExecStart=/usr/bin/boinc --dir /mnt/linux-files/boinc-data (code=exited, status=108)
    Process: 4312 ExecStopPost=/bin/rm -f lockfile (code=exited, status=0/SUCCESS)
   Main PID: 4267 (code=exited, status=108)
        CPU: 25ms


Oct 18 15:49:27 ben-fedora systemd[1]: Started Berkeley Open Infrastructure Network Computing Client.
Oct 18 15:49:27 ben-fedora boinc[4267]: 18-Oct-2020 15:49:27 [---] cc_config.xml not found - using defaults
Oct 18 15:49:37 ben-fedora boinc[4267]: 18-Oct-2020 15:49:37 Another instance of BOINC is running.
Oct 18 15:49:37 ben-fedora systemd[1]: boinc-client.service: Main process exited, code=exited, status=108/n/a
Oct 18 15:49:37 ben-fedora systemd[1]: boinc-client.service: Failed with result 'exit-code'.


Here is my override.conf:
[Service]
ReadWritePaths=-/mnt/linux-files/boinc-data
WorkingDirectory=/mnt/linux-files/boinc-data
ExecStart=
ExecStart=/usr/bin/boinc --dir /mnt/linux-files/boinc-data


After following your instructions, I renamed the /var/lib/boinc directory to boinc.old.

Also, thank you for the reminder, robsmith. I opted to go for making an ext4 partition because NTFS permission support on Linux is a bit strange (permissions are mounted at mount if I remember correctly).

Edit: Fixed service status paste.
ID: 101149 · Report as offensive
floyd
Help desk expert

Send message
Joined: 23 Apr 12
Posts: 75
Message 101155 - Posted: 19 Oct 2020, 10:49:11 UTC - in response to Message 101149.  

Oct 18 15:49:27 ben-fedora systemd[1]: Started Berkeley Open Infrastructure Network Computing Client.
Oct 18 15:49:27 ben-fedora boinc[4267]: 18-Oct-2020 15:49:27 [---] cc_config.xml not found - using defaults
Oct 18 15:49:37 ben-fedora boinc[4267]: 18-Oct-2020 15:49:37 Another instance of BOINC is running.
Oct 18 15:49:37 ben-fedora systemd[1]: boinc-client.service: Main process exited, code=exited, status=108/n/a
Oct 18 15:49:37 ben-fedora systemd[1]: boinc-client.service: Failed with result 'exit-code'.

BOINC exited because it detected it's already running. The first question now is, is this correct? ps aux should tell you. If it is running, the next question is where it came from. Else, why was it detected incorrectly?

Probably unrelated, I guess /var/lib/boinc was boinc's home directory. I'd link /mnt/linux-files/boinc-data to /var/lib/boinc to make sure it exists.
ID: 101155 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101163 - Posted: 20 Oct 2020, 0:07:39 UTC - in response to Message 101155.  

I ran ps aux, but I don't see anything related to BOINC (there's nothing running under the boinc user, nor anything else that pops out at me running under my user).

"Probably unrelated, I guess /var/lib/boinc was boinc's home directory. I'd link /mnt/linux-files/boinc-data to /var/lib/boinc to make sure it exists." - Floyd

So, I should try making /var/lib/boinc a symlink to /mnt/linux-files/boinc-data or is it vice versa?
ID: 101163 · Report as offensive
floyd
Help desk expert

Send message
Joined: 23 Apr 12
Posts: 75
Message 101172 - Posted: 20 Oct 2020, 11:11:28 UTC - in response to Message 101163.  

I ran ps aux, but I don't see anything related to BOINC
So it seems BOINC is not running but still detected and thus won't start. Detection is done with a lock file, let's look at that.
ls -ld /mnt /mnt/linux-files /mnt/linux-files/boinc-data /mnt/linux-files/boinc-data/*lock*

I think minimum requirements are x permissions for the whole path as well as rw for the data directory and the file if it exists. It shouldn't though. You did not copy the data directory while boinc was running, did you?

"Probably unrelated, I guess /var/lib/boinc was boinc's home directory. I'd link /mnt/linux-files/boinc-data to /var/lib/boinc to make sure it exists." - Floyd

So, I should try making /var/lib/boinc a symlink to /mnt/linux-files/boinc-data or is it vice versa?

ln -s /mnt/linux-files/boinc-data /var/lib/boinc
so you get
/var/lib/boinc -> /mnt/linux-files/boinc-data
Just in case anything is referring to $HOME or /var/lib/boinc explicitly.
ID: 101172 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101208 - Posted: 22 Oct 2020, 2:15:35 UTC - in response to Message 101172.  

ls -ld /mnt /mnt/linux-files /mnt/linux-files/boinc-data /mnt/linux-files/boinc-data/*lock*
ls: cannot access '/mnt/linux-files/boinc-data/*lock*': No such file or directory
drwxr-xr-x. 4 root  root  4096 Oct 18 14:45  /mnt
drwxr-xr-x. 4 root  root  4096 Oct 18 14:49  /mnt/linux-files
drwxrwxr-x. 5 boinc boinc 4096 Oct 18 14:57  /mnt/linux-files/boinc-data


Turns out that boinc-data's owner and group was both "root" originally. I corrected this just now and added the write permission for the group. However, starting the service still fails saying another instance is running.
I don't believe I copied the files while it was running. I was following the instructions you posted that involved stopping the service. However, I'm not 100% sure as that was multiple days ago.

I created the symlink in /var/lib/.
lrwxrwxrwx. 1 root root 27 Oct 21 21:02 boinc -> /mnt/linux-files/boinc-data
ID: 101208 · Report as offensive
floyd
Help desk expert

Send message
Joined: 23 Apr 12
Posts: 75
Message 101212 - Posted: 22 Oct 2020, 9:05:55 UTC - in response to Message 101208.  

That ls output looks good to me, except I've never seen a dot after the rwx flags before. The GNU coreutils documentation says

    Following the file mode bits is a single character that specifies whether an alternate access method such as an access control list applies to the file. When the character following the file mode bits is a space, there is no alternate access method. When it is a printing character, then there is such a method.

    GNU ls uses a ‘.’ character to indicate a file with a security context, but no other alternate access method.

    A file with any other combination of alternate access methods is marked with a ‘+’ character.

That sounds like it could matter but I'm guessing now. You may want to read more on "security context" and use the --context option with ls. This is terra incognita to me, I'm afraid I can't help you there.
ID: 101212 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101311 - Posted: 26 Oct 2020, 16:59:39 UTC - in response to Message 101212.  

That ls output looks good to me, except I've never seen a dot after the rwx flags before.

It's like that for all my files on Fedora. I think it's because Fedora has SELinux enabled by default (maybe?). I checked Fedora's wiki here to see how I know an application is being denied access due to SELinux and sure enough this appeared in the audit log when I tried to start the service:
type=AVC msg=audit(1603731218.482:617): avc:  denied  { write } for  pid=20486 comm="boinc" name="boinc-data" dev="sdb2" ino=262145 scontext=system_u:system_r:boinc_t:s0 tcontext=unconfined_u:object_r:unlabeled_t:s0 tclass=dir permissive=0


I will look into this a bit more and post an update. Lots of work just to get BOINC's data directory on another drive >.<
ID: 101311 · Report as offensive
Profile Dave

Send message
Joined: 28 Jun 10
Posts: 1377
United Kingdom
Message 101315 - Posted: 26 Oct 2020, 17:33:17 UTC

Is there any reason you can't create a partition with mount point /var/lib/boinc or /var/lib/boinc-client whichever boinc uses on your distribution?
ID: 101315 · Report as offensive
NavBlank

Send message
Joined: 10 Oct 20
Posts: 9
Message 101425 - Posted: 2 Nov 2020, 0:45:18 UTC - in response to Message 101315.  

Is there any reason you can't create a partition with mount point /var/lib/boinc or /var/lib/boinc-client whichever boinc uses on your distribution?

I have not thought of that. I'm not sure if that would work with SELinux or not. To be honest, I haven't looked into SELinux much yet. It might be a while before I get around to it. It sounds like there's a lot of stuff to figure out.

Something else I was thinking was to just keep BOINC's directory what it originally was and just use the symlink I made, but I'm not sure if that would work well. I imagine I'm going to have issues with SELinux regardless. If I do figure it out or have new information, I'll post an update here.
ID: 101425 · Report as offensive

Message boards : Questions and problems : Changing BOINC Data Directory on Fedora Linux 32

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