4

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?

2
  • What's happen if you use a windows style TEMP=R:\TMP ?
    – matzeri
    Apr 22, 2016 at 15:11
  • 1
    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. Apr 22, 2016 at 21:11

1 Answer 1

6

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)
...
4
  • 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? Apr 26, 2016 at 16:15
  • 1
    @Gene-Pavlovsky : nothing else if you closed all process including services.
    – matzeri
    Apr 26, 2016 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). Apr 28, 2016 at 10:49
  • The usual wisdom of leaving a running shell just in case ... backfired for me. Indeed all processes must be closed first. Jun 7, 2020 at 2:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .