简体   繁体   中英

How should I safely change cygwin's installation directory on win 7?

Forgive me if I'm missing something obvious, but most of the FAQ for cygwin seems outdated. I installed it to c:/cygwin64, but inanely listened to a few forum posts that recommended installing every package since it was 'so small'. Its 41.9 GB on my disk... So, I'd like to move it to an external.

https://cygwin.com/ml/cygwin/1998-11/msg00649.html -- here I found,

Is it possible to change the root directory from c:\\ to some other directory or drive (for eg j:)?

Yes, of course. Easiest way is to change it in the registry directly: Goto [HKEY_CURRENT_USER\\Software\\Cygnus Solutions\\CYGWIN.DLL setup\\b15.0\\mounts] There are a few mount points from 00 to 0x; find the one with the following values: "native"="C:" "unix"="/" "fbinary"=dword:00000001 "fsilent"=dword:00000000 and change native= to whatever you want.

This seems to suggest that moving is as easy picking up all the files and then changing a registry key. This is obviously not for windows 7 however and I am wary of ever touching my registry. The corresponding key seems to be HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup as it has rootdir with C:\\cygwin64 as its value.

There is also a seemingly random string with the value \\??\\C:\\cygwin64 in HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\Installations as well as HKEY_CURRENT_USER\\SOFTWARE\\Cygwin\\Installations.

So, more pointedly, my questions:

  1. Is it correct to move the cygwin64 folder from c: to e: and change the C:'s to E:'s in the registry?

  2. Can you reassure me this won't affect the voodoo of the registry and break cygwin?

  3. If not, is there another, more sensible way?

What i've already done and you can do, is to make a tar.gz of your cygwin install (with by example cygwin 32bits if you want to move the 64), and untar it where you want. You may have to modify the short link, the bat, and "maybe" some environment variable. Note: installing all the packages is unnecessary.

You could also create a symbolic link to the new location:

mklink /J c:\cygwin64 d:\cygwin

where d: is representing your external drive letter. See also

https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM