Monday, August 4, 2008

Moving already installed cygwin to a new location in drive or using already installed cygwin in a new OS just keeping the folder backed up

Moving already installed cygwin to a new location in drive or using already installed cygwin in a new OS just keeping the folder backed up

If you have already installed cygwin, type mount to see the existing mount points. For example this is how I see in my machine.

d:\cygwin\bin on /usr/bin type system (binmode)
d:\cygwin\lib on /usr/lib type system (binmode)
d:\cygwin on / type system (binmode)
c: on /cygdrive/c type system (binmode,noumount)
d: on /cygdrive/d type system (binmode,noumount)
e: on /cygdrive/e type system (binmode,noumount)
u: on /cygdrive/u type system (binmode,noumount)

You can see that cygwin mounts few drives as shown below for managing executable file paths.
d:\cygwin\bin on /usr/bin type system (binmode)
d:\cygwin\lib on /usr/lib type system (binmode)
d:\cygwin on / type system (binmode)

Now this information has to be restored after moving the cygwin installation to a new directory. These informations are stored in registry path "HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\".

Easiest way to modify this is to use an existing reg entry backed up and then add it to registry and then modify it to the path where your cygwin is located now. Copy the following to a .reg file and double clikc to add.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"
"cygdrive flags"=dword:00000022

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/]
"native"="C:\\cygwin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin]
"native"="C:\\cygwin/bin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib]
"native"="C:\\cygwin/lib"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options]

No comments: