1

Command:

mkdir -p /drives/f/_/cache

returns:

mkdir: can't create directory '/drives/f/': Permission denied

in MobaXterm on Windows.

mkdir -p cache

in /drives/f/_/ works fine.

Any workaround on this assuming I can't go with relative path here? I can't change permissions for /drives so I think there is the main problem. Maybe there is a solution in MobaXterm allowing to use full path without /drives at the beginning?

J. Doe
  • 59
  • 8
  • Why do you need the -p option, if /drives/f/_/ already exists? – Francesco Gasparetto Feb 10 '20 at 13:19
  • mkdir -p is used in many times in linux script, I just don't want to change every such command to if-elseif equivalent – J. Doe Feb 10 '20 at 13:27
  • Ok, i suggest to check directories permissions, all parents should have at least the x permission – Francesco Gasparetto Feb 10 '20 at 13:45
  • all parents have 777 permission, excluding /drives (555 - no write) – J. Doe Feb 10 '20 at 13:51
  • I don't know anything about MobaXterm, so this is guesswork. It looks like `mkdir` can see '/drives' but not '/drives/f'. Maybe it's a case sensitivity issue. Try `mkdir -p /drives/F/_/cache`. If it's not that, maybe there's something else unexpected about the paths seen by `mkdir`. If you run `pwd` in '/drives/f', what does it print? (Hoping that `pwd` and `mkdir` process paths in the same way.) – pjh Feb 10 '20 at 18:13
  • It is case insensitive - `mkdir -p /drives/F/_/cache` returns same error. Also, pwd in `/drives/f` returns: /drives/f – J. Doe Feb 10 '20 at 18:54
  • What does `mount` show? – Doug Henderson Feb 11 '20 at 07:40
  • F: on /drives/f type ntfs (binary,posix=0,user,noumount,auto) – J. Doe Feb 11 '20 at 10:36

1 Answers1

1

I used workaround changing:

/drives/f/_/cache

to:

f:/_/cache

by using command:

BASE_DIR=$(pwd | cut -f 3 -d '/'):/$(pwd | cut -f 4- -d '/')

and it works flawless in MobaXterm.

J. Doe
  • 59
  • 8