Re: [Freesurfer] pwd: permission denied
Hi Marcel: Do you using Mac? If so, please unlock your root account, then change to the root account (re-login as root or using 'su' command in terminal window). We also have this problem one month ago. It is because that the default setting for root account in OS X 10.7.x is hidden in the beginning, and FS need root account to operate. So if your OS X is upgraded to 10.7.x, then you will have problem. The FS ran smoothly under our old version OS X (10.6.x). Hope this help. 2012/3/6 Marcel Zwiers m.zwi...@fcdonders.ru.nl: Hi Michael, Thanks for your help and suggestions! I'd have to try to recreate the error, but I have an idea of what it could be (assuming /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness/BIG1026_1 is a directory). Actually not yet, /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness is a directory but BIG1026_1 is supposed to be created by recon-all (but wasn't as a consequence of the error). While you may have read, write, and execute permissions to your colleague's directory, you must make sure that these permissions have been recursively added to the contents of that directory (child directories, child directory files, and directory files). There are only *.nii.gz files in that directory plus a few extra files and (symbolic links to) folders that I assume should have nothing to do with the error? The content looks like this (ls -al): drwxrwxr-x 2 marhoo big 352256 Mar 6 09:51 ./ drwxrwx--x 15 marhoo big 4096 Feb 29 15:49 ../ -rw--- 1 marzwi big 12219623 Mar 2 16:06 BIG1026_1.nii.gz [..] -rw--- 1 marzwi big 12219623 Mar 2 16:06 BIG4025_1.nii.gz -rw-rwxr-- 1 marhoo big75806 Feb 27 10:54 BIG_aseg_stats.log* lrwxrwxrwx 1 marhoo big 34 Feb 19 09:12 fsaverage - /opt/freesurfer/subjects/fsaverage/ lrwxrwxrwx 1 marhoo big 38 Feb 19 09:12 lh.EC_average - /opt/freesurfer/subjects/lh.EC_average/ lrwxrwxrwx 1 marhoo big 38 Feb 19 09:12 rh.EC_average - /opt/freesurfer/subjects/rh.EC_average/ -rw-rwxr-- 1 marhoo big18200 Sep 27 10:39 v5.0.txt* -rw-rwxr-- 1 marhoo big 3220 Sep 27 10:39 v5.1.txt* -rw-rwxrw- 1 marhoo big 523 Feb 24 10:07 .xdebug_tkmedit* I believe that your problem is that the file BIG1026_1.nii.gz (however, from my experience this file should not simply be in the BIG1026_1 folder but in the orig directory of the mri folder) has not inherited the specified permissions from its parent directory. My username is marzwi, I am member of the big group and I have rw permissions of all the files and directories (see listing above). If this does not correct the error, set the environmental SUBJECTS_DIR variable to the directory housing the subject directories (making sure that your colleague gives you sufficient access to this directory), lose the -sd path in the command, and make sure that you have read, write, execute permissions recursively added to the directories and files that you will be working with. I did that but the error message remains. Here's the full message, started from a newly opened bash terminal: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 Setting up environment for FreeSurfer/FS-FAST (and FSL) FREESURFER_HOME /opt/freesurfer FSFAST_HOME /opt/freesurfer/fsfast FSF_OUTPUT_FORMAT nii.gz SUBJECTS_DIR /opt/freesurfer/subjects MNI_DIR /opt/freesurfer/mni FSL_DIR /opt/fsl mentat002:$ export SUBJECTS_DIR=/home/mrphys/marzwi/BIG/Freesurfer_CorticalThickness mentat002:$ recon-all -subject BIG1026_1 -i BIG1026_1.nii.gz -autorecon1 /bin/pwd: cannot open directory `../..': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied cp: cannot create regular file `/BIG1026_1/scripts/build-stamp.txt': No such file or directory cat: /BIG1026_1/scripts/build-stamp.txt: No such file or directory INFO: FreeSurfer build stamps do not match Subject Stamp: Current Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 INFO: SUBJECTS_DIR is Actual FREESURFER_HOME /opt/freesurfer-v5.1 /BIG1026_1: No such file or directory. Another option would be if your colleague set up a subjects directory within his parent directory and add each subject's folder to this directory and then setting this as your SUBJECTS_DIR variable (ensuring you have read, write, execute permissions). I created a subfolder, copied the BIG1026_1.nii.gz file into it and ran recon-all using this subfolder as SUBJECTS_DIR but I kept getting permission denied errors. I hope this helps; however, not knowing the version of free surfer that you are running nor the operating system makes it difficult to troubleshoot your problem. Let me know if you arrive at a solution or require further assistance. Thanks, Michael Nowak I hope the info above can help troubleshooting my problem. Thanks a lot Michael! Cheers,
Re: [Freesurfer] pwd: permission denied
Hallelujah ! Problem solved! Here's what happened: both tcsh pwd and /bin/pwd give errors when a directory is executable (+x) but not readable (-r). And in my case, the colleague of mine fully opened up $SUBJECTS_DIR for me, but (and this is also how it should be done) only provided me with executable rights for the parent directories. I haven't figured out why recon-all needs to call pwd on these parent directories at all -- I leave that one for the recon-all tcsh gurus :-) My hack was to replace every pwd call in the recon-all script by the built-in bash pwd call (which only needs +x permissions). It's not very pretty, but hey, must of us aren't! To be precise, this is what did it for me (NB: some of the pwd replacements may be unnecessary): diff myrecon-all /opt/freesurfer/bin/recon-all 296c296 set PWD = bash -c 'pwd'; --- set PWD = pwd; 298c298 # if ( -e /bin/pwd ) set PWD = /bin/pwd --- if ( -e /bin/pwd ) set PWD = /bin/pwd 361c361 set freesurfer_home_true = `$PWD`; --- set freesurfer_home_true = `pwd`; 382c382 $PWD $ENVF --- pwd $ENVF 3819c3819 echo PWD `$PWD` $ErrorFile --- echo PWD `pwd` $ErrorFile 3880c3880 set InVolDir = `$PWD`; --- set InVolDir = `pwd`; 4943c4943 setenv FREESURFER_HOME `$PWD`; --- setenv FREESURFER_HOME `pwd`; Hope this may be of use to anyone encountering the same problem and that this tcsh bin /bin/pwd problem may be taken into account in future recon-all versions. All the best and thanks a lot for all your time and kind help, Marcel. Hi, I am new to FS and have encountered a weird problem that I do not know how to solve and did not find any earlier postings on. When I run recon-all on a file in my own home directory everything works normally: recon-all -subject BIG1026_1 -sd /home/mrphys/marzwi/test -i BIG1026_1.nii.gz -autorecon1 [..] However, if I run the same command on the same file, except that this file is now located in a directory of a colleague of mine that I certainly have full access to (+r+w+x), I immediately get a 'permission denied' error: recon-all -subject BIG1026_1 -sd /home/control/marhoo/Projects /BIG/Freesurfer_CorticalThickness -i BIG1026_1.nii.gz -autorecon1 pwd: cannot open directory `../..': Permission denied /bin/pwd: cannot open directory `../..': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied [..] From the error message it seems to me as if FS is trying to access the parent directory (of which I do not have full rights but only -r-w+x)? As this does not make a lot of sense to me I suspect there must be another cause and hope you have any ideas here. Cheers, Marcel -- Marcel Zwiers www.ru.nl/donders MR techniques +31-(0)24-3668495 Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Re: [Freesurfer] pwd: permission denied
Hallelujah ! Problem solved! Here's what happened: both tcsh pwd and /bin/pwd give errors when a directory is executable (+x) but not readable (-r). And in my case, the colleague of mine fully opened up $SUBJECTS_DIR for me, but (and this is also how it should be done) only provided me with executable rights for the parent directories. I haven't figured out why recon-all needs to call pwd on these parent directories at all -- I leave that one for the recon-all tcsh gurus :-) My hack was to replace every pwd call in the recon-all script by the built-in bash pwd call (which only needs +x permissions). It's not very pretty, but hey, must of us aren't! To be precise, this is what did it for me (NB: some of the pwd replacements may be unnecessary): diff myrecon-all /opt/freesurfer/bin/recon-all 296c296 set PWD = bash -c 'pwd'; --- set PWD = pwd; 298c298 # if ( -e /bin/pwd ) set PWD = /bin/pwd --- if ( -e /bin/pwd ) set PWD = /bin/pwd 361c361 set freesurfer_home_true = `$PWD`; --- set freesurfer_home_true = `pwd`; 382c382 $PWD $ENVF --- pwd $ENVF 3819c3819 echo PWD `$PWD` $ErrorFile --- echo PWD `pwd` $ErrorFile 3880c3880 set InVolDir = `$PWD`; --- set InVolDir = `pwd`; 4943c4943 setenv FREESURFER_HOME `$PWD`; --- setenv FREESURFER_HOME `pwd`; Hope this may be of use to anyone encountering the same problem and that this tcsh bin /bin/pwd problem may be taken into account in future recon-all versions. All the best and thanks a lot for all your time and kind help, Marcel. Hi, I am new to FS and have encountered a weird problem that I do not know how to solve and did not find any earlier postings on. When I run recon-all on a file in my own home directory everything works normally: recon-all -subject BIG1026_1 -sd /home/mrphys/marzwi/test -i BIG1026_1.nii.gz -autorecon1 [..] However, if I run the same command on the same file, except that this file is now located in a directory of a colleague of mine that I certainly have full access to (+r+w+x), I immediately get a 'permission denied' error: recon-all -subject BIG1026_1 -sd /home/control/marhoo/Projects /BIG/Freesurfer_CorticalThickness -i BIG1026_1.nii.gz -autorecon1 pwd: cannot open directory `../..': Permission denied /bin/pwd: cannot open directory `../..': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied [..] From the error message it seems to me as if FS is trying to access the parent directory (of which I do not have full rights but only -r-w+x)? As this does not make a lot of sense to me I suspect there must be another cause and hope you have any ideas here. Cheers, Marcel -- Marcel Zwiers www.ru.nl/donders MR techniques +31-(0)24-3668495 Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Re: [Freesurfer] pwd: permission denied
Hi Michael, Thanks for your help and suggestions! I'd have to try to recreate the error, but I have an idea of what it could be (assuming /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness/BIG1026_1 is a directory). Actually not yet, /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness is a directory but BIG1026_1 is supposed to be created by recon-all (but wasn't as a consequence of the error). While you may have read, write, and execute permissions to your colleague's directory, you must make sure that these permissions have been recursively added to the contents of that directory (child directories, child directory files, and directory files). There are only *.nii.gz files in that directory plus a few extra files and (symbolic links to) folders that I assume should have nothing to do with the error? The content looks like this (ls -al): drwxrwxr-x 2 marhoo big 352256 Mar 6 09:51 ./ drwxrwx--x 15 marhoo big 4096 Feb 29 15:49 ../ -rw--- 1 marzwi big 12219623 Mar 2 16:06 BIG1026_1.nii.gz [..] -rw--- 1 marzwi big 12219623 Mar 2 16:06 BIG4025_1.nii.gz -rw-rwxr-- 1 marhoo big 75806 Feb 27 10:54 BIG_aseg_stats.log* lrwxrwxrwx 1 marhoo big 34 Feb 19 09:12 fsaverage - /opt/freesurfer/subjects/fsaverage/ lrwxrwxrwx 1 marhoo big 38 Feb 19 09:12 lh.EC_average - /opt/freesurfer/subjects/lh.EC_average/ lrwxrwxrwx 1 marhoo big 38 Feb 19 09:12 rh.EC_average - /opt/freesurfer/subjects/rh.EC_average/ -rw-rwxr-- 1 marhoo big 18200 Sep 27 10:39 v5.0.txt* -rw-rwxr-- 1 marhoo big 3220 Sep 27 10:39 v5.1.txt* -rw-rwxrw- 1 marhoo big 523 Feb 24 10:07 .xdebug_tkmedit* I believe that your problem is that the file BIG1026_1.nii.gz (however, from my experience this file should not simply be in the BIG1026_1 folder but in the orig directory of the mri folder) has not inherited the specified permissions from its parent directory. My username is marzwi, I am member of the big group and I have rw permissions of all the files and directories (see listing above) . If this does not correct the error, set the environmental SUBJECTS_DIR variable to the directory housing the subject directories (making sure that your colleague gives you sufficient access to this directory), lose the -sd path in the command, and make sure that you have read, write, execute permissions recursively added to the directories and files that you will be working with. I did that but the error message remains. Here's the full message, started from a newly opened bash terminal: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 Setting up environment for FreeSurfer/FS-FAST (and FSL) FREESURFER_HOME /opt/freesurfer FSFAST_HOME /opt/freesurfer/fsfast FSF_OUTPUT_FORMAT nii.gz SUBJECTS_DIR /opt/freesurfer/subjects MNI_DIR /opt/freesurfer/mni FSL_DIR /opt/fsl mentat002:$ export SUBJECTS_DIR=/home/mrphys/marzwi/BIG/Freesurfer_CorticalThickness mentat002:$ recon-all -subject BIG1026_1 -i BIG1026_1.nii.gz -autorecon1 /bin/pwd: cannot open directory `../..': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied cp: cannot create regular file `/BIG1026_1/scripts/build-stamp.txt': No such file or directory cat: /BIG1026_1/scripts/build-stamp.txt: No such file or directory INFO: FreeSurfer build stamps do not match Subject Stamp: Current Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 INFO: SUBJECTS_DIR is Actual FREESURFER_HOME /opt/freesurfer-v5.1 /BIG1026_1: No such file or directory. Another option would be if your colleague set up a subjects directory within his parent directory and add each subject's folder to this directory and then setting this as your SUBJECTS_DIR variable (ensuring you have read, write, execute permissions). I created a subfolder, copied the BIG1026_1.nii.gz file into it and ran recon-all using this subfolder as SUBJECTS_DIR but I kept getting permission denied errors. I hope this helps; however, not knowing the version of free surfer that you are running nor the operating system makes it difficult to trou bleshoot your problem. Let me know if you arrive at a solution or require further assistance. Thanks, Michael Nowak I hope the info above can help troubleshooting my problem. Thanks a lot Michael! Cheers, Marcel On Mon, Mar 5, 2012 at 9:55 PM, Marcel Zwiers m.zwi...@fcdonders.ru.nl wrote: Hi, I am new to FS and have encountered a weird problem that I do not know how to solve and did not find any earlier postings on. When I run recon-all on a file in my own home directory everything works normally: recon-all -subject BIG1026_1 -sd /home/mrphys/marzwi/test -i BIG1026_1.nii.gz -autorecon1 [..] However, if I run the same command on the same file, except that this file is now located in a directory of a colleague of mine that I certainly have full access to (+r+w+x), I immediately get a 'permission denied' error: recon-all
[Freesurfer] pwd: permission denied
Hi, I am new to FS and have encountered a weird problem that I do not know how to solve and did not find any earlier postings on. When I run recon-all on a file in my own home directory everything works normally: recon-all -subject BIG1026_1 -sd /home/mrphys/marzwi/test -i BIG1026_1.nii.gz -autorecon1 [..] However, if I run the same command on the same file, except that this file is now located in a directory of a colleague of mine that I certainly have full access to (+r+w+x), I immediately get a 'permission denied' error: recon-all -subject BIG1026_1 -sd /home/control/marhoo/Projects/BIG/Freesurfer_CorticalThickness -i BIG1026_1.nii.gz -autorecon1 pwd: cannot open directory `../..': Permission denied /bin/pwd: cannot open directory `../..': Permission denied mkdir: cannot create directory `/BIG1026_1': Permission denied [..] From the error message it seems to me as if FS is trying to access the parent directory (of which I do not have full rights but only -r-w+x)? As this does not make a lot of sense to me I suspect there must be another cause and hope you have any ideas here. Cheers, Marcel -- Marcel Zwiers www.ru.nl/donders MR techniques +31-(0)24-3668495 Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.