How to mount Cygwin’s /tmp on usertemp

cygwin;

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?

Best Answer

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

edit /etc/fstab
close all cygwin processes including services
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)
...
Related Question