|
[Sponsors] |
[OpenFOAM.com] How to change installation from root to new user ?? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 12, 2021, 16:18 |
How to change installation from root to new user ??
|
#1 |
New Member
Chattisgarh
Join Date: Oct 2020
Posts: 5
Rep Power: 6 |
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 !! |
|
February 12, 2021, 16:43 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Hi,
- maybe just remove (`rm -rf`) all OF from the root, and reinstall it locally?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 12, 2021, 17:10 |
|
#3 |
New Member
Chattisgarh
Join Date: Oct 2020
Posts: 5
Rep Power: 6 |
hii HPE,
I can surely do that, but was hoping for some other way without re-installing |
|
February 13, 2021, 15:28 |
|
#4 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
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.
|
|
February 14, 2021, 03:34 |
|
#5 |
New Member
Chattisgarh
Join Date: Oct 2020
Posts: 5
Rep Power: 6 |
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? |
|
February 21, 2021, 04:00 |
|
#6 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
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. |
|
December 4, 2021, 10:24 |
Moving my old foam-extend-3.1 installation
|
#7 |
Senior Member
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 103
Rep Power: 20 |
Just now I had to move my old foam-extend-3.1 installation.
What I did was open my etc/baschrc and replace $HOME with the home directory of the new place. Here is what I did for this case NOTE username is explicit, . . . do not replace it with $HOME /users/home/username is the new place cd /users/home/username/foam/foam-extend-3.1/etc gedit bashrc --------------------------------------------------------- # foamInstall=$HOME/$WM_PROJECT foamInstall=/users/home/username/$WM_PROJECT # foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$USER" foamOldDirs="$FOAM_INST_DIR /users/home/username/$WM_PROJECT/$USER" # export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION export WM_PROJECT_USER_DIR=/users/home/username/$WM_PROJECT/$USER-$WM_PROJECT_VERSION --------------------------- ….and in my .bashrc for the new location alias foam31_ihpc='source /users/home/username/foam/foam-extend-3.1/etc/bashrc && PS1="\[\e[0;35m\][E.3.1.ihpc]\[\e[0m\]\[\e[0;31m\][\W]\[\e[0m\]: " ' I have been testing this now (by doing some mpi runs), and all seems to work perfectly. Note, this will be different for other installs like of-v2012, but the approach would be the same. hope this helps cheers JE. |
|
|
|
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 | 15 | June 7, 2021 07:32 |
User Code to change optical properties at certain temperature | RageofaMonkey | STAR-CCM+ | 0 | June 21, 2018 12: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 12:22 |
Is it safe to change owner of src to root? | chrisb2244 | OpenFOAM Programming & Development | 2 | February 20, 2014 07:59 |
Installation hints OF141 on openSUSE103 | markc | OpenFOAM Installation | 1 | February 15, 2008 07:58 |