Linux与Windows利用ext3共享数据

Linux与Windows利用ext3共享数据

这里讨论的方法主要解决以下问题:
1、通常只能以fat区共享数据(NTFS写不安全)
2、但在Linux下访问fat区,不能有全为大写的文件名,导致程序开发时需要的诸如AUTHORS、README、NEWS等文件变成不规范的小写形式,更严重的是CVS目录变成了cvs!
3、但在Linux下访问fat区,无法建立符号链,导致程序开发时autoconf、automake无法执行
4、但在Linux下访问fat区,由于没有“x”标志,所有文件都统统具有了执行标志;

所以考虑用Linux下的文件系统作为共享区,在Windows下装对应的驱动。ReiserFS的Windows驱动不成熟,几乎每次都导致WindowsXP蓝屏,所以不得不用ext3,找了一个比较稳重的Windows驱动:Ext2IFS,最新版本是1.10b,这样就能把ext3区挂载成为某个盘(比如:D:/)来访问。
新的问题又出现了,Windows默认代码页是GB2312(cp936),而ext3不进行文件名底层转码,也就是说Linux端也必须使用zh_CN.GB2312环境,否则总有一边的中文文件名会是乱码,经过百般尝试,无解。
现在不得已只能把Linux环境设置为zh_CN.GB2312,放弃标准的UTF-8,设置的方法是编辑/etc/locale.gen,将zh_CN GB2312置于文件最后(没有就加上),再运行locale-gen,登录XWindow的时候选择“中文(中国)”即可。
需要注意的问题是,GTK从2.x的某个版本开始默认的底层编码就变成了UTF-8,导致不能正确处理GB2312的文件名,不过设置两个环境变量即可,可编辑/etc/environment文件,在末尾加入如下两行:
G_FILENAME_ENCODING=@locale
G_BROKEN_FILENAMES=1
第一行就不必解释了,地球人一看就知道,加入第二行的原因是,GTK的程序创建中文名文件时不管三七二十一,都使用UTF-8,而不是环境设置的GB2312,所以只能强制它不这样做了!

这样Linux与Windows的数据沟通就畅通无阻了,美中不足的是不得不又退回了GB2312的时代。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以读写Ext2,以Ext2方式挂载Ext3文件系统(不支持Ext3日志),不支持中文! It provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 volumes (read access andwrite access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer. What features are supported? Complete reading and writing access to files and directories of volumes with theExt2 orExt3 file system. Supports features which are specific to the I/O-system of Windows: Byte Range Locks, Directory Notfication (so the Explorer updates the view of a directory on changes within that directory), Oplocks (so SMB clients are able to cache the content of files). Allows Windows to run with paging files on Ext2 volumes. UTF-8 encoded file names are supported. The driver treats files with file names that start with a dot "." character ashidden. Supports GPT disks if the Windows version used also does. Supports use of the Windows mountvol utility to create or delete drive letters for Ext2 volumes (except on Windows NT 4.0). See also section"Can drive letters also be configured from scripts?". What features are *not* supported? Inodes that are larger than 128 bytes are not supported. Access rights are not maintained. All users can access all the directories and files of an Ext2 volume. If a new file or directory is created, it inherits all the permissions, the GID and the UID from the directory where it has been created. There is one exception to this rule: a file (but not a directory) the driver has created always has cleared "x" permissions, it inherits the "r" and the "w" permissions only. See also section"What limitations arise from not maintaining access rights?". The driver does not allow accessing special files at Ext2 volumes, the access will be always denied. (Special files are sockets, soft links, block devices, character devices and pipes.) Alternate 8.3-DOS names are not supported (just because there is no place to store them in an Ext2 file system). This can prevent legacy DOS applications, executed by the NTVDM of Windows, from accessing some files or directories. Currently the driver does not implement defragging support. So defragmentation applications will neither show fragmentation information nor defragment any Ext2 volume. This software does not achieve booting a Windows operating system from an Ext2 volume. LVM volumes are not supported, so it is not possible to access them.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值