0

I tried many tutorials I found on the internet on how to change the location of my JENKINS_HOME.

I still encountered these errors:

On the jenkins app - Unable to create the home directory ‘/mnt/2fe95e40-f8ba-418e-804c-0a25571f7b0c/jenkins’. This is most likely a permission problem.

On the jenkins logs - SEVERE hudson.util.BootFailure#publish: Failed to initialize Jenkins hudson.util.NoHomeDir

In the the tutorials they are saying that one of the reasons to change the JENKINS_HOME is the issue of the disk space, but their steps were always to change the directory to a new /home/<new_folder>. They are still using the same drive, they just change the folder it does not fix their disk space problem.

Does anyone know how to use the another hard disk as the new JENKINS_HOME? Without having to use SymLink or Symbolic Link that point to another drive.

I am using Ubuntu 18.04.1 x64

Thanks.

nightrobin
  • 59
  • 11

1 Answers1

1

I would do a fresh install on the new hard disk, then make a backup from the old location and restore it on the new disk.
If you do not agree with this approach you should check which user has permission on the Jenkins files and folders on the new hard disk.

stat [yourfilename or yourfolder] 

Compare with JENKINS_USER variable in etc/default/jenkins. Change the user if needed on the new location:

chown -R your_user /var/lib/jenkins

You will need to restart Jenkins and maybe reboot the machine.

As a second option, maybe Jenkins can not create its home directory in the new place. You can create the directory manually and then change JENKINS_HOME to point to it.

More info:
https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins
https://askubuntu.com/questions/175054/how-to-find-owner-and-group-of-a-directory
Run jenkins job as another user
Can't get Jenkins to start using Tomcat

K. B.
  • 3,342
  • 3
  • 19
  • 32