I've add this line to my /etc/fstab, taken from Cygwin's user guide, section 3.1.5:

none /tmp usertemp binary,posix=0 0 0

However, I get an error trying to mount it:

# mount /tmp
mount: /tmp: Invalid argument

Both TMP and TEMP env vars point to /cygdrive/r/tmp (which is on a RAM drive) I can do mount r:/tmp /tmp without a problem, I just figured using usertemp would be desirable to avoid hardcoding the temp dir.

For the time being, I'm using this line in my fstab:

R:/tmp /tmp ntfs binary,posix=0  0 0

What's the reason it's not working?

  • What's happen if you use a windows style TEMP=R:\TMP ? – matzeri Apr 22 '16 at 15:11
  • They are like that. But Cygwin converts them to UNIX-style automatically. From cmd shell: C:\Users\root>set | grep TMP returns TMP=R:\tmp, but C:\Users\root>env | grep TMP returns TMP=/mnt/r/tmp. – Gene Pavlovsky Apr 22 '16 at 21:11

I guess is not very clear from the documentation. The steps are:

edit /etc/fstab 
close all cygwin processes
restart cygwin

With that

$ cat /etc/fstab
none /tmp usertemp binary,posix=0 0 0

$ mount
C:/Temp on /tmp type ntfs (binary,posix=0,usertemp)
  • That's what I did when I tried the first time. But this time it worked, for some reason. By the way what do you mean by restarting cygwin? After I closed all cygwin processes, is there anything left running that should be restarted? – Gene Pavlovsky Apr 26 '16 at 16:15
  • 1
    @Gene-Pavlovsky : nothing else if you closed all process including services. – matzeri Apr 26 '16 at 17:37
  • Right, I remembered that but it's good to mention. Sometimes when update cygwin it complains dll can't be updated because of running processes. That's the time to remember that I have sshd and cron services (go to Windows services and stop them). – Gene Pavlovsky Apr 28 '16 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.