问题背景

为了在 Cygwin 下使用之前最喜爱的 screen 命令, 安装 Cygwin 时就选上了 screen

来运行一把

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -ls
Directory '/tmp/uscreens' must have mode 777.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chmod 777 uscreens/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ ll
total 0
drwxr-xr-x 1 ganiks.liu Domain Users 0 Jul 25 13:28 .
drwxr-xr-x 1 ganiks.liu Domain Users 0 Jul 25 13:10 ..
drwxr-xr-x 1 ganiks.liu Domain Users 0 Jul 25 13:49 uscreens

cygwin chmod 失效

为什么 chmod 失效呢?

查了原因是 当前 cygwin 所在磁盘 E:\ 盘格式为 Fat32, 不支持 权限管理。

好吧,来转 NTFS 吧

cmd就是个很不错的工具(经过实际运行,我否定了“不错”这个形容,因为整个过程花费了不知道多少个小时)

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\ganiks.liu>e:
E:\>convert E:/FS:NTFS /V
The type of the file system is FAT32.
Enter current volume label for drive E: DISK1_VOL3
Convert cannot run because the volume is in use by another
process.  Convert may run if this volume is dismounted first.
ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID.
Would you like to force a dismount on this volume? (Y/N) Y
Volume dismounted.  All opened handles to this volume are now invalid.
Convert cannot gain exclusive access to the E: drive,
so it cannot convert it now.  Would you like to
schedule it to be converted the next time the
system restarts (Y/N)? Y
The conversion will take place automatically the next time the
system restarts.
E:\>

我转换的这个 E 盘, 从下午3点多开始转换, 一直到 5点下班的时候还在转换, 于是关掉显示器回家...

谢天谢地, 第二天早上来, 机器正常开机了, 而且 E盘 成功转换了 NTFS

用工具实现 windows 硬盘格式的转换

已经体会了 win 自带 转换命令的不靠谱(据同事说我算幸运的,花了这么久转换成功了, 有很多失败的, 可能是没有开启虚拟内存 or sth.)

来试试他们介绍的 2个工具吧

  • partassist分区助手 (待测试)
  • paragon Partion Manager 9.0

成功运行 screen 在 cygwin 中

经过千辛万苦转换了硬盘格式, 现在再来测试 screen

我变得非常脆弱, 貌似不能再接受 screen 不支持的其他问题了

其实这个心态非常不好, 因为程序员注定是为解决问题而生的, 遇到一个解决一个, 技能才得到提高

另外越是深入的解决一个问题,你会发现能打通到其他的领域, 对以后遇到别的问题很有可能是有帮助的

结束题外话, 这次确实运行成功了

ganiks.liu@MAMIS-Gaiks-Liu ~
$ screen.exe -ls
Directory '/tmp/uscreens' must have mode 777.

ganiks.liu@MAMIS-Gaiks-Liu ~
$ cd /tmp/

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ ll
total 0
drwxrwx---+ 1 Administrators root 0 Jul 25 13:28 .
drwxrwx---+ 1 Administrators root 0 Jul 25 13:10 ..
drwxrwx---+ 1 Administrators root 0 Jul 25 13:49 uscreens

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chmod 777 uscreens/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ ll
total 0
drwxrwx---+ 1 Administrators root 0 Jul 25 13:28 .
drwxrwx---+ 1 Administrators root 0 Jul 25 13:10 ..
drwxrwxrwx+ 1 Administrators root 0 Jul 25 13:49 uscreens

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -ls
You are not the owner of /tmp/uscreens/S-ganiks.liu.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe -S aaa
You are not the owner of /tmp/uscreens/S-ganiks.liu.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chown ganiks.liu uscreens/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ ll
total 0
drwxrwx---+ 1 Administrators root 0 Jul 25 13:28 .
drwxrwx---+ 1 Administrators root 0 Jul 25 13:10 ..
drwxrwxrwx+ 1 ganiks.liu     root 0 Jul 25 13:49 uscreens

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -ls
Directory /tmp/uscreens/S-ganiks.liu must have mode 700.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chmod 777 uscreens/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -ls
Directory /tmp/uscreens/S-ganiks.liu must have mode 700.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chmod 700 uscreens/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -ls
Directory '/tmp/uscreens' must have mode 777.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ ll
total 0
drwxrwx---+ 1 Administrators root 0 Jul 25 13:28 .
drwxrwx---+ 1 Administrators root 0 Jul 25 13:10 ..
drwx------+ 1 ganiks.liu     root 0 Jul 25 13:49 uscreens

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chmod 777 uscreens/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ chmod 700 uscreens/S-ganiks.liu/ -R

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -ls
No Sockets found in /tmp/uscreens/S-ganiks.liu.

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$ screen.exe  -S aa
[screen is terminating]

ganiks.liu@MAMIS-Gaiks-Liu /tmp
$

更改 cygwin machine name

对于有“不知道什么度”洁癖的人, 我总是会去想办法解决每一个“小问题”, 有可能这个问题根本对项目的进度没有关系

