Share /tmp directory across multiple cygwin installations

0

On Win 7 Pro, I'd like to "share" the /tmp path across my existing Cygwin install and the Cygwin env that comes with Git Bash.

I'm trying to follow some instructions like these and ssh-agent writes to this /tmp path.

Seems like some approach using mount or linking must be possible.

Older cygwin install

$ mount  
C:/cygwin/bin on /usr/bin type ntfs (binary,auto) 
C:/cygwin/lib on /usr/lib type ntfs (binary,auto) 
C:/cygwin on / type ntfs (binary,auto) 
C: on /c type ntfs (binary,posix=0,user,noumount,auto)

Git Bash install

$ mount  
C:/Program Files/Git on / type ntfs (binary,noacl,auto)
C:/Program Files/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C:/Users/MY_USER/AppData/Local/Temp on /tmp type ntfs (binary,noacl,posix=0)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)

Perhaps this seems like an easy question, but I thought I might save the time of going through the trial-and-error myself (and having to restart the env and stop existing executions etc) by just asking here, humbly, if anyone who is fairly sure of an approach could spare me the trial and error.

BTW, not sure I'd recommend this setup and this combination of using Cygwin and Git. I have some paths/scripts I haven't been able to untangle and misc. issues (like the need for git-lfs) preventing a simpler setup for now.

Thank you!

Scott Kurz

Posted 2017-01-04T14:18:27.793

Reputation: 103

Why don't you just install the Cygwin of Git? – DavidPostill – 2017-01-04T14:59:34.460

The "Git Bash install" does come with a Cygwin install. I'm asking if I can do something like share the mount points with my pre-existing Cygwin install. – Scott Kurz – 2017-01-04T15:33:46.547

Answers

1

The easiest option is to create a windows directory link using "mklink"

  1. Open a windows cmd.exe
  2. Go to c:\cygwin
  3. Delete or rename existing tmp directory
  4. Create a link in c:\cygwin\tmp using mklink: mklink tmp YOUR_TEMP_FOLDER

More info see mklink help:

C:\mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    Specifies the new symbolic link name.
        Target  Specifies the path (relative or absolute) that the new link
                refers to.

jorgediaz-lr

Posted 2017-01-04T14:18:27.793

Reputation: 171