Reinstall cygwin

$Id: cygwin_reinstall.html,v 1.2 2005/10/07 03:39:20 george Exp $

Reinstall cygwin

Yesterday I wanted to reinstall cygwin on my notebook. I just copied the whole cygwin directory from desktop to notebook. When I run cygwin.bat, it always complained that "bash.exe: could not find /tmp, please create!".

There is something wrong with cygwin's mount table. According to cygwin faq, To save the mount information to a file for later restoration, use `mount -m > mounts.bat' To remove all mount information use `umount -A'. To reincorporate saved mount information just run the batch file.

Displaying the current set of mount points

c:/> mount
f:/cygwin/bin on /usr/bin type system (binmode)
f:/cygwin/lib on /usr/lib type system (binmode)
f:/cygwin on / type system (binmode)
e:/src on /usr/src type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)
e: on /cygdrive/e type user (binmode,noumount)

Run mounts.bat to setup mount points to solve the problem

No bash command, just run mount from cmd.exe. At that moment, bash still complains "no /tmp", we can't use it, use mount directly. After we run this batch file, we can check system-wide registry "HKLM/Software/Cygnus Solutions/Cygwin/mounts2".

mount -f -s -b "d:/cygwin/bin" "/usr/bin"
mount -f -s -b "d:/cygwin/lib" "/usr/lib"
mount -f -s -b "d:/cygwin" "/"
mount -s -b --change-cygdrive-prefix "/cygdrive"

Following are from cygwin's faq

The mapping is stored in the current user's Cygwin mount table in the Windows registry so that the information will be retrieved next time the user logs in. Because it is sometimes desirable to have system-wide as well as user-specific mounts, there is also a system-wide mount table that all Cygwin users inherit. The system-wide table may only be modified by a user with the appropriate privileges (Administrator privileges in Windows NT).

The current user's table is located under "HKEY_CURRENT_USER/Software/Cygnus Solutions/Cygwin/mounts v " where is the latest registry version associated with the Cygwin library (this version is not the same as the release number). The system-wide table is located under the same subkeys under HKEY_LOCAL_MACHINE. The user mount table takes precedence over the system-wide table if a path is mounted in both. This includes the setting of the cygdrive prefix.

The mount command can set the POSIX root / to any directory in the Windows file system. In absence of such a mount, Cygwin maps / to the root of the current Windows working directory (for example, H:/ or //computer/share). Normally Cygwin's setup.exe creates the initial mount point for the POSIX root.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值