比如,我刚刚贴了这个代码, 发现机器名 MAMIS-Gaiks-Liu 丑陋无比, 我要改成 wswtech

印象中要改两个地方

  • /etc/hosts
  • /etc/hostname
  • hostname your_new_name

cygwin chmod 失效的更多相关文章

  1. cygwin and its host machine

    Senario 本来我是想要修改下 machine name 在Ubuntu中的步骤是这样的 1 sudo hostname newMechineName 2 sudo vi /etc/hostnam ...

  2. apt-cyg for Cygwin(setup-x86_64 .exe )在win10下的安装

    cygwin安装后,如果没有选择安装所有包(这会占用5G空间,很多包不需要),再需要安装新的包,可以启动setup-x86_64 .exe(我把它放置在C:\cygwin64目录下),添加包(如wge ...

  3. Windows下安装Cygwin及包管理器apt-cyg(转)

    本文为转载文章: http://www.2cto.com/os/201212/176551.html Cygwin可以在Windows下使用unix环境Bash和各种功能强大的工具,对于Linux管理 ...

  4. Installing Cygwin and Starting the SSH Daemon

    This chapter explains how to install Cygwin and start the SSH daemon on Microsoft Windows hosts. Thi ...

  5. Cygwin下软件安装 - apt-cyg

    安装了cygwin,但不能像centos上装yum,装东西很不方便.找了下可以用apt-cyg来安装软件. 1.下载apt-cyg $ wget raw.github.com/transcode-op ...

  6. [转]Cygwin的包管理器:apt-cyg

    [转]Cygwin的包管理器:apt-cyg http://zengrong.net/post/1792.htm Cygwin的包管理工具setup.exe实在是难用的让人蛋碎.于是就有了这样一个ap ...

  7. 【转】Cygwin的包管理器:apt-cyg

    原文网址:http://zengrong.net/post/1792.htm Cygwin的包管理工具setup.exe实在是难用的让人蛋碎.于是就有了这样一个apt-cyg,可以提供类似于 apt- ...

  8. 【搭建开发环境】在 Windows XP 中参与开源项目,搭建 git 和 cygwin 开发环境

    引言 只有一台 Windows XP 家用机,却想在诸如 Git@OSC 之类的开源社区参与开发,本文提供一个入门级的开发环境搭建指引. 涉及工具:Eclipse,EGit,Cygwin. 欢迎来到 ...

  9. cygwin 扩展

    1.使用setup,然后一路安装到select package,选择需要的包即可,然后一路next. 2.setup.exe -q -P 包名, 详细用法如下: Command Line Option ...

随机推荐

  1. Asp.net MVC4 Knockoutjs BootStrap Ace NinJect Jqgrid sqlserver2008

    Asp.net MVC4 Knockoutjs  BootStrap Ace NinJect  Jqgrid sqlserver2008

  2. Linux安装配置php环境的方法

    本文实例讲述了Linux安装配置php环境的方法.分享给大家供大家参考,具体如下: 1.获取安装文件: http://www.php.net/downloads.php php-5.3.8.tar.g ...

  3. 多端口站点设置,以APMSERV集成环境为例!

    以下以APMSERV集成环境为例: 1.找到你的apache上的配置文件httpd.conf,用记事本打开, D:\APMServ\Apache\conf 2.修改以下几项: Listen 80 下增 ...

  4. angularJS通过post方法下载excel文件

    最近工作中遇到,要使用angularJS的post方法来下载excel的情况.网上找到一个帖子:http://stackoverflow.com/questions/22447952/angularj ...

  5. PHPExcel读取excel的多个sheet存入数据库

    //批量导入文章 excel读取 public function importdata ( $filename, $tmp_name ) { //设置超时时间 set_time_limit(0); $ ...

  6. php的swoole扩展中onclose和onconnect接口不被调用的问题

    在用swoole扩展写在线聊天例子的时候遇到一个问题,查了不少资料,现在记录于此. 通过看swoole_server的接口文档,回调注册接口on中倒是有明确的注释: * swoole_server-& ...

  7. android Material Design:主题

    <style name="MyTheme" parent="@android:style/android:Theme.Material"> < ...

  8. 使用 Attribute +反射 来对两个类之间动态赋值

    看同事使用的 一个ORM 框架 中 有这样一个功能  通过特性(附加属性)的功能来 实现的两个类对象之间动态赋值的 功能 觉得这个功能不错,但是同事使用的 ORM 并不是我使用的  Dapper  所 ...

  9. C# WPF使用ZXing生成二维码ImageSource

    介绍: 如果需要实在WPF窗体程序中现类似如下的二维码图片生成功能,可以通过本文的方法实现 添加步骤: 1.在http://zxingnet.codeplex.com/站点上下载ZXing .Net的 ...

  10. 装黑苹果的那些事儿(以ThinkpadE540为例)

    苹果系统,有着比window更好的安全性和方便性,更重要的事,没有MAC系统环境,进行iOS开发,是很麻烦的,对新手来说,是很懊恼的一件事.但是白苹果像件奢侈品,吾等常人,很难有经济消费.如是黑苹果是 ...