CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] How to change installation from root to new user ??

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2021, 15:18
Default How to change installation from root to new user ??
  #1
New Member
 
Chattisgarh
Join Date: Oct 2020
Posts: 5
Rep Power: 2
nikag123 is on a distinguished road
Hello Everyone.
I have accidentally installed my openfoam 8.0 in the root directory. By this I mean that the setup files (the ones which include pre loaded tutorials) are in /opt/openfoam8 and the case files (which are accessed by $FOAM_RUN, where I copy the tutorials) are stored in /root/OpenFOAM/root-8/run.

But now I created a new user, copied the tutorials in it from /opt/openfoam8/tutorials and performed blockMesh in the cavity tutorial.
The error appeared was "Cannot find 'blockMesh' command". This is I suppose occurred due to location of openfoam in different directory.

So my question is, how to move the openfoam installation from the /root folder to the new user directory (which is /home/new_user ). I have tried by giving all types of root privileges to the new_user but was unable to run the case files while I login in the new user directory.

Any help would be great !!
nikag123 is offline   Reply With Quote

Old   February 12, 2021, 15:43
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 788
Rep Power: 8
HPE is on a distinguished road
Hi,
- maybe just remove (`rm -rf`) all OF from the root, and reinstall it locally?
HPE is offline   Reply With Quote

Old   February 12, 2021, 16:10
Default
  #3
New Member
 
Chattisgarh
Join Date: Oct 2020
Posts: 5
Rep Power: 2
nikag123 is on a distinguished road
hii HPE,
I can surely do that, but was hoping for some other way without re-installing
nikag123 is offline   Reply With Quote

Old   February 13, 2021, 14:28
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,178
Rep Power: 29
olesen will become famous soon enougholesen will become famous soon enough
Quote:
Originally Posted by nikag123 View Post
hii HPE,
I can surely do that, but was hoping for some other way without re-installing
It would certainly help with understanding if you define what you mean by "installing openfoam". Are you unpacking a precompiled binary pack somewhere, downloaded source and compiled in the wrong directory etc? In general it does not pose a problem to compile OpenFOAM in a particular directory and then move everything into another directory (this is after all what we do when creating binary packs for ubuntu, centos/redhat opensuse, or with spack or easybuild) so there must be something that I am missing.
olesen is offline   Reply With Quote

Old   February 14, 2021, 02:34
Default
  #5
New Member
 
Chattisgarh
Join Date: Oct 2020
Posts: 5
Rep Power: 2
nikag123 is on a distinguished road
Thank You Olesen
What I meant was I could not perform commands like blockmesh when I am logged in as normal user. Of Course, when I am logged in as root user, I easliy run the blockmesh command for a file in any directory.

This was because, as I understood, I do not have the permission to access the /root folder (root user's home directory) when I am logged in as a normal user

With sudo, I was able to give the new user access to commands like "ls -" but not access the /root folder.

So I now figured that it may be vulnerable to give the new user access to the /root folder in order to accomplish my problem.

I should rather install the OpenFOAM folder (which is currently in the /root directory) in the my new user directory.

If the above is true, now my question is how to install openfoam such that I can run the case files when I am logged in as new user?
nikag123 is offline   Reply With Quote

Old   February 21, 2021, 03:00
Default
  #6
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,178
Rep Power: 29
olesen will become famous soon enougholesen will become famous soon enough
Still not sure if this is indeed an issue with running blockMesh, or if it is because you are trying create files in a location that doesn't belong to that particular user.
In general, you will want to change the ownership of the OpenFOAM installation. Use the chown command. Next ensure that the OpenFOAM files are usable by all users. For that the 'chmod -R a+rX' command is what you want. It is important to notice that it is a large 'X', which on adjusts the execution permission if the file is already executeable. This probably is your issue in the first place. Usually the root user will have a strict umask that prevents non-group members from having permissions.
olesen is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i fix installation error of ansys 19.0 on ubuntu 18.04 rid_taki ANSYS 14 May 31, 2020 05:11
User Code to change optical properties at certain temperature RageofaMonkey STAR-CCM+ 0 June 21, 2018 11:46
[foam-extend.org] A smooth installation of foam-3.0-extend on OpenSUSE 13.1 64-bits cookcaptain OpenFOAM Installation 7 May 26, 2015 11:22
Is it safe to change owner of src to root? chrisb2244 OpenFOAM Programming & Development 2 February 20, 2014 06:59
Installation hints OF141 on openSUSE103 markc OpenFOAM Installation 1 February 15, 2008 06:58


All times are GMT -4. The time now is 12:23.